/* 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 CreateUserRequestPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserRequestPayload{} /* types and functions for default_database */ // isNotNullableString type CreateUserRequestPayloadGetDefaultDatabaseAttributeType = *string func getCreateUserRequestPayloadGetDefaultDatabaseAttributeTypeOk(arg CreateUserRequestPayloadGetDefaultDatabaseAttributeType) (ret CreateUserRequestPayloadGetDefaultDatabaseRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateUserRequestPayloadGetDefaultDatabaseAttributeType(arg *CreateUserRequestPayloadGetDefaultDatabaseAttributeType, val CreateUserRequestPayloadGetDefaultDatabaseRetType) { *arg = &val } type CreateUserRequestPayloadGetDefaultDatabaseArgType = string type CreateUserRequestPayloadGetDefaultDatabaseRetType = string /* types and functions for roles */ // isArray type CreateUserRequestPayloadGetRolesAttributeType = *[]UserRole type CreateUserRequestPayloadGetRolesArgType = []UserRole type CreateUserRequestPayloadGetRolesRetType = []UserRole func getCreateUserRequestPayloadGetRolesAttributeTypeOk(arg CreateUserRequestPayloadGetRolesAttributeType) (ret CreateUserRequestPayloadGetRolesRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateUserRequestPayloadGetRolesAttributeType(arg *CreateUserRequestPayloadGetRolesAttributeType, val CreateUserRequestPayloadGetRolesRetType) { *arg = &val } /* types and functions for username */ // isNotNullableString type CreateUserRequestPayloadGetUsernameAttributeType = *string func getCreateUserRequestPayloadGetUsernameAttributeTypeOk(arg CreateUserRequestPayloadGetUsernameAttributeType) (ret CreateUserRequestPayloadGetUsernameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateUserRequestPayloadGetUsernameAttributeType(arg *CreateUserRequestPayloadGetUsernameAttributeType, val CreateUserRequestPayloadGetUsernameRetType) { *arg = &val } type CreateUserRequestPayloadGetUsernameArgType = string type CreateUserRequestPayloadGetUsernameRetType = string // CreateUserRequestPayload struct for CreateUserRequestPayload type CreateUserRequestPayload struct { // The default database for a user of the instance. DefaultDatabase CreateUserRequestPayloadGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` // A list containing the user roles for the instance. // REQUIRED Roles CreateUserRequestPayloadGetRolesAttributeType `json:"roles" required:"true"` // The name of the user. // REQUIRED Username CreateUserRequestPayloadGetUsernameAttributeType `json:"username" required:"true"` } type _CreateUserRequestPayload CreateUserRequestPayload // NewCreateUserRequestPayload instantiates a new CreateUserRequestPayload 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 NewCreateUserRequestPayload(roles CreateUserRequestPayloadGetRolesArgType, username CreateUserRequestPayloadGetUsernameArgType) *CreateUserRequestPayload { this := CreateUserRequestPayload{} setCreateUserRequestPayloadGetRolesAttributeType(&this.Roles, roles) setCreateUserRequestPayloadGetUsernameAttributeType(&this.Username, username) return &this } // NewCreateUserRequestPayloadWithDefaults instantiates a new CreateUserRequestPayload 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 NewCreateUserRequestPayloadWithDefaults() *CreateUserRequestPayload { this := CreateUserRequestPayload{} return &this } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. func (o *CreateUserRequestPayload) GetDefaultDatabase() (res CreateUserRequestPayloadGetDefaultDatabaseRetType) { res, _ = o.GetDefaultDatabaseOk() return } // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateUserRequestPayload) GetDefaultDatabaseOk() (ret CreateUserRequestPayloadGetDefaultDatabaseRetType, ok bool) { return getCreateUserRequestPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. func (o *CreateUserRequestPayload) HasDefaultDatabase() bool { _, ok := o.GetDefaultDatabaseOk() return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. func (o *CreateUserRequestPayload) SetDefaultDatabase(v CreateUserRequestPayloadGetDefaultDatabaseRetType) { setCreateUserRequestPayloadGetDefaultDatabaseAttributeType(&o.DefaultDatabase, v) } // GetRoles returns the Roles field value func (o *CreateUserRequestPayload) GetRoles() (ret CreateUserRequestPayloadGetRolesRetType) { ret, _ = o.GetRolesOk() return ret } // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. func (o *CreateUserRequestPayload) GetRolesOk() (ret CreateUserRequestPayloadGetRolesRetType, ok bool) { return getCreateUserRequestPayloadGetRolesAttributeTypeOk(o.Roles) } // SetRoles sets field value func (o *CreateUserRequestPayload) SetRoles(v CreateUserRequestPayloadGetRolesRetType) { setCreateUserRequestPayloadGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value func (o *CreateUserRequestPayload) GetUsername() (ret CreateUserRequestPayloadGetUsernameRetType) { ret, _ = o.GetUsernameOk() return ret } // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. func (o *CreateUserRequestPayload) GetUsernameOk() (ret CreateUserRequestPayloadGetUsernameRetType, ok bool) { return getCreateUserRequestPayloadGetUsernameAttributeTypeOk(o.Username) } // SetUsername sets field value func (o *CreateUserRequestPayload) SetUsername(v CreateUserRequestPayloadGetUsernameRetType) { setCreateUserRequestPayloadGetUsernameAttributeType(&o.Username, v) } func (o CreateUserRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateUserRequestPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { toSerialize["DefaultDatabase"] = val } if val, ok := getCreateUserRequestPayloadGetRolesAttributeTypeOk(o.Roles); ok { toSerialize["Roles"] = val } if val, ok := getCreateUserRequestPayloadGetUsernameAttributeTypeOk(o.Username); ok { toSerialize["Username"] = val } return toSerialize, nil } type NullableCreateUserRequestPayload struct { value *CreateUserRequestPayload isSet bool } func (v NullableCreateUserRequestPayload) Get() *CreateUserRequestPayload { return v.value } func (v *NullableCreateUserRequestPayload) Set(val *CreateUserRequestPayload) { v.value = val v.isSet = true } func (v NullableCreateUserRequestPayload) IsSet() bool { return v.isSet } func (v *NullableCreateUserRequestPayload) Unset() { v.value = nil v.isSet = false } func NewNullableCreateUserRequestPayload(val *CreateUserRequestPayload) *NullableCreateUserRequestPayload { return &NullableCreateUserRequestPayload{value: val, isSet: true} } func (v NullableCreateUserRequestPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableCreateUserRequestPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }