ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1

This commit is contained in:
speakeasybot
2024-01-05 19:51:29 +00:00
parent eccef7b78c
commit 0538f5b367
20 changed files with 272 additions and 52 deletions

View File

@@ -69,15 +69,17 @@ func merge(ctx context.Context, req resource.UpdateRequest, resp *resource.Updat
return
}
// we need a tftypes.Value for this Object to be able to use it with
// our reflection code
refreshPlan(ctx, plan, target, resp.Diagnostics)
}
func refreshPlan(ctx context.Context, plan types.Object, target interface{}, diagnostics diag.Diagnostics) {
obj := types.ObjectType{AttrTypes: plan.AttributeTypes(ctx)}
val, err := plan.ToTerraformValue(ctx)
if err != nil {
resp.Diagnostics.Append(diag.NewErrorDiagnostic("Object Conversion Error", "An unexpected error was encountered trying to convert object. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error()))
diagnostics.Append(diag.NewErrorDiagnostic("Object Conversion Error", "An unexpected error was encountered trying to convert object. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error()))
return
}
resp.Diagnostics.Append(tfReflect.Into(ctx, obj, val, target, tfReflect.Options{
diagnostics.Append(tfReflect.Into(ctx, obj, val, target, tfReflect.Options{
UnhandledNullAsEmpty: true,
UnhandledUnknownAsEmpty: true,
}, path.Empty())...)