Skip to content

Commit

Permalink
Merge pull request #720 from Juniper/task/544-make-struct-anonymous
Browse files Browse the repository at this point in the history
Migrate single-use struct from global context to anonymous
  • Loading branch information
chrismarget-j authored Jul 13, 2024
2 parents 69dd8aa + 8198eb1 commit d66c787
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apstra/data_source_blueprints.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func (o *dataSourceBlueprints) Schema(_ context.Context, _ datasource.SchemaRequ
}

func (o *dataSourceBlueprints) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
var config blueprints
var config struct {
Ids types.Set `tfsdk:"ids"`
RefDesign types.String `tfsdk:"reference_design"`
}
resp.Diagnostics.Append(req.Config.Get(ctx, &config)...)
if resp.Diagnostics.HasError() {
return
Expand Down Expand Up @@ -93,8 +96,3 @@ func (o *dataSourceBlueprints) Read(ctx context.Context, req datasource.ReadRequ
func (o *dataSourceBlueprints) setClient(client *apstra.Client) {
o.client = client
}

type blueprints struct {
Ids types.Set `tfsdk:"ids"`
RefDesign types.String `tfsdk:"reference_design"`
}

0 comments on commit d66c787

Please sign in to comment.