Replace ValuePointer function with custom conversion (#121)
This commit is contained in:
parent
b10302c6de
commit
b6100ec8d5
21 changed files with 221 additions and 191 deletions
|
|
@ -451,16 +451,16 @@ func toCreatePayload(model *Model) (*dns.CreateRecordSetPayload, error) {
|
|||
return nil, fmt.Errorf("expected record at index %d to be of type %T, got %T", i, types.String{}, record)
|
||||
}
|
||||
records = append(records, dns.RecordPayload{
|
||||
Content: recordString.ValueStringPointer(),
|
||||
Content: core.StringValueToPointer(recordString),
|
||||
})
|
||||
}
|
||||
|
||||
return &dns.CreateRecordSetPayload{
|
||||
Comment: model.Comment.ValueStringPointer(),
|
||||
Name: model.Name.ValueStringPointer(),
|
||||
Comment: core.StringValueToPointer(model.Comment),
|
||||
Name: core.StringValueToPointer(model.Name),
|
||||
Records: &records,
|
||||
Ttl: model.TTL.ValueInt64Pointer(),
|
||||
Type: model.Type.ValueStringPointer(),
|
||||
Ttl: core.Int64ValueToPointer(model.TTL),
|
||||
Type: core.StringValueToPointer(model.Type),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
@ -476,14 +476,14 @@ func toUpdatePayload(model *Model) (*dns.UpdateRecordSetPayload, error) {
|
|||
return nil, fmt.Errorf("expected record at index %d to be of type %T, got %T", i, types.String{}, record)
|
||||
}
|
||||
records = append(records, dns.RecordPayload{
|
||||
Content: recordString.ValueStringPointer(),
|
||||
Content: core.StringValueToPointer(recordString),
|
||||
})
|
||||
}
|
||||
|
||||
return &dns.UpdateRecordSetPayload{
|
||||
Comment: model.Comment.ValueStringPointer(),
|
||||
Name: model.Name.ValueStringPointer(),
|
||||
Comment: core.StringValueToPointer(model.Comment),
|
||||
Name: core.StringValueToPointer(model.Name),
|
||||
Records: &records,
|
||||
Ttl: model.TTL.ValueInt64Pointer(),
|
||||
Ttl: core.Int64ValueToPointer(model.TTL),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue