terraform-provider-stackitp.../pkg/sqlserverflexalpha/model_update_instance_partially_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

464 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 UpdateInstancePartiallyRequestPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateInstancePartiallyRequestPayload{}
/*
types and functions for acl
*/
// isArray
type UpdateInstancePartiallyRequestPayloadGetAclAttributeType = *[]string
type UpdateInstancePartiallyRequestPayloadGetAclArgType = []string
type UpdateInstancePartiallyRequestPayloadGetAclRetType = []string
func getUpdateInstancePartiallyRequestPayloadGetAclAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetAclAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetAclRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetAclAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetAclAttributeType, val UpdateInstancePartiallyRequestPayloadGetAclRetType) {
*arg = &val
}
/*
types and functions for backupSchedule
*/
// isNotNullableString
type UpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType = *string
func getUpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType, val UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType) {
*arg = &val
}
type UpdateInstancePartiallyRequestPayloadGetBackupScheduleArgType = string
type UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType = string
/*
types and functions for flavorId
*/
// isNotNullableString
type UpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType = *string
func getUpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType, val UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType) {
*arg = &val
}
type UpdateInstancePartiallyRequestPayloadGetFlavorIdArgType = string
type UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType = string
/*
types and functions for name
*/
// isNotNullableString
type UpdateInstancePartiallyRequestPayloadGetNameAttributeType = *string
func getUpdateInstancePartiallyRequestPayloadGetNameAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetNameAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetNameAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetNameAttributeType, val UpdateInstancePartiallyRequestPayloadGetNameRetType) {
*arg = &val
}
type UpdateInstancePartiallyRequestPayloadGetNameArgType = string
type UpdateInstancePartiallyRequestPayloadGetNameRetType = string
/*
types and functions for replicas
*/
// isEnumRef
type UpdateInstancePartiallyRequestPayloadGetReplicasAttributeType = *ReplicasOpt
type UpdateInstancePartiallyRequestPayloadGetReplicasArgType = ReplicasOpt
type UpdateInstancePartiallyRequestPayloadGetReplicasRetType = ReplicasOpt
func getUpdateInstancePartiallyRequestPayloadGetReplicasAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetReplicasAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetReplicasRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetReplicasAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetReplicasAttributeType, val UpdateInstancePartiallyRequestPayloadGetReplicasRetType) {
*arg = &val
}
/*
types and functions for retentionDays
*/
// isInteger
type UpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType = *int64
type UpdateInstancePartiallyRequestPayloadGetRetentionDaysArgType = int64
type UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType = int64
func getUpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType, val UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType) {
*arg = &val
}
/*
types and functions for storage
*/
// isModel
type UpdateInstancePartiallyRequestPayloadGetStorageAttributeType = *StorageUpdate
type UpdateInstancePartiallyRequestPayloadGetStorageArgType = StorageUpdate
type UpdateInstancePartiallyRequestPayloadGetStorageRetType = StorageUpdate
func getUpdateInstancePartiallyRequestPayloadGetStorageAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetStorageAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetStorageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetStorageAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetStorageAttributeType, val UpdateInstancePartiallyRequestPayloadGetStorageRetType) {
*arg = &val
}
/*
types and functions for version
*/
// isEnumRef
type UpdateInstancePartiallyRequestPayloadGetVersionAttributeType = *InstanceVersionOpt
type UpdateInstancePartiallyRequestPayloadGetVersionArgType = InstanceVersionOpt
type UpdateInstancePartiallyRequestPayloadGetVersionRetType = InstanceVersionOpt
func getUpdateInstancePartiallyRequestPayloadGetVersionAttributeTypeOk(arg UpdateInstancePartiallyRequestPayloadGetVersionAttributeType) (ret UpdateInstancePartiallyRequestPayloadGetVersionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateInstancePartiallyRequestPayloadGetVersionAttributeType(arg *UpdateInstancePartiallyRequestPayloadGetVersionAttributeType, val UpdateInstancePartiallyRequestPayloadGetVersionRetType) {
*arg = &val
}
// UpdateInstancePartiallyRequestPayload struct for UpdateInstancePartiallyRequestPayload
type UpdateInstancePartiallyRequestPayload struct {
// List of IPV4 cidr.
Acl UpdateInstancePartiallyRequestPayloadGetAclAttributeType `json:"acl,omitempty"`
// The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
BackupSchedule UpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"`
// The id of the instance flavor.
FlavorId UpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType `json:"flavorId,omitempty"`
// The name of the instance.
Name UpdateInstancePartiallyRequestPayloadGetNameAttributeType `json:"name,omitempty"`
Replicas UpdateInstancePartiallyRequestPayloadGetReplicasAttributeType `json:"replicas,omitempty"`
// Can be cast to int32 without loss of precision.
RetentionDays UpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType `json:"retentionDays,omitempty"`
Storage UpdateInstancePartiallyRequestPayloadGetStorageAttributeType `json:"storage,omitempty"`
Version UpdateInstancePartiallyRequestPayloadGetVersionAttributeType `json:"version,omitempty"`
}
// NewUpdateInstancePartiallyRequestPayload instantiates a new UpdateInstancePartiallyRequestPayload 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 NewUpdateInstancePartiallyRequestPayload() *UpdateInstancePartiallyRequestPayload {
this := UpdateInstancePartiallyRequestPayload{}
return &this
}
// NewUpdateInstancePartiallyRequestPayloadWithDefaults instantiates a new UpdateInstancePartiallyRequestPayload 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 NewUpdateInstancePartiallyRequestPayloadWithDefaults() *UpdateInstancePartiallyRequestPayload {
this := UpdateInstancePartiallyRequestPayload{}
return &this
}
// GetAcl returns the Acl field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetAcl() (res UpdateInstancePartiallyRequestPayloadGetAclRetType) {
res, _ = o.GetAclOk()
return
}
// GetAclOk returns a tuple with the Acl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetAclOk() (ret UpdateInstancePartiallyRequestPayloadGetAclRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetAclAttributeTypeOk(o.Acl)
}
// HasAcl returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasAcl() bool {
_, ok := o.GetAclOk()
return ok
}
// SetAcl gets a reference to the given []string and assigns it to the Acl field.
func (o *UpdateInstancePartiallyRequestPayload) SetAcl(v UpdateInstancePartiallyRequestPayloadGetAclRetType) {
setUpdateInstancePartiallyRequestPayloadGetAclAttributeType(&o.Acl, v)
}
// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetBackupSchedule() (res UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType) {
res, _ = o.GetBackupScheduleOk()
return
}
// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetBackupScheduleOk() (ret UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule)
}
// HasBackupSchedule returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasBackupSchedule() bool {
_, ok := o.GetBackupScheduleOk()
return ok
}
// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field.
func (o *UpdateInstancePartiallyRequestPayload) SetBackupSchedule(v UpdateInstancePartiallyRequestPayloadGetBackupScheduleRetType) {
setUpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v)
}
// GetFlavorId returns the FlavorId field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetFlavorId() (res UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType) {
res, _ = o.GetFlavorIdOk()
return
}
// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetFlavorIdOk() (ret UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId)
}
// HasFlavorId returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasFlavorId() bool {
_, ok := o.GetFlavorIdOk()
return ok
}
// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field.
func (o *UpdateInstancePartiallyRequestPayload) SetFlavorId(v UpdateInstancePartiallyRequestPayloadGetFlavorIdRetType) {
setUpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeType(&o.FlavorId, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetName() (res UpdateInstancePartiallyRequestPayloadGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetNameOk() (ret UpdateInstancePartiallyRequestPayloadGetNameRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *UpdateInstancePartiallyRequestPayload) SetName(v UpdateInstancePartiallyRequestPayloadGetNameRetType) {
setUpdateInstancePartiallyRequestPayloadGetNameAttributeType(&o.Name, v)
}
// GetReplicas returns the Replicas field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetReplicas() (res UpdateInstancePartiallyRequestPayloadGetReplicasRetType) {
res, _ = o.GetReplicasOk()
return
}
// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetReplicasOk() (ret UpdateInstancePartiallyRequestPayloadGetReplicasRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetReplicasAttributeTypeOk(o.Replicas)
}
// HasReplicas returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasReplicas() bool {
_, ok := o.GetReplicasOk()
return ok
}
// SetReplicas gets a reference to the given ReplicasOpt and assigns it to the Replicas field.
func (o *UpdateInstancePartiallyRequestPayload) SetReplicas(v UpdateInstancePartiallyRequestPayloadGetReplicasRetType) {
setUpdateInstancePartiallyRequestPayloadGetReplicasAttributeType(&o.Replicas, v)
}
// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetRetentionDays() (res UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType) {
res, _ = o.GetRetentionDaysOk()
return
}
// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetRetentionDaysOk() (ret UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays)
}
// HasRetentionDays returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasRetentionDays() bool {
_, ok := o.GetRetentionDaysOk()
return ok
}
// SetRetentionDays gets a reference to the given int64 and assigns it to the RetentionDays field.
func (o *UpdateInstancePartiallyRequestPayload) SetRetentionDays(v UpdateInstancePartiallyRequestPayloadGetRetentionDaysRetType) {
setUpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeType(&o.RetentionDays, v)
}
// GetStorage returns the Storage field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetStorage() (res UpdateInstancePartiallyRequestPayloadGetStorageRetType) {
res, _ = o.GetStorageOk()
return
}
// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetStorageOk() (ret UpdateInstancePartiallyRequestPayloadGetStorageRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetStorageAttributeTypeOk(o.Storage)
}
// HasStorage returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasStorage() bool {
_, ok := o.GetStorageOk()
return ok
}
// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field.
func (o *UpdateInstancePartiallyRequestPayload) SetStorage(v UpdateInstancePartiallyRequestPayloadGetStorageRetType) {
setUpdateInstancePartiallyRequestPayloadGetStorageAttributeType(&o.Storage, v)
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *UpdateInstancePartiallyRequestPayload) GetVersion() (res UpdateInstancePartiallyRequestPayloadGetVersionRetType) {
res, _ = o.GetVersionOk()
return
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateInstancePartiallyRequestPayload) GetVersionOk() (ret UpdateInstancePartiallyRequestPayloadGetVersionRetType, ok bool) {
return getUpdateInstancePartiallyRequestPayloadGetVersionAttributeTypeOk(o.Version)
}
// HasVersion returns a boolean if a field has been set.
func (o *UpdateInstancePartiallyRequestPayload) HasVersion() bool {
_, ok := o.GetVersionOk()
return ok
}
// SetVersion gets a reference to the given InstanceVersionOpt and assigns it to the Version field.
func (o *UpdateInstancePartiallyRequestPayload) SetVersion(v UpdateInstancePartiallyRequestPayloadGetVersionRetType) {
setUpdateInstancePartiallyRequestPayloadGetVersionAttributeType(&o.Version, v)
}
func (o UpdateInstancePartiallyRequestPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetAclAttributeTypeOk(o.Acl); ok {
toSerialize["Acl"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok {
toSerialize["BackupSchedule"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok {
toSerialize["FlavorId"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetReplicasAttributeTypeOk(o.Replicas); ok {
toSerialize["Replicas"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok {
toSerialize["RetentionDays"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetStorageAttributeTypeOk(o.Storage); ok {
toSerialize["Storage"] = val
}
if val, ok := getUpdateInstancePartiallyRequestPayloadGetVersionAttributeTypeOk(o.Version); ok {
toSerialize["Version"] = val
}
return toSerialize, nil
}
type NullableUpdateInstancePartiallyRequestPayload struct {
value *UpdateInstancePartiallyRequestPayload
isSet bool
}
func (v NullableUpdateInstancePartiallyRequestPayload) Get() *UpdateInstancePartiallyRequestPayload {
return v.value
}
func (v *NullableUpdateInstancePartiallyRequestPayload) Set(val *UpdateInstancePartiallyRequestPayload) {
v.value = val
v.isSet = true
}
func (v NullableUpdateInstancePartiallyRequestPayload) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateInstancePartiallyRequestPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateInstancePartiallyRequestPayload(val *UpdateInstancePartiallyRequestPayload) *NullableUpdateInstancePartiallyRequestPayload {
return &NullableUpdateInstancePartiallyRequestPayload{value: val, isSet: true}
}
func (v NullableUpdateInstancePartiallyRequestPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateInstancePartiallyRequestPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}