Skip to content

Commit

Permalink
Rename structures
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorGFM committed Oct 2, 2023
1 parent 998fa05 commit 08ae845
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cyral/data_source_cyral_sidecar_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func dataSourceSidecarInstance() *schema.Resource {
)
},
NewResponseData: func(_ *schema.ResourceData) ResponseData {
return &SidecarInstancesWrapper{}
return &SidecarInstances{}
},
}),
Schema: map[string]*schema.Schema{
Expand Down
4 changes: 2 additions & 2 deletions cyral/data_source_cyral_sidecar_instance_ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

type SidecarDetails struct {
Instances []SidecarInstanceIDWrapper `json:"instances,omitempty"`
Instances []DeprecatedSidecarInstances `json:"instances,omitempty"`
}

type SidecarInstanceIDWrapper struct {
type DeprecatedSidecarInstances struct {
ASGInstanceID string `json:"asg_instance,omitempty"`
}

Expand Down
6 changes: 3 additions & 3 deletions cyral/model_sidecar_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

type SidecarInstancesWrapper struct {
type SidecarInstances struct {
Instances []SidecarInstance `json:"instances"`
}

func (wrapper *SidecarInstancesWrapper) WriteToSchema(d *schema.ResourceData) error {
func (wrapper *SidecarInstances) WriteToSchema(d *schema.ResourceData) error {
d.SetId(uuid.New().String())
d.Set(SidecarInstanceListKey, wrapper.InstancesToInterfaceList())
return nil
}

func (wrapper *SidecarInstancesWrapper) InstancesToInterfaceList() []any {
func (wrapper *SidecarInstances) InstancesToInterfaceList() []any {
instancesInterfaceList := make([]any, len(wrapper.Instances))
for index, instance := range wrapper.Instances {
instancesInterfaceList[index] = instance.ToMap()
Expand Down

0 comments on commit 08ae845

Please sign in to comment.