fix(deps): update stackit sdk modules (#846)
* fix(deps): update stackit sdk modules * feat: Use new generated enums Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
This commit is contained in:
parent
5d844a84d6
commit
7ce802769c
33 changed files with 222 additions and 225 deletions
|
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
"github.com/hashicorp/terraform-plugin-log/tflog"
|
||||
"github.com/stackitcloud/stackit-sdk-go/services/dns"
|
||||
"github.com/stackitcloud/stackit-sdk-go/services/dns/wait"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
|
||||
|
|
@ -158,7 +157,7 @@ func (d *recordSetDataSource) Read(ctx context.Context, req datasource.ReadReque
|
|||
resp.State.RemoveResource(ctx)
|
||||
return
|
||||
}
|
||||
if recordSetResp != nil && recordSetResp.Rrset.State != nil && *recordSetResp.Rrset.State == wait.DeleteSuccess {
|
||||
if recordSetResp != nil && recordSetResp.Rrset.State != nil && *recordSetResp.Rrset.State == dns.RECORDSETSTATE_DELETE_SUCCEEDED {
|
||||
resp.State.RemoveResource(ctx)
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading record set", "Record set was deleted successfully")
|
||||
return
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ func (r *recordSetResource) Read(ctx context.Context, req resource.ReadRequest,
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading record set", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
}
|
||||
if recordSetResp != nil && recordSetResp.Rrset.State != nil && *recordSetResp.Rrset.State == wait.DeleteSuccess {
|
||||
if recordSetResp != nil && recordSetResp.Rrset.State != nil && *recordSetResp.Rrset.State == dns.RECORDSETSTATE_DELETE_SUCCEEDED {
|
||||
resp.State.RemoveResource(ctx)
|
||||
return
|
||||
}
|
||||
|
|
@ -436,9 +436,9 @@ func mapFields(ctx context.Context, recordSetResp *dns.RecordSetResponse, model
|
|||
model.Name = types.StringPointerValue(recordSet.Name)
|
||||
}
|
||||
model.FQDN = types.StringPointerValue(recordSet.Name)
|
||||
model.State = types.StringPointerValue(recordSet.State)
|
||||
model.State = types.StringValue(string(recordSet.GetState()))
|
||||
model.TTL = types.Int64PointerValue(recordSet.Ttl)
|
||||
model.Type = types.StringPointerValue(recordSet.Type)
|
||||
model.Type = types.StringValue(string(recordSet.GetType()))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ func toCreatePayload(model *Model) (*dns.CreateRecordSetPayload, error) {
|
|||
Name: conversion.StringValueToPointer(model.Name),
|
||||
Records: &records,
|
||||
Ttl: conversion.Int64ValueToPointer(model.TTL),
|
||||
Type: conversion.StringValueToPointer(model.Type),
|
||||
Type: dns.CreateRecordSetPayloadGetTypeAttributeType(conversion.StringValueToPointer(model.Type)),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ func TestMapFields(t *testing.T) {
|
|||
Name: types.StringNull(),
|
||||
FQDN: types.StringNull(),
|
||||
Records: types.ListNull(types.StringType),
|
||||
State: types.StringNull(),
|
||||
State: types.StringValue(""),
|
||||
TTL: types.Int64Null(),
|
||||
Type: types.StringNull(),
|
||||
Type: types.StringValue(""),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -64,9 +64,9 @@ func TestMapFields(t *testing.T) {
|
|||
{Content: utils.Ptr("record_1")},
|
||||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
State: utils.Ptr("state"),
|
||||
State: dns.RECORDSETSTATE_CREATING.Ptr(),
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
Type: utils.Ptr("type"),
|
||||
Type: dns.RECORDSETTYPE_A.Ptr(),
|
||||
},
|
||||
},
|
||||
Model{
|
||||
|
|
@ -83,9 +83,9 @@ func TestMapFields(t *testing.T) {
|
|||
types.StringValue("record_1"),
|
||||
types.StringValue("record_2"),
|
||||
}),
|
||||
State: types.StringValue("state"),
|
||||
State: types.StringValue(string(dns.RECORDSETSTATE_CREATING)),
|
||||
TTL: types.Int64Value(1),
|
||||
Type: types.StringValue("type"),
|
||||
Type: types.StringValue(string(dns.RECORDSETTYPE_A)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -110,9 +110,9 @@ func TestMapFields(t *testing.T) {
|
|||
{Content: utils.Ptr("record_1")},
|
||||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
State: utils.Ptr("state"),
|
||||
State: dns.RECORDSETSTATE_CREATING.Ptr(),
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
Type: utils.Ptr("type"),
|
||||
Type: dns.RECORDSETTYPE_A.Ptr(),
|
||||
},
|
||||
},
|
||||
Model{
|
||||
|
|
@ -129,9 +129,9 @@ func TestMapFields(t *testing.T) {
|
|||
types.StringValue("record_2"),
|
||||
types.StringValue("record_1"),
|
||||
}),
|
||||
State: types.StringValue("state"),
|
||||
State: types.StringValue(string(dns.RECORDSETSTATE_CREATING)),
|
||||
TTL: types.Int64Value(1),
|
||||
Type: types.StringValue("type"),
|
||||
Type: types.StringValue(string(dns.RECORDSETTYPE_A)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -150,9 +150,9 @@ func TestMapFields(t *testing.T) {
|
|||
Error: nil,
|
||||
Name: utils.Ptr("name"),
|
||||
Records: nil,
|
||||
State: utils.Ptr("state"),
|
||||
State: dns.RECORDSETSTATE_CREATING.Ptr(),
|
||||
Ttl: utils.Ptr(int64(2123456789)),
|
||||
Type: utils.Ptr("type"),
|
||||
Type: dns.RECORDSETTYPE_A.Ptr(),
|
||||
},
|
||||
},
|
||||
Model{
|
||||
|
|
@ -166,9 +166,9 @@ func TestMapFields(t *testing.T) {
|
|||
Name: types.StringValue("other-name"),
|
||||
FQDN: types.StringValue("name"),
|
||||
Records: types.ListNull(types.StringType),
|
||||
State: types.StringValue("state"),
|
||||
State: types.StringValue(string(dns.RECORDSETSTATE_CREATING)),
|
||||
TTL: types.Int64Value(2123456789),
|
||||
Type: types.StringValue("type"),
|
||||
Type: types.StringValue(string(dns.RECORDSETTYPE_A)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -237,7 +237,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
types.StringValue("record_2"),
|
||||
}),
|
||||
TTL: types.Int64Value(1),
|
||||
Type: types.StringValue("type"),
|
||||
Type: types.StringValue(string(dns.RECORDSETTYPE_A)),
|
||||
},
|
||||
&dns.CreateRecordSetPayload{
|
||||
Comment: utils.Ptr("comment"),
|
||||
|
|
@ -247,7 +247,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
Type: utils.Ptr("type"),
|
||||
Type: dns.CREATERECORDSETPAYLOADTYPE_A.Ptr(),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -258,14 +258,14 @@ func TestToCreatePayload(t *testing.T) {
|
|||
Name: types.StringValue(""),
|
||||
Records: types.ListValueMust(types.StringType, nil),
|
||||
TTL: types.Int64Value(2123456789),
|
||||
Type: types.StringValue(""),
|
||||
Type: types.StringValue(string(dns.RECORDSETTYPE_A)),
|
||||
},
|
||||
&dns.CreateRecordSetPayload{
|
||||
Comment: nil,
|
||||
Name: utils.Ptr(""),
|
||||
Records: &[]dns.RecordPayload{},
|
||||
Ttl: utils.Ptr(int64(2123456789)),
|
||||
Type: utils.Ptr(""),
|
||||
Type: dns.CREATERECORDSETPAYLOADTYPE_A.Ptr(),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue