This PR creates an initial TagsDataSource and Get request method to connect to the Console API and fetch a list of tags.
Description of Changes
Create tag data source with base type and response type
Create API response type for endpoint
Implement Get request method with base build/do methods to perform the request
Implement tags data source schema
Move client to statsig package alongside models to avoid circular imports
[!NOTE]
The API uses camelCase notation, while terraform strictly uses snake_case. This results in conflicts when attempting to unmarshal the response into Go structs with Terraform restrictions.
Thus, the schema and Tag type have Go fields written as camel case, while the tfsdk mapping uses snake_case.
Eg.
type Tag struct {
ID string `tfsdk:"id"`
Name string `tfsdk:"name"`
Description string `tfsdk:"description"`
IsCore bool `tfsdk:"is_core"` // Note the is_core vs IsCore
}
Acceptance Criteria
~[ ] New tests added or existing tests modified~
[x] Issue criteria met
Will need to create a second PR to create the Resource object and the Post method
Pull Request Details
Related Issues
Partially implements:
6
Related PRs
N/A
What does this PR do?
This PR creates an initial
TagsDataSource
andGet
request method to connect to the Console API and fetch a list of tags.Description of Changes
Get
request method with base build/do methods to perform the requeststatsig
package alongside models to avoid circular importsAcceptance Criteria
Will need to create a second PR to create the
Resource
object and thePost
methodScreenshots
Terraform Plan