Files
sdk/model_iam_role.go

637 lines
16 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
"time"
)
// checks if the IamRole type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamRole{}
// IamRole struct for IamRole
type IamRole struct {
CreatedAt *time.Time `json:"createdAt,omitempty"`
CreatedTime *string `json:"createdTime,omitempty"`
Deleted *bool `json:"deleted,omitempty"`
Description *string `json:"description,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Domains []string `json:"domains,omitempty"`
// Persisted fields
Id *string `json:"id,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
Roles []string `json:"roles,omitempty"`
Teams []string `json:"teams,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
Users []string `json:"users,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamRole IamRole
// NewIamRole instantiates a new IamRole 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 NewIamRole() *IamRole {
this := IamRole{}
return &this
}
// NewIamRoleWithDefaults instantiates a new IamRole 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 NewIamRoleWithDefaults() *IamRole {
this := IamRole{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *IamRole) GetCreatedAt() time.Time {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *IamRole) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *IamRole) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *IamRole) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *IamRole) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *IamRole) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *IamRole) GetDeleted() bool {
if o == nil || IsNil(o.Deleted) {
var ret bool
return ret
}
return *o.Deleted
}
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetDeletedOk() (*bool, bool) {
if o == nil || IsNil(o.Deleted) {
return nil, false
}
return o.Deleted, true
}
// HasDeleted returns a boolean if a field has been set.
func (o *IamRole) HasDeleted() bool {
if o != nil && !IsNil(o.Deleted) {
return true
}
return false
}
// SetDeleted gets a reference to the given bool and assigns it to the Deleted field.
func (o *IamRole) SetDeleted(v bool) {
o.Deleted = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *IamRole) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *IamRole) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *IamRole) SetDescription(v string) {
o.Description = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *IamRole) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *IamRole) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *IamRole) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetDomains returns the Domains field value if set, zero value otherwise.
func (o *IamRole) GetDomains() []string {
if o == nil || IsNil(o.Domains) {
var ret []string
return ret
}
return o.Domains
}
// GetDomainsOk returns a tuple with the Domains field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetDomainsOk() ([]string, bool) {
if o == nil || IsNil(o.Domains) {
return nil, false
}
return o.Domains, true
}
// HasDomains returns a boolean if a field has been set.
func (o *IamRole) HasDomains() bool {
if o != nil && !IsNil(o.Domains) {
return true
}
return false
}
// SetDomains gets a reference to the given []string and assigns it to the Domains field.
func (o *IamRole) SetDomains(v []string) {
o.Domains = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *IamRole) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *IamRole) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *IamRole) SetId(v string) {
o.Id = &v
}
// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise.
func (o *IamRole) GetIsEnabled() bool {
if o == nil || IsNil(o.IsEnabled) {
var ret bool
return ret
}
return *o.IsEnabled
}
// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetIsEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.IsEnabled) {
return nil, false
}
return o.IsEnabled, true
}
// HasIsEnabled returns a boolean if a field has been set.
func (o *IamRole) HasIsEnabled() bool {
if o != nil && !IsNil(o.IsEnabled) {
return true
}
return false
}
// SetIsEnabled gets a reference to the given bool and assigns it to the IsEnabled field.
func (o *IamRole) SetIsEnabled(v bool) {
o.IsEnabled = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *IamRole) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *IamRole) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *IamRole) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *IamRole) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *IamRole) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *IamRole) SetOwner(v string) {
o.Owner = &v
}
// GetRoles returns the Roles field value if set, zero value otherwise.
func (o *IamRole) GetRoles() []string {
if o == nil || IsNil(o.Roles) {
var ret []string
return ret
}
return o.Roles
}
// 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 *IamRole) GetRolesOk() ([]string, bool) {
if o == nil || IsNil(o.Roles) {
return nil, false
}
return o.Roles, true
}
// HasRoles returns a boolean if a field has been set.
func (o *IamRole) HasRoles() bool {
if o != nil && !IsNil(o.Roles) {
return true
}
return false
}
// SetRoles gets a reference to the given []string and assigns it to the Roles field.
func (o *IamRole) SetRoles(v []string) {
o.Roles = v
}
// GetTeams returns the Teams field value if set, zero value otherwise.
func (o *IamRole) GetTeams() []string {
if o == nil || IsNil(o.Teams) {
var ret []string
return ret
}
return o.Teams
}
// GetTeamsOk returns a tuple with the Teams field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetTeamsOk() ([]string, bool) {
if o == nil || IsNil(o.Teams) {
return nil, false
}
return o.Teams, true
}
// HasTeams returns a boolean if a field has been set.
func (o *IamRole) HasTeams() bool {
if o != nil && !IsNil(o.Teams) {
return true
}
return false
}
// SetTeams gets a reference to the given []string and assigns it to the Teams field.
func (o *IamRole) SetTeams(v []string) {
o.Teams = v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *IamRole) GetUpdatedAt() time.Time {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *IamRole) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *IamRole) SetUpdatedAt(v time.Time) {
o.UpdatedAt = &v
}
// GetUsers returns the Users field value if set, zero value otherwise.
func (o *IamRole) GetUsers() []string {
if o == nil || IsNil(o.Users) {
var ret []string
return ret
}
return o.Users
}
// GetUsersOk returns a tuple with the Users field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamRole) GetUsersOk() ([]string, bool) {
if o == nil || IsNil(o.Users) {
return nil, false
}
return o.Users, true
}
// HasUsers returns a boolean if a field has been set.
func (o *IamRole) HasUsers() bool {
if o != nil && !IsNil(o.Users) {
return true
}
return false
}
// SetUsers gets a reference to the given []string and assigns it to the Users field.
func (o *IamRole) SetUsers(v []string) {
o.Users = v
}
func (o IamRole) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamRole) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Deleted) {
toSerialize["deleted"] = o.Deleted
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Domains) {
toSerialize["domains"] = o.Domains
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.IsEnabled) {
toSerialize["isEnabled"] = o.IsEnabled
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Roles) {
toSerialize["roles"] = o.Roles
}
if !IsNil(o.Teams) {
toSerialize["teams"] = o.Teams
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if !IsNil(o.Users) {
toSerialize["users"] = o.Users
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamRole) UnmarshalJSON(data []byte) (err error) {
varIamRole := _IamRole{}
err = json.Unmarshal(data, &varIamRole)
if err != nil {
return err
}
*o = IamRole(varIamRole)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdAt")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "deleted")
delete(additionalProperties, "description")
delete(additionalProperties, "displayName")
delete(additionalProperties, "domains")
delete(additionalProperties, "id")
delete(additionalProperties, "isEnabled")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "roles")
delete(additionalProperties, "teams")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "users")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamRole struct {
value *IamRole
isSet bool
}
func (v NullableIamRole) Get() *IamRole {
return v.value
}
func (v *NullableIamRole) Set(val *IamRole) {
v.value = val
v.isSet = true
}
func (v NullableIamRole) IsSet() bool {
return v.isSet
}
func (v *NullableIamRole) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamRole(val *IamRole) *NullableIamRole {
return &NullableIamRole{value: val, isSet: true}
}
func (v NullableIamRole) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamRole) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}