/* PostgreSQL Flex API This is the documentation for the STACKIT Postgres Flex service API version: 3alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package postgresflexalpha import ( "encoding/json" ) // checks if the CreateUserRequestPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserRequestPayload{} /* types and functions for name */ // isNotNullableString type CreateUserRequestPayloadGetNameAttributeType = *string func getCreateUserRequestPayloadGetNameAttributeTypeOk(arg CreateUserRequestPayloadGetNameAttributeType) (ret CreateUserRequestPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateUserRequestPayloadGetNameAttributeType(arg *CreateUserRequestPayloadGetNameAttributeType, val CreateUserRequestPayloadGetNameRetType) { *arg = &val } type CreateUserRequestPayloadGetNameArgType = string type CreateUserRequestPayloadGetNameRetType = 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 } // CreateUserRequestPayload struct for CreateUserRequestPayload type CreateUserRequestPayload struct { // The name of the user. // REQUIRED Name CreateUserRequestPayloadGetNameAttributeType `json:"name" required:"true"` // A list containing the user roles for the instance. Roles CreateUserRequestPayloadGetRolesAttributeType `json:"roles,omitempty"` } 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(name CreateUserRequestPayloadGetNameArgType) *CreateUserRequestPayload { this := CreateUserRequestPayload{} setCreateUserRequestPayloadGetNameAttributeType(&this.Name, name) 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 } // GetName returns the Name field value func (o *CreateUserRequestPayload) GetName() (ret CreateUserRequestPayloadGetNameRetType) { 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 *CreateUserRequestPayload) GetNameOk() (ret CreateUserRequestPayloadGetNameRetType, ok bool) { return getCreateUserRequestPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value func (o *CreateUserRequestPayload) SetName(v CreateUserRequestPayloadGetNameRetType) { setCreateUserRequestPayloadGetNameAttributeType(&o.Name, v) } // GetRoles returns the Roles field value if set, zero value otherwise. func (o *CreateUserRequestPayload) GetRoles() (res CreateUserRequestPayloadGetRolesRetType) { res, _ = o.GetRolesOk() return } // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateUserRequestPayload) GetRolesOk() (ret CreateUserRequestPayloadGetRolesRetType, ok bool) { return getCreateUserRequestPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *CreateUserRequestPayload) HasRoles() bool { _, ok := o.GetRolesOk() return ok } // SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. func (o *CreateUserRequestPayload) SetRoles(v CreateUserRequestPayloadGetRolesRetType) { setCreateUserRequestPayloadGetRolesAttributeType(&o.Roles, v) } func (o CreateUserRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateUserRequestPayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } if val, ok := getCreateUserRequestPayloadGetRolesAttributeTypeOk(o.Roles); ok { toSerialize["Roles"] = 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) }