Update SDK dependencies (#100)
* Update dependencies * Fix tests * Fix field assignment * Update field assignment * Remove unused functions --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
9937717104
commit
c3618f2b63
35 changed files with 249 additions and 224 deletions
|
|
@ -22,7 +22,6 @@ import (
|
|||
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
||||
"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/conversion"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
|
||||
)
|
||||
|
|
@ -452,7 +451,7 @@ func mapFields(recordSetResp *dns.RecordSetResponse, model *Model) error {
|
|||
model.Error = types.StringPointerValue(recordSet.Error)
|
||||
model.Name = types.StringPointerValue(recordSet.Name)
|
||||
model.State = types.StringPointerValue(recordSet.State)
|
||||
model.TTL = conversion.ToTypeInt64(recordSet.Ttl)
|
||||
model.TTL = types.Int64PointerValue(recordSet.Ttl)
|
||||
model.Type = types.StringPointerValue(recordSet.Type)
|
||||
return nil
|
||||
}
|
||||
|
|
@ -477,7 +476,7 @@ func toCreatePayload(model *Model) (*dns.CreateRecordSetPayload, error) {
|
|||
Comment: model.Comment.ValueStringPointer(),
|
||||
Name: model.Name.ValueStringPointer(),
|
||||
Records: &records,
|
||||
Ttl: conversion.ToPtrInt32(model.TTL),
|
||||
Ttl: model.TTL.ValueInt64Pointer(),
|
||||
Type: model.Type.ValueStringPointer(),
|
||||
}, nil
|
||||
}
|
||||
|
|
@ -502,6 +501,6 @@ func toUpdatePayload(model *Model) (*dns.UpdateRecordSetPayload, error) {
|
|||
Comment: model.Comment.ValueStringPointer(),
|
||||
Name: model.Name.ValueStringPointer(),
|
||||
Records: &records,
|
||||
Ttl: conversion.ToPtrInt32(model.TTL),
|
||||
Ttl: model.TTL.ValueInt64Pointer(),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func TestMapFields(t *testing.T) {
|
|||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
State: utils.Ptr("state"),
|
||||
Ttl: utils.Ptr(int32(1)),
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
Type: utils.Ptr("type"),
|
||||
},
|
||||
},
|
||||
|
|
@ -88,7 +88,7 @@ func TestMapFields(t *testing.T) {
|
|||
Name: utils.Ptr("name"),
|
||||
Records: nil,
|
||||
State: utils.Ptr("state"),
|
||||
Ttl: utils.Ptr(int32(2123456789)),
|
||||
Ttl: utils.Ptr(int64(2123456789)),
|
||||
Type: utils.Ptr("type"),
|
||||
},
|
||||
},
|
||||
|
|
@ -178,7 +178,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
{Content: utils.Ptr("record_1")},
|
||||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
Ttl: utils.Ptr(int32(1)),
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
Type: utils.Ptr("type"),
|
||||
},
|
||||
true,
|
||||
|
|
@ -196,7 +196,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
Comment: nil,
|
||||
Name: utils.Ptr(""),
|
||||
Records: &[]dns.RecordPayload{},
|
||||
Ttl: utils.Ptr(int32(2123456789)),
|
||||
Ttl: utils.Ptr(int64(2123456789)),
|
||||
Type: utils.Ptr(""),
|
||||
},
|
||||
true,
|
||||
|
|
@ -260,7 +260,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
{Content: utils.Ptr("record_1")},
|
||||
{Content: utils.Ptr("record_2")},
|
||||
},
|
||||
Ttl: utils.Ptr(int32(1)),
|
||||
Ttl: utils.Ptr(int64(1)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
@ -276,7 +276,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
Comment: nil,
|
||||
Name: utils.Ptr(""),
|
||||
Records: &[]dns.RecordPayload{},
|
||||
Ttl: utils.Ptr(int32(2123456789)),
|
||||
Ttl: utils.Ptr(int64(2123456789)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import (
|
|||
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
||||
"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/conversion"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
|
||||
)
|
||||
|
|
@ -543,17 +542,17 @@ func mapFields(zoneResp *dns.ZoneResponse, model *Model) error {
|
|||
model.Acl = types.StringPointerValue(z.Acl)
|
||||
model.Active = types.BoolPointerValue(z.Active)
|
||||
model.ContactEmail = types.StringPointerValue(z.ContactEmail)
|
||||
model.DefaultTTL = conversion.ToTypeInt64(z.DefaultTTL)
|
||||
model.DefaultTTL = types.Int64PointerValue(z.DefaultTTL)
|
||||
model.DnsName = types.StringPointerValue(z.DnsName)
|
||||
model.ExpireTime = conversion.ToTypeInt64(z.ExpireTime)
|
||||
model.ExpireTime = types.Int64PointerValue(z.ExpireTime)
|
||||
model.IsReverseZone = types.BoolPointerValue(z.IsReverseZone)
|
||||
model.Name = types.StringPointerValue(z.Name)
|
||||
model.NegativeCache = conversion.ToTypeInt64(z.NegativeCache)
|
||||
model.NegativeCache = types.Int64PointerValue(z.NegativeCache)
|
||||
model.PrimaryNameServer = types.StringPointerValue(z.PrimaryNameServer)
|
||||
model.RecordCount = types.Int64PointerValue(rc)
|
||||
model.RefreshTime = conversion.ToTypeInt64(z.RefreshTime)
|
||||
model.RetryTime = conversion.ToTypeInt64(z.RetryTime)
|
||||
model.SerialNumber = conversion.ToTypeInt64(z.SerialNumber)
|
||||
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)
|
||||
|
|
@ -580,11 +579,11 @@ func toCreatePayload(model *Model) (*dns.CreateZonePayload, error) {
|
|||
Description: model.Description.ValueStringPointer(),
|
||||
Acl: model.Acl.ValueStringPointer(),
|
||||
Type: model.Type.ValueStringPointer(),
|
||||
DefaultTTL: conversion.ToPtrInt32(model.DefaultTTL),
|
||||
ExpireTime: conversion.ToPtrInt32(model.ExpireTime),
|
||||
RefreshTime: conversion.ToPtrInt32(model.RefreshTime),
|
||||
RetryTime: conversion.ToPtrInt32(model.RetryTime),
|
||||
NegativeCache: conversion.ToPtrInt32(model.NegativeCache),
|
||||
DefaultTTL: model.DefaultTTL.ValueInt64Pointer(),
|
||||
ExpireTime: model.ExpireTime.ValueInt64Pointer(),
|
||||
RefreshTime: model.RefreshTime.ValueInt64Pointer(),
|
||||
RetryTime: model.RetryTime.ValueInt64Pointer(),
|
||||
NegativeCache: model.NegativeCache.ValueInt64Pointer(),
|
||||
IsReverseZone: model.IsReverseZone.ValueBoolPointer(),
|
||||
Primaries: &modelPrimaries,
|
||||
}, nil
|
||||
|
|
@ -600,11 +599,11 @@ func toUpdatePayload(model *Model) (*dns.UpdateZonePayload, error) {
|
|||
ContactEmail: model.ContactEmail.ValueStringPointer(),
|
||||
Description: model.Description.ValueStringPointer(),
|
||||
Acl: model.Acl.ValueStringPointer(),
|
||||
DefaultTTL: conversion.ToPtrInt32(model.DefaultTTL),
|
||||
ExpireTime: conversion.ToPtrInt32(model.ExpireTime),
|
||||
RefreshTime: conversion.ToPtrInt32(model.RefreshTime),
|
||||
RetryTime: conversion.ToPtrInt32(model.RetryTime),
|
||||
NegativeCache: conversion.ToPtrInt32(model.NegativeCache),
|
||||
DefaultTTL: model.DefaultTTL.ValueInt64Pointer(),
|
||||
ExpireTime: model.ExpireTime.ValueInt64Pointer(),
|
||||
RefreshTime: model.RefreshTime.ValueInt64Pointer(),
|
||||
RetryTime: model.RetryTime.ValueInt64Pointer(),
|
||||
NegativeCache: model.NegativeCache.ValueInt64Pointer(),
|
||||
Primaries: nil, // API returns error if this field is set, even if nothing changes
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ func TestMapFields(t *testing.T) {
|
|||
Active: utils.Ptr(false),
|
||||
CreationStarted: utils.Ptr("bar"),
|
||||
CreationFinished: utils.Ptr("foo"),
|
||||
DefaultTTL: utils.Ptr(int32(1)),
|
||||
ExpireTime: utils.Ptr(int32(2)),
|
||||
RefreshTime: utils.Ptr(int32(3)),
|
||||
RetryTime: utils.Ptr(int32(4)),
|
||||
SerialNumber: utils.Ptr(int32(5)),
|
||||
NegativeCache: utils.Ptr(int32(6)),
|
||||
DefaultTTL: utils.Ptr(int64(1)),
|
||||
ExpireTime: utils.Ptr(int64(2)),
|
||||
RefreshTime: utils.Ptr(int64(3)),
|
||||
RetryTime: utils.Ptr(int64(4)),
|
||||
SerialNumber: utils.Ptr(int64(5)),
|
||||
NegativeCache: utils.Ptr(int64(6)),
|
||||
State: utils.Ptr("state"),
|
||||
Type: utils.Ptr("type"),
|
||||
Primaries: &[]string{"primary"},
|
||||
|
|
@ -73,7 +73,7 @@ func TestMapFields(t *testing.T) {
|
|||
ContactEmail: utils.Ptr("a@b.cd"),
|
||||
Description: utils.Ptr("description"),
|
||||
IsReverseZone: utils.Ptr(false),
|
||||
RecordCount: utils.Ptr(int32(3)),
|
||||
RecordCount: utils.Ptr(int64(3)),
|
||||
},
|
||||
},
|
||||
Model{
|
||||
|
|
@ -115,12 +115,12 @@ func TestMapFields(t *testing.T) {
|
|||
Active: nil,
|
||||
CreationStarted: utils.Ptr("bar"),
|
||||
CreationFinished: utils.Ptr("foo"),
|
||||
DefaultTTL: utils.Ptr(int32(2123456789)),
|
||||
ExpireTime: utils.Ptr(int32(-2)),
|
||||
RefreshTime: utils.Ptr(int32(3)),
|
||||
RetryTime: utils.Ptr(int32(4)),
|
||||
SerialNumber: utils.Ptr(int32(5)),
|
||||
NegativeCache: utils.Ptr(int32(0)),
|
||||
DefaultTTL: utils.Ptr(int64(2123456789)),
|
||||
ExpireTime: utils.Ptr(int64(-2)),
|
||||
RefreshTime: utils.Ptr(int64(3)),
|
||||
RetryTime: utils.Ptr(int64(4)),
|
||||
SerialNumber: utils.Ptr(int64(5)),
|
||||
NegativeCache: utils.Ptr(int64(0)),
|
||||
State: utils.Ptr("state"),
|
||||
Type: utils.Ptr("type"),
|
||||
Primaries: nil,
|
||||
|
|
@ -131,7 +131,7 @@ func TestMapFields(t *testing.T) {
|
|||
ContactEmail: nil,
|
||||
Description: nil,
|
||||
IsReverseZone: nil,
|
||||
RecordCount: utils.Ptr(int32(-2123456789)),
|
||||
RecordCount: utils.Ptr(int64(-2123456789)),
|
||||
},
|
||||
},
|
||||
Model{
|
||||
|
|
@ -242,11 +242,11 @@ func TestToCreatePayload(t *testing.T) {
|
|||
Type: utils.Ptr("Type"),
|
||||
ContactEmail: utils.Ptr("ContactEmail"),
|
||||
Primaries: &[]string{"primary"},
|
||||
RetryTime: utils.Ptr(int32(3)),
|
||||
RefreshTime: utils.Ptr(int32(4)),
|
||||
ExpireTime: utils.Ptr(int32(5)),
|
||||
DefaultTTL: utils.Ptr(int32(4534534)),
|
||||
NegativeCache: utils.Ptr(int32(-4534534)),
|
||||
RetryTime: utils.Ptr(int64(3)),
|
||||
RefreshTime: utils.Ptr(int64(4)),
|
||||
ExpireTime: utils.Ptr(int64(5)),
|
||||
DefaultTTL: utils.Ptr(int64(4534534)),
|
||||
NegativeCache: utils.Ptr(int64(-4534534)),
|
||||
IsReverseZone: utils.Ptr(true),
|
||||
},
|
||||
true,
|
||||
|
|
@ -320,11 +320,11 @@ func TestToPayloadUpdate(t *testing.T) {
|
|||
Acl: utils.Ptr("Acl"),
|
||||
Description: utils.Ptr("Description"),
|
||||
ContactEmail: utils.Ptr("ContactEmail"),
|
||||
RetryTime: utils.Ptr(int32(3)),
|
||||
RefreshTime: utils.Ptr(int32(4)),
|
||||
ExpireTime: utils.Ptr(int32(5)),
|
||||
DefaultTTL: utils.Ptr(int32(4534534)),
|
||||
NegativeCache: utils.Ptr(int32(-4534534)),
|
||||
RetryTime: utils.Ptr(int64(3)),
|
||||
RefreshTime: utils.Ptr(int64(4)),
|
||||
ExpireTime: utils.Ptr(int64(5)),
|
||||
DefaultTTL: utils.Ptr(int64(4534534)),
|
||||
NegativeCache: utils.Ptr(int64(-4534534)),
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue