terraform-provider-stackitp.../pkg/sqlserverflexalpha/model_create_instance_request_payload.go
Marcel S. Henselin 2733834fc9
Some checks failed
CI Workflow / CI (push) Has been cancelled
CI Workflow / Check GoReleaser config (push) Has been cancelled
CI Workflow / Code coverage report (push) Has been cancelled
Alpha (#4)
* chore: initial push to be able to work together

* chore: add missing wait folder

* chore: add missing folders

* chore: cleanup alpha branch

* feat: mssql alpha instance (#2)

* fix: remove unused attribute types and functions from backup models

* fix: update API client references to use sqlserverflexalpha package

* fix: update package references to use sqlserverflexalpha and modify user data source model

* fix: add sqlserverflexalpha user data source to provider

* fix: add sqlserverflexalpha user resource and update related functionality

* chore: add stackit_sqlserverflexalpha_user resource and instance_id variable

* fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database

---------

Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>

* feat: add sqlserver instance

* chore: fixing tests

* chore: update docs

---------

Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
2025-12-19 11:37:53 +01:00

489 lines
19 KiB
Go

/*
STACKIT MSSQL Service API
This is the documentation for the STACKIT MSSQL service
API version: 3alpha1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package sqlserverflexalpha
import (
"encoding/json"
)
// checks if the CreateInstanceRequestPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateInstanceRequestPayload{}
/*
types and functions for acl
*/
// isArray
type CreateInstanceRequestPayloadGetAclAttributeType = *[]string
type CreateInstanceRequestPayloadGetAclArgType = []string
type CreateInstanceRequestPayloadGetAclRetType = []string
func getCreateInstanceRequestPayloadGetAclAttributeTypeOk(arg CreateInstanceRequestPayloadGetAclAttributeType) (ret CreateInstanceRequestPayloadGetAclRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetAclAttributeType(arg *CreateInstanceRequestPayloadGetAclAttributeType, val CreateInstanceRequestPayloadGetAclRetType) {
*arg = &val
}
/*
types and functions for backupSchedule
*/
// isNotNullableString
type CreateInstanceRequestPayloadGetBackupScheduleAttributeType = *string
func getCreateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(arg CreateInstanceRequestPayloadGetBackupScheduleAttributeType) (ret CreateInstanceRequestPayloadGetBackupScheduleRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetBackupScheduleAttributeType(arg *CreateInstanceRequestPayloadGetBackupScheduleAttributeType, val CreateInstanceRequestPayloadGetBackupScheduleRetType) {
*arg = &val
}
type CreateInstanceRequestPayloadGetBackupScheduleArgType = string
type CreateInstanceRequestPayloadGetBackupScheduleRetType = string
/*
types and functions for encryption
*/
// isModel
type CreateInstanceRequestPayloadGetEncryptionAttributeType = *InstanceEncryption
type CreateInstanceRequestPayloadGetEncryptionArgType = InstanceEncryption
type CreateInstanceRequestPayloadGetEncryptionRetType = InstanceEncryption
func getCreateInstanceRequestPayloadGetEncryptionAttributeTypeOk(arg CreateInstanceRequestPayloadGetEncryptionAttributeType) (ret CreateInstanceRequestPayloadGetEncryptionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetEncryptionAttributeType(arg *CreateInstanceRequestPayloadGetEncryptionAttributeType, val CreateInstanceRequestPayloadGetEncryptionRetType) {
*arg = &val
}
/*
types and functions for flavorId
*/
// isNotNullableString
type CreateInstanceRequestPayloadGetFlavorIdAttributeType = *string
func getCreateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(arg CreateInstanceRequestPayloadGetFlavorIdAttributeType) (ret CreateInstanceRequestPayloadGetFlavorIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetFlavorIdAttributeType(arg *CreateInstanceRequestPayloadGetFlavorIdAttributeType, val CreateInstanceRequestPayloadGetFlavorIdRetType) {
*arg = &val
}
type CreateInstanceRequestPayloadGetFlavorIdArgType = string
type CreateInstanceRequestPayloadGetFlavorIdRetType = string
/*
types and functions for name
*/
// isNotNullableString
type CreateInstanceRequestPayloadGetNameAttributeType = *string
func getCreateInstanceRequestPayloadGetNameAttributeTypeOk(arg CreateInstanceRequestPayloadGetNameAttributeType) (ret CreateInstanceRequestPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetNameAttributeType(arg *CreateInstanceRequestPayloadGetNameAttributeType, val CreateInstanceRequestPayloadGetNameRetType) {
*arg = &val
}
type CreateInstanceRequestPayloadGetNameArgType = string
type CreateInstanceRequestPayloadGetNameRetType = string
/*
types and functions for network
*/
// isModel
type CreateInstanceRequestPayloadGetNetworkAttributeType = *CreateInstanceRequestPayloadNetwork
type CreateInstanceRequestPayloadGetNetworkArgType = CreateInstanceRequestPayloadNetwork
type CreateInstanceRequestPayloadGetNetworkRetType = CreateInstanceRequestPayloadNetwork
func getCreateInstanceRequestPayloadGetNetworkAttributeTypeOk(arg CreateInstanceRequestPayloadGetNetworkAttributeType) (ret CreateInstanceRequestPayloadGetNetworkRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetNetworkAttributeType(arg *CreateInstanceRequestPayloadGetNetworkAttributeType, val CreateInstanceRequestPayloadGetNetworkRetType) {
*arg = &val
}
/*
types and functions for retentionDays
*/
// isInteger
type CreateInstanceRequestPayloadGetRetentionDaysAttributeType = *int64
type CreateInstanceRequestPayloadGetRetentionDaysArgType = int64
type CreateInstanceRequestPayloadGetRetentionDaysRetType = int64
func getCreateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(arg CreateInstanceRequestPayloadGetRetentionDaysAttributeType) (ret CreateInstanceRequestPayloadGetRetentionDaysRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetRetentionDaysAttributeType(arg *CreateInstanceRequestPayloadGetRetentionDaysAttributeType, val CreateInstanceRequestPayloadGetRetentionDaysRetType) {
*arg = &val
}
/*
types and functions for storage
*/
// isModel
type CreateInstanceRequestPayloadGetStorageAttributeType = *StorageCreate
type CreateInstanceRequestPayloadGetStorageArgType = StorageCreate
type CreateInstanceRequestPayloadGetStorageRetType = StorageCreate
func getCreateInstanceRequestPayloadGetStorageAttributeTypeOk(arg CreateInstanceRequestPayloadGetStorageAttributeType) (ret CreateInstanceRequestPayloadGetStorageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetStorageAttributeType(arg *CreateInstanceRequestPayloadGetStorageAttributeType, val CreateInstanceRequestPayloadGetStorageRetType) {
*arg = &val
}
/*
types and functions for version
*/
// isEnumRef
type CreateInstanceRequestPayloadGetVersionAttributeType = *InstanceVersion
type CreateInstanceRequestPayloadGetVersionArgType = InstanceVersion
type CreateInstanceRequestPayloadGetVersionRetType = InstanceVersion
func getCreateInstanceRequestPayloadGetVersionAttributeTypeOk(arg CreateInstanceRequestPayloadGetVersionAttributeType) (ret CreateInstanceRequestPayloadGetVersionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateInstanceRequestPayloadGetVersionAttributeType(arg *CreateInstanceRequestPayloadGetVersionAttributeType, val CreateInstanceRequestPayloadGetVersionRetType) {
*arg = &val
}
// CreateInstanceRequestPayload struct for CreateInstanceRequestPayload
type CreateInstanceRequestPayload struct {
// Deprecated: List of IPV4 cidr.
// REQUIRED
Acl CreateInstanceRequestPayloadGetAclAttributeType `json:"acl" required:"true"`
// The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
// REQUIRED
BackupSchedule CreateInstanceRequestPayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"`
Encryption CreateInstanceRequestPayloadGetEncryptionAttributeType `json:"encryption,omitempty"`
// The id of the instance flavor.
// REQUIRED
FlavorId CreateInstanceRequestPayloadGetFlavorIdAttributeType `json:"flavorId" required:"true"`
// The name of the instance.
// REQUIRED
Name CreateInstanceRequestPayloadGetNameAttributeType `json:"name" required:"true"`
Network CreateInstanceRequestPayloadGetNetworkAttributeType `json:"network,omitempty"`
// The days for how long the backup files should be stored before cleaned up. 30 to 365
// Can be cast to int32 without loss of precision.
// REQUIRED
RetentionDays CreateInstanceRequestPayloadGetRetentionDaysAttributeType `json:"retentionDays" required:"true"`
// REQUIRED
Storage CreateInstanceRequestPayloadGetStorageAttributeType `json:"storage" required:"true"`
// REQUIRED
Version CreateInstanceRequestPayloadGetVersionAttributeType `json:"version" required:"true"`
}
type _CreateInstanceRequestPayload CreateInstanceRequestPayload
// NewCreateInstanceRequestPayload instantiates a new CreateInstanceRequestPayload object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateInstanceRequestPayload(acl CreateInstanceRequestPayloadGetAclArgType, backupSchedule CreateInstanceRequestPayloadGetBackupScheduleArgType, flavorId CreateInstanceRequestPayloadGetFlavorIdArgType, name CreateInstanceRequestPayloadGetNameArgType, retentionDays CreateInstanceRequestPayloadGetRetentionDaysArgType, storage CreateInstanceRequestPayloadGetStorageArgType, version CreateInstanceRequestPayloadGetVersionArgType) *CreateInstanceRequestPayload {
this := CreateInstanceRequestPayload{}
setCreateInstanceRequestPayloadGetAclAttributeType(&this.Acl, acl)
setCreateInstanceRequestPayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule)
setCreateInstanceRequestPayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId)
setCreateInstanceRequestPayloadGetNameAttributeType(&this.Name, name)
setCreateInstanceRequestPayloadGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays)
setCreateInstanceRequestPayloadGetStorageAttributeType(&this.Storage, storage)
setCreateInstanceRequestPayloadGetVersionAttributeType(&this.Version, version)
return &this
}
// NewCreateInstanceRequestPayloadWithDefaults instantiates a new CreateInstanceRequestPayload object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateInstanceRequestPayloadWithDefaults() *CreateInstanceRequestPayload {
this := CreateInstanceRequestPayload{}
return &this
}
// GetAcl returns the Acl field value
// Deprecated
func (o *CreateInstanceRequestPayload) GetAcl() (ret CreateInstanceRequestPayloadGetAclRetType) {
ret, _ = o.GetAclOk()
return ret
}
// GetAclOk returns a tuple with the Acl field value
// and a boolean to check if the value has been set.
// Deprecated
func (o *CreateInstanceRequestPayload) GetAclOk() (ret CreateInstanceRequestPayloadGetAclRetType, ok bool) {
return getCreateInstanceRequestPayloadGetAclAttributeTypeOk(o.Acl)
}
// SetAcl sets field value
// Deprecated
func (o *CreateInstanceRequestPayload) SetAcl(v CreateInstanceRequestPayloadGetAclRetType) {
setCreateInstanceRequestPayloadGetAclAttributeType(&o.Acl, v)
}
// GetBackupSchedule returns the BackupSchedule field value
func (o *CreateInstanceRequestPayload) GetBackupSchedule() (ret CreateInstanceRequestPayloadGetBackupScheduleRetType) {
ret, _ = o.GetBackupScheduleOk()
return ret
}
// GetBackupScheduleOk returns a tuple with the BackupSchedule field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetBackupScheduleOk() (ret CreateInstanceRequestPayloadGetBackupScheduleRetType, ok bool) {
return getCreateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule)
}
// SetBackupSchedule sets field value
func (o *CreateInstanceRequestPayload) SetBackupSchedule(v CreateInstanceRequestPayloadGetBackupScheduleRetType) {
setCreateInstanceRequestPayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v)
}
// GetEncryption returns the Encryption field value if set, zero value otherwise.
func (o *CreateInstanceRequestPayload) GetEncryption() (res CreateInstanceRequestPayloadGetEncryptionRetType) {
res, _ = o.GetEncryptionOk()
return
}
// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetEncryptionOk() (ret CreateInstanceRequestPayloadGetEncryptionRetType, ok bool) {
return getCreateInstanceRequestPayloadGetEncryptionAttributeTypeOk(o.Encryption)
}
// HasEncryption returns a boolean if a field has been set.
func (o *CreateInstanceRequestPayload) HasEncryption() bool {
_, ok := o.GetEncryptionOk()
return ok
}
// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field.
func (o *CreateInstanceRequestPayload) SetEncryption(v CreateInstanceRequestPayloadGetEncryptionRetType) {
setCreateInstanceRequestPayloadGetEncryptionAttributeType(&o.Encryption, v)
}
// GetFlavorId returns the FlavorId field value
func (o *CreateInstanceRequestPayload) GetFlavorId() (ret CreateInstanceRequestPayloadGetFlavorIdRetType) {
ret, _ = o.GetFlavorIdOk()
return ret
}
// GetFlavorIdOk returns a tuple with the FlavorId field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetFlavorIdOk() (ret CreateInstanceRequestPayloadGetFlavorIdRetType, ok bool) {
return getCreateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId)
}
// SetFlavorId sets field value
func (o *CreateInstanceRequestPayload) SetFlavorId(v CreateInstanceRequestPayloadGetFlavorIdRetType) {
setCreateInstanceRequestPayloadGetFlavorIdAttributeType(&o.FlavorId, v)
}
// GetName returns the Name field value
func (o *CreateInstanceRequestPayload) GetName() (ret CreateInstanceRequestPayloadGetNameRetType) {
ret, _ = o.GetNameOk()
return ret
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetNameOk() (ret CreateInstanceRequestPayloadGetNameRetType, ok bool) {
return getCreateInstanceRequestPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *CreateInstanceRequestPayload) SetName(v CreateInstanceRequestPayloadGetNameRetType) {
setCreateInstanceRequestPayloadGetNameAttributeType(&o.Name, v)
}
// GetNetwork returns the Network field value if set, zero value otherwise.
func (o *CreateInstanceRequestPayload) GetNetwork() (res CreateInstanceRequestPayloadGetNetworkRetType) {
res, _ = o.GetNetworkOk()
return
}
// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetNetworkOk() (ret CreateInstanceRequestPayloadGetNetworkRetType, ok bool) {
return getCreateInstanceRequestPayloadGetNetworkAttributeTypeOk(o.Network)
}
// HasNetwork returns a boolean if a field has been set.
func (o *CreateInstanceRequestPayload) HasNetwork() bool {
_, ok := o.GetNetworkOk()
return ok
}
// SetNetwork gets a reference to the given CreateInstanceRequestPayloadNetwork and assigns it to the Network field.
func (o *CreateInstanceRequestPayload) SetNetwork(v CreateInstanceRequestPayloadGetNetworkRetType) {
setCreateInstanceRequestPayloadGetNetworkAttributeType(&o.Network, v)
}
// GetRetentionDays returns the RetentionDays field value
func (o *CreateInstanceRequestPayload) GetRetentionDays() (ret CreateInstanceRequestPayloadGetRetentionDaysRetType) {
ret, _ = o.GetRetentionDaysOk()
return ret
}
// GetRetentionDaysOk returns a tuple with the RetentionDays field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetRetentionDaysOk() (ret CreateInstanceRequestPayloadGetRetentionDaysRetType, ok bool) {
return getCreateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays)
}
// SetRetentionDays sets field value
func (o *CreateInstanceRequestPayload) SetRetentionDays(v CreateInstanceRequestPayloadGetRetentionDaysRetType) {
setCreateInstanceRequestPayloadGetRetentionDaysAttributeType(&o.RetentionDays, v)
}
// GetStorage returns the Storage field value
func (o *CreateInstanceRequestPayload) GetStorage() (ret CreateInstanceRequestPayloadGetStorageRetType) {
ret, _ = o.GetStorageOk()
return ret
}
// GetStorageOk returns a tuple with the Storage field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetStorageOk() (ret CreateInstanceRequestPayloadGetStorageRetType, ok bool) {
return getCreateInstanceRequestPayloadGetStorageAttributeTypeOk(o.Storage)
}
// SetStorage sets field value
func (o *CreateInstanceRequestPayload) SetStorage(v CreateInstanceRequestPayloadGetStorageRetType) {
setCreateInstanceRequestPayloadGetStorageAttributeType(&o.Storage, v)
}
// GetVersion returns the Version field value
func (o *CreateInstanceRequestPayload) GetVersion() (ret CreateInstanceRequestPayloadGetVersionRetType) {
ret, _ = o.GetVersionOk()
return ret
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *CreateInstanceRequestPayload) GetVersionOk() (ret CreateInstanceRequestPayloadGetVersionRetType, ok bool) {
return getCreateInstanceRequestPayloadGetVersionAttributeTypeOk(o.Version)
}
// SetVersion sets field value
func (o *CreateInstanceRequestPayload) SetVersion(v CreateInstanceRequestPayloadGetVersionRetType) {
setCreateInstanceRequestPayloadGetVersionAttributeType(&o.Version, v)
}
func (o CreateInstanceRequestPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateInstanceRequestPayloadGetAclAttributeTypeOk(o.Acl); ok {
toSerialize["Acl"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok {
toSerialize["BackupSchedule"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetEncryptionAttributeTypeOk(o.Encryption); ok {
toSerialize["Encryption"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok {
toSerialize["FlavorId"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetNetworkAttributeTypeOk(o.Network); ok {
toSerialize["Network"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok {
toSerialize["RetentionDays"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetStorageAttributeTypeOk(o.Storage); ok {
toSerialize["Storage"] = val
}
if val, ok := getCreateInstanceRequestPayloadGetVersionAttributeTypeOk(o.Version); ok {
toSerialize["Version"] = val
}
return toSerialize, nil
}
type NullableCreateInstanceRequestPayload struct {
value *CreateInstanceRequestPayload
isSet bool
}
func (v NullableCreateInstanceRequestPayload) Get() *CreateInstanceRequestPayload {
return v.value
}
func (v *NullableCreateInstanceRequestPayload) Set(val *CreateInstanceRequestPayload) {
v.value = val
v.isSet = true
}
func (v NullableCreateInstanceRequestPayload) IsSet() bool {
return v.isSet
}
func (v *NullableCreateInstanceRequestPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateInstanceRequestPayload(val *CreateInstanceRequestPayload) *NullableCreateInstanceRequestPayload {
return &NullableCreateInstanceRequestPayload{value: val, isSet: true}
}
func (v NullableCreateInstanceRequestPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateInstanceRequestPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}