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:
stackit-pipeline 2025-05-19 09:56:41 +02:00 committed by GitHub
parent 5d844a84d6
commit 7ce802769c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 222 additions and 225 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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,
},

View file

@ -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"
@ -188,7 +187,7 @@ func (d *zoneDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
resp.State.RemoveResource(ctx)
return
}
if zoneResp != nil && zoneResp.Zone.State != nil && *zoneResp.Zone.State == wait.DeleteSuccess {
if zoneResp != nil && zoneResp.Zone.State != nil && *zoneResp.Zone.State == dns.ZONESTATE_DELETE_SUCCEEDED {
resp.State.RemoveResource(ctx)
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading zone", "Zone was deleted successfully")
return

View file

@ -343,7 +343,7 @@ func (r *zoneResource) Read(ctx context.Context, req resource.ReadRequest, resp
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading zone", fmt.Sprintf("Calling API: %v", err))
return
}
if zoneResp != nil && zoneResp.Zone.State != nil && *zoneResp.Zone.State == wait.DeleteSuccess {
if zoneResp != nil && zoneResp.Zone.State != nil && *zoneResp.Zone.State == dns.ZONESTATE_DELETE_SUCCEEDED {
resp.State.RemoveResource(ctx)
return
}
@ -529,9 +529,9 @@ func mapFields(ctx context.Context, zoneResp *dns.ZoneResponse, model *Model) er
model.RefreshTime = types.Int64PointerValue(z.RefreshTime)
model.RetryTime = types.Int64PointerValue(z.RetryTime)
model.SerialNumber = types.Int64PointerValue(z.SerialNumber)
model.State = types.StringPointerValue(z.State)
model.Type = types.StringPointerValue(z.Type)
model.Visibility = types.StringPointerValue(z.Visibility)
model.State = types.StringValue(string(z.GetState()))
model.Type = types.StringValue(string(z.GetType()))
model.Visibility = types.StringValue(string(z.GetVisibility()))
return nil
}
@ -554,7 +554,7 @@ func toCreatePayload(model *Model) (*dns.CreateZonePayload, error) {
ContactEmail: conversion.StringValueToPointer(model.ContactEmail),
Description: conversion.StringValueToPointer(model.Description),
Acl: conversion.StringValueToPointer(model.Acl),
Type: conversion.StringValueToPointer(model.Type),
Type: dns.CreateZonePayloadGetTypeAttributeType(conversion.StringValueToPointer(model.Type)),
DefaultTTL: conversion.Int64ValueToPointer(model.DefaultTTL),
ExpireTime: conversion.Int64ValueToPointer(model.ExpireTime),
RefreshTime: conversion.Int64ValueToPointer(model.RefreshTime),

View file

@ -43,11 +43,11 @@ func TestMapFields(t *testing.T) {
RetryTime: types.Int64Null(),
SerialNumber: types.Int64Null(),
NegativeCache: types.Int64Null(),
Type: types.StringNull(),
State: types.StringNull(),
Type: types.StringValue(""),
State: types.StringValue(""),
PrimaryNameServer: types.StringNull(),
Primaries: types.ListNull(types.StringType),
Visibility: types.StringNull(),
Visibility: types.StringValue(""),
},
true,
},
@ -72,13 +72,13 @@ func TestMapFields(t *testing.T) {
RetryTime: utils.Ptr(int64(4)),
SerialNumber: utils.Ptr(int64(5)),
NegativeCache: utils.Ptr(int64(6)),
State: utils.Ptr("state"),
Type: utils.Ptr("type"),
State: dns.ZONESTATE_CREATING.Ptr(),
Type: dns.ZONETYPE_PRIMARY.Ptr(),
Primaries: &[]string{"primary"},
PrimaryNameServer: utils.Ptr("pns"),
UpdateStarted: utils.Ptr("ufoo"),
UpdateFinished: utils.Ptr("ubar"),
Visibility: utils.Ptr("visibility"),
Visibility: dns.ZONEVISIBILITY_PUBLIC.Ptr(),
Error: utils.Ptr("error"),
ContactEmail: utils.Ptr("a@b.cd"),
Description: utils.Ptr("description"),
@ -100,13 +100,13 @@ func TestMapFields(t *testing.T) {
RetryTime: types.Int64Value(4),
SerialNumber: types.Int64Value(5),
NegativeCache: types.Int64Value(6),
Type: types.StringValue("type"),
State: types.StringValue("state"),
Type: types.StringValue(string(dns.ZONETYPE_PRIMARY)),
State: types.StringValue(string(dns.ZONESTATE_CREATING)),
PrimaryNameServer: types.StringValue("pns"),
Primaries: types.ListValueMust(types.StringType, []attr.Value{
types.StringValue("primary"),
}),
Visibility: types.StringValue("visibility"),
Visibility: types.StringValue(string(dns.ZONEVISIBILITY_PUBLIC)),
ContactEmail: types.StringValue("a@b.cd"),
Description: types.StringValue("description"),
IsReverseZone: types.BoolValue(false),
@ -139,8 +139,8 @@ func TestMapFields(t *testing.T) {
RetryTime: utils.Ptr(int64(4)),
SerialNumber: utils.Ptr(int64(5)),
NegativeCache: utils.Ptr(int64(6)),
State: utils.Ptr("state"),
Type: utils.Ptr("type"),
State: dns.ZONESTATE_CREATING.Ptr(),
Type: dns.ZONETYPE_PRIMARY.Ptr(),
Primaries: &[]string{
"primary1",
"primary2",
@ -148,7 +148,7 @@ func TestMapFields(t *testing.T) {
PrimaryNameServer: utils.Ptr("pns"),
UpdateStarted: utils.Ptr("ufoo"),
UpdateFinished: utils.Ptr("ubar"),
Visibility: utils.Ptr("visibility"),
Visibility: dns.ZONEVISIBILITY_PUBLIC.Ptr(),
Error: utils.Ptr("error"),
ContactEmail: utils.Ptr("a@b.cd"),
Description: utils.Ptr("description"),
@ -170,14 +170,14 @@ func TestMapFields(t *testing.T) {
RetryTime: types.Int64Value(4),
SerialNumber: types.Int64Value(5),
NegativeCache: types.Int64Value(6),
Type: types.StringValue("type"),
State: types.StringValue("state"),
Type: types.StringValue(string(dns.ZONETYPE_PRIMARY)),
State: types.StringValue(string(dns.ZONESTATE_CREATING)),
PrimaryNameServer: types.StringValue("pns"),
Primaries: types.ListValueMust(types.StringType, []attr.Value{
types.StringValue("primary2"),
types.StringValue("primary1"),
}),
Visibility: types.StringValue("visibility"),
Visibility: types.StringValue(string(dns.ZONEVISIBILITY_PUBLIC)),
ContactEmail: types.StringValue("a@b.cd"),
Description: types.StringValue("description"),
IsReverseZone: types.BoolValue(false),
@ -207,13 +207,13 @@ func TestMapFields(t *testing.T) {
RetryTime: utils.Ptr(int64(4)),
SerialNumber: utils.Ptr(int64(5)),
NegativeCache: utils.Ptr(int64(0)),
State: utils.Ptr("state"),
Type: utils.Ptr("type"),
State: dns.ZONESTATE_CREATING.Ptr(),
Type: dns.ZONETYPE_PRIMARY.Ptr(),
Primaries: nil,
PrimaryNameServer: utils.Ptr("pns"),
UpdateStarted: utils.Ptr("ufoo"),
UpdateFinished: utils.Ptr("ubar"),
Visibility: utils.Ptr("visibility"),
Visibility: dns.ZONEVISIBILITY_PUBLIC.Ptr(),
ContactEmail: nil,
Description: nil,
IsReverseZone: nil,
@ -234,11 +234,11 @@ func TestMapFields(t *testing.T) {
RetryTime: types.Int64Value(4),
SerialNumber: types.Int64Value(5),
NegativeCache: types.Int64Value(0),
Type: types.StringValue("type"),
Type: types.StringValue(string(dns.ZONETYPE_PRIMARY)),
Primaries: types.ListNull(types.StringType),
State: types.StringValue("state"),
State: types.StringValue(string(dns.ZONESTATE_CREATING)),
PrimaryNameServer: types.StringValue("pns"),
Visibility: types.StringValue("visibility"),
Visibility: types.StringValue(string(dns.ZONEVISIBILITY_PUBLIC)),
ContactEmail: types.StringNull(),
Description: types.StringNull(),
IsReverseZone: types.BoolNull(),
@ -310,7 +310,7 @@ func TestToCreatePayload(t *testing.T) {
DnsName: types.StringValue("DnsName"),
Acl: types.StringValue("Acl"),
Description: types.StringValue("Description"),
Type: types.StringValue("Type"),
Type: types.StringValue(string(dns.CREATEZONEPAYLOADTYPE_PRIMARY)),
ContactEmail: types.StringValue("ContactEmail"),
RetryTime: types.Int64Value(3),
RefreshTime: types.Int64Value(4),
@ -327,7 +327,7 @@ func TestToCreatePayload(t *testing.T) {
DnsName: utils.Ptr("DnsName"),
Acl: utils.Ptr("Acl"),
Description: utils.Ptr("Description"),
Type: utils.Ptr("Type"),
Type: dns.CREATEZONEPAYLOADTYPE_PRIMARY.Ptr(),
ContactEmail: utils.Ptr("ContactEmail"),
Primaries: &[]string{"primary"},
RetryTime: utils.Ptr(int64(3)),
@ -390,7 +390,7 @@ func TestToPayloadUpdate(t *testing.T) {
Acl: types.StringValue("Acl"),
Active: types.BoolValue(true),
Description: types.StringValue("Description"),
Type: types.StringValue("Type"),
Type: types.StringValue(string(dns.ZONETYPE_PRIMARY)),
ContactEmail: types.StringValue("ContactEmail"),
PrimaryNameServer: types.StringValue("PrimaryNameServer"),
Primaries: types.ListValueMust(types.StringType, []attr.Value{