@@ -217,10 +217,10 @@ func (r *resourceConfigurationResource) Read(ctx context.Context, req resource.R
217217 // even though the API returns one. We need to make a raw HTTP call and parse it manually.
218218 // The actual API response format is identical for GET, POST, and PATCH operations.
219219
220- // Get the API client configuration to make a raw HTTP request
220+ // Get the API client configuration to make a raw HTTP request.
221221 cfg := r .client .GetConfig ()
222222
223- // Construct the full URL using the host and scheme from the configuration
223+ // Construct the full URL using the host and scheme from the configuration.
224224 url := fmt .Sprintf ("%s://%s/api/v2/resource_configurations/%s" , cfg .Scheme , cfg .Host , configID )
225225 httpReq , err := http .NewRequestWithContext (ctx , "GET" , url , nil )
226226 if err != nil {
@@ -231,13 +231,13 @@ func (r *resourceConfigurationResource) Read(ctx context.Context, req resource.R
231231 return
232232 }
233233
234- // Add authentication and other headers
234+ // Add authentication and other headers.
235235 for key , value := range cfg .DefaultHeader {
236236 httpReq .Header .Set (key , value )
237237 }
238238 httpReq .Header .Set ("Accept" , "application/json" )
239239
240- // Execute the request using the client's HTTP client
240+ // Execute the request using the client's HTTP client.
241241 httpResponse , err := cfg .HTTPClient .Do (httpReq )
242242 if err != nil {
243243 resp .Diagnostics .AddError (
@@ -246,7 +246,7 @@ func (r *resourceConfigurationResource) Read(ctx context.Context, req resource.R
246246 )
247247 return
248248 }
249- defer httpResponse .Body .Close ()
249+ defer func () { _ = httpResponse .Body .Close () } ()
250250
251251 // Handle 404
252252 if httpResponse .StatusCode == 404 {
@@ -274,7 +274,7 @@ func (r *resourceConfigurationResource) Read(ctx context.Context, req resource.R
274274 return
275275 }
276276
277- // Parse the response using the correct Post200Response type (which has .Data wrapper)
277+ // Parse the response using the correct Post200Response type (which has .Data wrapper).
278278 var configuration api.ResourceConfigurationsPost200Response
279279 if err := json .Unmarshal (bodyBytes , & configuration ); err != nil {
280280 resp .Diagnostics .AddError (
@@ -377,10 +377,10 @@ func (r *resourceConfigurationResource) Update(ctx context.Context, req resource
377377 plan .CreatedAt = types .StringValue (updateResponse .Data .CreatedAt )
378378 plan .UpdatedAt = types .StringValue (updateResponse .Data .UpdatedAt )
379379
380- // Note: We don't update options from the API response because:
381- // 1. The API adds default values that weren't in the plan
382- // 2. This would cause Terraform to see inconsistent values for sensitive attributes
383- // Instead, we keep the planned value which is what the user specified
380+ // Note: We don't update options from the API response because:.
381+ // 1. The API adds default values that weren't in the plan.
382+ // 2. This would cause Terraform to see inconsistent values for sensitive attributes.
383+ // Instead, we keep the planned value which is what the user specified.
384384
385385 diags = resp .State .Set (ctx , plan )
386386 resp .Diagnostics .Append (diags ... )
0 commit comments