mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
182 lines
3.7 KiB
Go
182 lines
3.7 KiB
Go
/*
|
|
Membership API
|
|
|
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
|
|
API version: 0.1.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package membershipclient
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the User type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &User{}
|
|
|
|
// User struct for User
|
|
type User struct {
|
|
Email string `json:"email"`
|
|
// User ID
|
|
Id string `json:"id"`
|
|
Role *SystemRole `json:"role,omitempty"`
|
|
}
|
|
|
|
// NewUser instantiates a new User 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 NewUser(email string, id string) *User {
|
|
this := User{}
|
|
this.Email = email
|
|
this.Id = id
|
|
return &this
|
|
}
|
|
|
|
// NewUserWithDefaults instantiates a new User 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 NewUserWithDefaults() *User {
|
|
this := User{}
|
|
return &this
|
|
}
|
|
|
|
// GetEmail returns the Email field value
|
|
func (o *User) GetEmail() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Email
|
|
}
|
|
|
|
// GetEmailOk returns a tuple with the Email field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *User) GetEmailOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Email, true
|
|
}
|
|
|
|
// SetEmail sets field value
|
|
func (o *User) SetEmail(v string) {
|
|
o.Email = v
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *User) 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 *User) GetIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *User) SetId(v string) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetRole returns the Role field value if set, zero value otherwise.
|
|
func (o *User) GetRole() SystemRole {
|
|
if o == nil || IsNil(o.Role) {
|
|
var ret SystemRole
|
|
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 *User) GetRoleOk() (*SystemRole, 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 *User) HasRole() bool {
|
|
if o != nil && !IsNil(o.Role) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRole gets a reference to the given SystemRole and assigns it to the Role field.
|
|
func (o *User) SetRole(v SystemRole) {
|
|
o.Role = &v
|
|
}
|
|
|
|
func (o User) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o User) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["email"] = o.Email
|
|
toSerialize["id"] = o.Id
|
|
if !IsNil(o.Role) {
|
|
toSerialize["role"] = o.Role
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableUser struct {
|
|
value *User
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUser) Get() *User {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUser) Set(val *User) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUser) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUser) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUser(val *User) *NullableUser {
|
|
return &NullableUser{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUser) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUser) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|