Update SDK dependency (#177)
* Update dependencies * Update dependencies * Update dependencies * Update dependencies --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
506d1afdc2
commit
c7effac5c7
62 changed files with 382 additions and 382 deletions
|
|
@ -361,12 +361,12 @@ func (r *instanceResource) Update(ctx context.Context, req resource.UpdateReques
|
|||
return
|
||||
}
|
||||
// Update existing instance
|
||||
err = r.client.UpdateInstance(ctx, projectId, instanceId).UpdateInstancePayload(*payload).Execute()
|
||||
err = r.client.PartialUpdateInstance(ctx, projectId, instanceId).PartialUpdateInstancePayload(*payload).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
}
|
||||
waitResp, err := wait.UpdateInstanceWaitHandler(ctx, r.client, projectId, instanceId).WaitWithContext(ctx)
|
||||
waitResp, err := wait.PartialUpdateInstanceWaitHandler(ctx, r.client, projectId, instanceId).WaitWithContext(ctx)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", fmt.Sprintf("Instance update waiting: %v", err))
|
||||
return
|
||||
|
|
@ -594,17 +594,17 @@ func toCreatePayload(model *Model, parameters *parametersModel) (*redis.CreateIn
|
|||
}, nil
|
||||
}
|
||||
|
||||
func toUpdatePayload(model *Model, parameters *parametersModel) (*redis.UpdateInstancePayload, error) {
|
||||
func toUpdatePayload(model *Model, parameters *parametersModel) (*redis.PartialUpdateInstancePayload, error) {
|
||||
if model == nil {
|
||||
return nil, fmt.Errorf("nil model")
|
||||
}
|
||||
|
||||
if parameters == nil {
|
||||
return &redis.UpdateInstancePayload{
|
||||
return &redis.PartialUpdateInstancePayload{
|
||||
PlanId: conversion.StringValueToPointer(model.PlanId),
|
||||
}, nil
|
||||
}
|
||||
return &redis.UpdateInstancePayload{
|
||||
return &redis.PartialUpdateInstancePayload{
|
||||
Parameters: &redis.InstanceParameters{
|
||||
SgwAcl: conversion.StringValueToPointer(parameters.SgwAcl),
|
||||
},
|
||||
|
|
@ -614,7 +614,7 @@ func toUpdatePayload(model *Model, parameters *parametersModel) (*redis.UpdateIn
|
|||
|
||||
func (r *instanceResource) loadPlanId(ctx context.Context, model *Model) error {
|
||||
projectId := model.ProjectId.ValueString()
|
||||
res, err := r.client.GetOfferings(ctx, projectId).Execute()
|
||||
res, err := r.client.ListOfferings(ctx, projectId).Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting Redis offerings: %w", err)
|
||||
}
|
||||
|
|
@ -652,7 +652,7 @@ func (r *instanceResource) loadPlanId(ctx context.Context, model *Model) error {
|
|||
func loadPlanNameAndVersion(ctx context.Context, client *redis.APIClient, model *Model) error {
|
||||
projectId := model.ProjectId.ValueString()
|
||||
planId := model.PlanId.ValueString()
|
||||
res, err := client.GetOfferings(ctx, projectId).Execute()
|
||||
res, err := client.ListOfferings(ctx, projectId).Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting Redis offerings: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,14 +221,14 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
description string
|
||||
input *Model
|
||||
inputParameters *parametersModel
|
||||
expected *redis.UpdateInstancePayload
|
||||
expected *redis.PartialUpdateInstancePayload
|
||||
isValid bool
|
||||
}{
|
||||
{
|
||||
"default_values",
|
||||
&Model{},
|
||||
¶metersModel{},
|
||||
&redis.UpdateInstancePayload{
|
||||
&redis.PartialUpdateInstancePayload{
|
||||
Parameters: &redis.InstanceParameters{},
|
||||
},
|
||||
true,
|
||||
|
|
@ -241,7 +241,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
¶metersModel{
|
||||
SgwAcl: types.StringValue("sgw"),
|
||||
},
|
||||
&redis.UpdateInstancePayload{
|
||||
&redis.PartialUpdateInstancePayload{
|
||||
Parameters: &redis.InstanceParameters{
|
||||
SgwAcl: utils.Ptr("sgw"),
|
||||
},
|
||||
|
|
@ -257,7 +257,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
¶metersModel{
|
||||
SgwAcl: types.StringNull(),
|
||||
},
|
||||
&redis.UpdateInstancePayload{
|
||||
&redis.PartialUpdateInstancePayload{
|
||||
Parameters: &redis.InstanceParameters{
|
||||
SgwAcl: nil,
|
||||
},
|
||||
|
|
@ -278,7 +278,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
PlanId: types.StringValue("plan"),
|
||||
},
|
||||
nil,
|
||||
&redis.UpdateInstancePayload{
|
||||
&redis.PartialUpdateInstancePayload{
|
||||
PlanId: utils.Ptr("plan"),
|
||||
},
|
||||
true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue