I'm trying to add a data source data_source_person that supports 2 methods of input:
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Optional: true,
},
"first_name": {
Type: schema.TypeString,
Computed: true,
Optional: true,
},
},
Namely, a value for either id or first_name should be specified but not both (it's a oneOf relationship).
In case "id" is specified the code will execute GET /people/{ID} otherwise "display_name" must be specified and in this scenario GET /people will be called that will return a list of people and the code will run a filter to find the ID of a person that have response.data.people[i].display_name == {providedDisplayName}.
Does TF data sources support this kind of configuration (both attributes are computed, optional)?