* 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>
270 lines
10 KiB
Go
270 lines
10 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 CreateDatabaseRequestPayload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CreateDatabaseRequestPayload{}
|
|
|
|
/*
|
|
types and functions for collation
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateDatabaseRequestPayloadGetCollationAttributeType = *string
|
|
|
|
func getCreateDatabaseRequestPayloadGetCollationAttributeTypeOk(arg CreateDatabaseRequestPayloadGetCollationAttributeType) (ret CreateDatabaseRequestPayloadGetCollationRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateDatabaseRequestPayloadGetCollationAttributeType(arg *CreateDatabaseRequestPayloadGetCollationAttributeType, val CreateDatabaseRequestPayloadGetCollationRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateDatabaseRequestPayloadGetCollationArgType = string
|
|
type CreateDatabaseRequestPayloadGetCollationRetType = string
|
|
|
|
/*
|
|
types and functions for compatibility
|
|
*/
|
|
|
|
// isInteger
|
|
type CreateDatabaseRequestPayloadGetCompatibilityAttributeType = *int64
|
|
type CreateDatabaseRequestPayloadGetCompatibilityArgType = int64
|
|
type CreateDatabaseRequestPayloadGetCompatibilityRetType = int64
|
|
|
|
func getCreateDatabaseRequestPayloadGetCompatibilityAttributeTypeOk(arg CreateDatabaseRequestPayloadGetCompatibilityAttributeType) (ret CreateDatabaseRequestPayloadGetCompatibilityRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateDatabaseRequestPayloadGetCompatibilityAttributeType(arg *CreateDatabaseRequestPayloadGetCompatibilityAttributeType, val CreateDatabaseRequestPayloadGetCompatibilityRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateDatabaseRequestPayloadGetNameAttributeType = *string
|
|
|
|
func getCreateDatabaseRequestPayloadGetNameAttributeTypeOk(arg CreateDatabaseRequestPayloadGetNameAttributeType) (ret CreateDatabaseRequestPayloadGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateDatabaseRequestPayloadGetNameAttributeType(arg *CreateDatabaseRequestPayloadGetNameAttributeType, val CreateDatabaseRequestPayloadGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateDatabaseRequestPayloadGetNameArgType = string
|
|
type CreateDatabaseRequestPayloadGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for owner
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateDatabaseRequestPayloadGetOwnerAttributeType = *string
|
|
|
|
func getCreateDatabaseRequestPayloadGetOwnerAttributeTypeOk(arg CreateDatabaseRequestPayloadGetOwnerAttributeType) (ret CreateDatabaseRequestPayloadGetOwnerRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateDatabaseRequestPayloadGetOwnerAttributeType(arg *CreateDatabaseRequestPayloadGetOwnerAttributeType, val CreateDatabaseRequestPayloadGetOwnerRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateDatabaseRequestPayloadGetOwnerArgType = string
|
|
type CreateDatabaseRequestPayloadGetOwnerRetType = string
|
|
|
|
// CreateDatabaseRequestPayload struct for CreateDatabaseRequestPayload
|
|
type CreateDatabaseRequestPayload struct {
|
|
// The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint.
|
|
Collation CreateDatabaseRequestPayloadGetCollationAttributeType `json:"collation,omitempty"`
|
|
// CompatibilityLevel of the Database.
|
|
// Can be cast to int32 without loss of precision.
|
|
Compatibility CreateDatabaseRequestPayloadGetCompatibilityAttributeType `json:"compatibility,omitempty"`
|
|
// The name of the database.
|
|
// REQUIRED
|
|
Name CreateDatabaseRequestPayloadGetNameAttributeType `json:"name" required:"true"`
|
|
// The owner of the database.
|
|
// REQUIRED
|
|
Owner CreateDatabaseRequestPayloadGetOwnerAttributeType `json:"owner" required:"true"`
|
|
}
|
|
|
|
type _CreateDatabaseRequestPayload CreateDatabaseRequestPayload
|
|
|
|
// NewCreateDatabaseRequestPayload instantiates a new CreateDatabaseRequestPayload 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 NewCreateDatabaseRequestPayload(name CreateDatabaseRequestPayloadGetNameArgType, owner CreateDatabaseRequestPayloadGetOwnerArgType) *CreateDatabaseRequestPayload {
|
|
this := CreateDatabaseRequestPayload{}
|
|
setCreateDatabaseRequestPayloadGetNameAttributeType(&this.Name, name)
|
|
setCreateDatabaseRequestPayloadGetOwnerAttributeType(&this.Owner, owner)
|
|
return &this
|
|
}
|
|
|
|
// NewCreateDatabaseRequestPayloadWithDefaults instantiates a new CreateDatabaseRequestPayload 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 NewCreateDatabaseRequestPayloadWithDefaults() *CreateDatabaseRequestPayload {
|
|
this := CreateDatabaseRequestPayload{}
|
|
return &this
|
|
}
|
|
|
|
// GetCollation returns the Collation field value if set, zero value otherwise.
|
|
func (o *CreateDatabaseRequestPayload) GetCollation() (res CreateDatabaseRequestPayloadGetCollationRetType) {
|
|
res, _ = o.GetCollationOk()
|
|
return
|
|
}
|
|
|
|
// GetCollationOk returns a tuple with the Collation field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateDatabaseRequestPayload) GetCollationOk() (ret CreateDatabaseRequestPayloadGetCollationRetType, ok bool) {
|
|
return getCreateDatabaseRequestPayloadGetCollationAttributeTypeOk(o.Collation)
|
|
}
|
|
|
|
// HasCollation returns a boolean if a field has been set.
|
|
func (o *CreateDatabaseRequestPayload) HasCollation() bool {
|
|
_, ok := o.GetCollationOk()
|
|
return ok
|
|
}
|
|
|
|
// SetCollation gets a reference to the given string and assigns it to the Collation field.
|
|
func (o *CreateDatabaseRequestPayload) SetCollation(v CreateDatabaseRequestPayloadGetCollationRetType) {
|
|
setCreateDatabaseRequestPayloadGetCollationAttributeType(&o.Collation, v)
|
|
}
|
|
|
|
// GetCompatibility returns the Compatibility field value if set, zero value otherwise.
|
|
func (o *CreateDatabaseRequestPayload) GetCompatibility() (res CreateDatabaseRequestPayloadGetCompatibilityRetType) {
|
|
res, _ = o.GetCompatibilityOk()
|
|
return
|
|
}
|
|
|
|
// GetCompatibilityOk returns a tuple with the Compatibility field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateDatabaseRequestPayload) GetCompatibilityOk() (ret CreateDatabaseRequestPayloadGetCompatibilityRetType, ok bool) {
|
|
return getCreateDatabaseRequestPayloadGetCompatibilityAttributeTypeOk(o.Compatibility)
|
|
}
|
|
|
|
// HasCompatibility returns a boolean if a field has been set.
|
|
func (o *CreateDatabaseRequestPayload) HasCompatibility() bool {
|
|
_, ok := o.GetCompatibilityOk()
|
|
return ok
|
|
}
|
|
|
|
// SetCompatibility gets a reference to the given int64 and assigns it to the Compatibility field.
|
|
func (o *CreateDatabaseRequestPayload) SetCompatibility(v CreateDatabaseRequestPayloadGetCompatibilityRetType) {
|
|
setCreateDatabaseRequestPayloadGetCompatibilityAttributeType(&o.Compatibility, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *CreateDatabaseRequestPayload) GetName() (ret CreateDatabaseRequestPayloadGetNameRetType) {
|
|
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 *CreateDatabaseRequestPayload) GetNameOk() (ret CreateDatabaseRequestPayloadGetNameRetType, ok bool) {
|
|
return getCreateDatabaseRequestPayloadGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *CreateDatabaseRequestPayload) SetName(v CreateDatabaseRequestPayloadGetNameRetType) {
|
|
setCreateDatabaseRequestPayloadGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetOwner returns the Owner field value
|
|
func (o *CreateDatabaseRequestPayload) GetOwner() (ret CreateDatabaseRequestPayloadGetOwnerRetType) {
|
|
ret, _ = o.GetOwnerOk()
|
|
return ret
|
|
}
|
|
|
|
// GetOwnerOk returns a tuple with the Owner field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateDatabaseRequestPayload) GetOwnerOk() (ret CreateDatabaseRequestPayloadGetOwnerRetType, ok bool) {
|
|
return getCreateDatabaseRequestPayloadGetOwnerAttributeTypeOk(o.Owner)
|
|
}
|
|
|
|
// SetOwner sets field value
|
|
func (o *CreateDatabaseRequestPayload) SetOwner(v CreateDatabaseRequestPayloadGetOwnerRetType) {
|
|
setCreateDatabaseRequestPayloadGetOwnerAttributeType(&o.Owner, v)
|
|
}
|
|
|
|
func (o CreateDatabaseRequestPayload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getCreateDatabaseRequestPayloadGetCollationAttributeTypeOk(o.Collation); ok {
|
|
toSerialize["Collation"] = val
|
|
}
|
|
if val, ok := getCreateDatabaseRequestPayloadGetCompatibilityAttributeTypeOk(o.Compatibility); ok {
|
|
toSerialize["Compatibility"] = val
|
|
}
|
|
if val, ok := getCreateDatabaseRequestPayloadGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getCreateDatabaseRequestPayloadGetOwnerAttributeTypeOk(o.Owner); ok {
|
|
toSerialize["Owner"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableCreateDatabaseRequestPayload struct {
|
|
value *CreateDatabaseRequestPayload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCreateDatabaseRequestPayload) Get() *CreateDatabaseRequestPayload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCreateDatabaseRequestPayload) Set(val *CreateDatabaseRequestPayload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCreateDatabaseRequestPayload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCreateDatabaseRequestPayload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCreateDatabaseRequestPayload(val *CreateDatabaseRequestPayload) *NullableCreateDatabaseRequestPayload {
|
|
return &NullableCreateDatabaseRequestPayload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCreateDatabaseRequestPayload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCreateDatabaseRequestPayload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|