useless-solutions / terraform-provider-statsig

Improved Terraform Provider for Statsig
Mozilla Public License 2.0
1 stars 0 forks source link

[#6] Create Tags Data Source & Get Request Functionality #14

Closed tamirarnesty closed 3 months ago

tamirarnesty commented 3 months ago

Pull Request Details

Related Issues

Partially implements:

Related PRs

N/A

What does this PR do?

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

[!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

Screenshots

Terraform Plan

Screenshot 2024-07-04 at 2 33 47 PM