Files
apiclient/model_create_user.go
zeekayandHanzo Dev 9cfc3af66d the Go client for Hanzo Runtime
Generated from Runtime's OpenAPI document, and pure standard library — it
requires nothing else, so a caller pays only for this package.

It lives here rather than inside Runtime because a nested module is resolved
by the path it declares, and one declaring a path it does not sit at is
reachable by nobody: no proxy answers for it and no consumer can name it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-14 08:41:09 -07:00

330 lines
8.2 KiB
Go

/*
Runtime
Runtime AI platform API Docs
API version: 1.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package apiclient
import (
"bytes"
"encoding/json"
"fmt"
)
// checks if the CreateUser type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateUser{}
// CreateUser struct for CreateUser
type CreateUser struct {
Id string `json:"id"`
Name string `json:"name"`
Email *string `json:"email,omitempty"`
PersonalOrganizationQuota *CreateOrganizationQuota `json:"personalOrganizationQuota,omitempty"`
Role *string `json:"role,omitempty"`
EmailVerified *bool `json:"emailVerified,omitempty"`
}
type _CreateUser CreateUser
// NewCreateUser instantiates a new CreateUser 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 NewCreateUser(id string, name string) *CreateUser {
this := CreateUser{}
this.Id = id
this.Name = name
return &this
}
// NewCreateUserWithDefaults instantiates a new CreateUser 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 NewCreateUserWithDefaults() *CreateUser {
this := CreateUser{}
return &this
}
// GetId returns the Id field value
func (o *CreateUser) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *CreateUser) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *CreateUser) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value
func (o *CreateUser) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CreateUser) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *CreateUser) SetName(v string) {
o.Name = v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *CreateUser) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateUser) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *CreateUser) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *CreateUser) SetEmail(v string) {
o.Email = &v
}
// GetPersonalOrganizationQuota returns the PersonalOrganizationQuota field value if set, zero value otherwise.
func (o *CreateUser) GetPersonalOrganizationQuota() CreateOrganizationQuota {
if o == nil || IsNil(o.PersonalOrganizationQuota) {
var ret CreateOrganizationQuota
return ret
}
return *o.PersonalOrganizationQuota
}
// GetPersonalOrganizationQuotaOk returns a tuple with the PersonalOrganizationQuota field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateUser) GetPersonalOrganizationQuotaOk() (*CreateOrganizationQuota, bool) {
if o == nil || IsNil(o.PersonalOrganizationQuota) {
return nil, false
}
return o.PersonalOrganizationQuota, true
}
// HasPersonalOrganizationQuota returns a boolean if a field has been set.
func (o *CreateUser) HasPersonalOrganizationQuota() bool {
if o != nil && !IsNil(o.PersonalOrganizationQuota) {
return true
}
return false
}
// SetPersonalOrganizationQuota gets a reference to the given CreateOrganizationQuota and assigns it to the PersonalOrganizationQuota field.
func (o *CreateUser) SetPersonalOrganizationQuota(v CreateOrganizationQuota) {
o.PersonalOrganizationQuota = &v
}
// GetRole returns the Role field value if set, zero value otherwise.
func (o *CreateUser) GetRole() string {
if o == nil || IsNil(o.Role) {
var ret string
return ret
}
return *o.Role
}
// GetRoleOk returns a tuple with the Role field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateUser) GetRoleOk() (*string, bool) {
if o == nil || IsNil(o.Role) {
return nil, false
}
return o.Role, true
}
// HasRole returns a boolean if a field has been set.
func (o *CreateUser) HasRole() bool {
if o != nil && !IsNil(o.Role) {
return true
}
return false
}
// SetRole gets a reference to the given string and assigns it to the Role field.
func (o *CreateUser) SetRole(v string) {
o.Role = &v
}
// GetEmailVerified returns the EmailVerified field value if set, zero value otherwise.
func (o *CreateUser) GetEmailVerified() bool {
if o == nil || IsNil(o.EmailVerified) {
var ret bool
return ret
}
return *o.EmailVerified
}
// GetEmailVerifiedOk returns a tuple with the EmailVerified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateUser) GetEmailVerifiedOk() (*bool, bool) {
if o == nil || IsNil(o.EmailVerified) {
return nil, false
}
return o.EmailVerified, true
}
// HasEmailVerified returns a boolean if a field has been set.
func (o *CreateUser) HasEmailVerified() bool {
if o != nil && !IsNil(o.EmailVerified) {
return true
}
return false
}
// SetEmailVerified gets a reference to the given bool and assigns it to the EmailVerified field.
func (o *CreateUser) SetEmailVerified(v bool) {
o.EmailVerified = &v
}
func (o CreateUser) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateUser) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["name"] = o.Name
if !IsNil(o.Email) {
toSerialize["email"] = o.Email
}
if !IsNil(o.PersonalOrganizationQuota) {
toSerialize["personalOrganizationQuota"] = o.PersonalOrganizationQuota
}
if !IsNil(o.Role) {
toSerialize["role"] = o.Role
}
if !IsNil(o.EmailVerified) {
toSerialize["emailVerified"] = o.EmailVerified
}
return toSerialize, nil
}
func (o *CreateUser) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"name",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateUser := _CreateUser{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateUser)
if err != nil {
return err
}
*o = CreateUser(varCreateUser)
return err
}
type NullableCreateUser struct {
value *CreateUser
isSet bool
}
func (v NullableCreateUser) Get() *CreateUser {
return v.value
}
func (v *NullableCreateUser) Set(val *CreateUser) {
v.value = val
v.isSet = true
}
func (v NullableCreateUser) IsSet() bool {
return v.isSet
}
func (v *NullableCreateUser) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateUser(val *CreateUser) *NullableCreateUser {
return &NullableCreateUser{value: val, isSet: true}
}
func (v NullableCreateUser) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateUser) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}