Files
sdk/model_network_identity_view.go

269 lines
7.2 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"
)
// checks if the NetworkIdentityView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkIdentityView{}
// NetworkIdentityView struct for NetworkIdentityView
type NetworkIdentityView struct {
// ExternalID is the IAM subject the identity logs in as: the controller admits a bearer whose `sub` equals it.
ExternalId *string `json:"externalId,omitempty"`
// ID is the identity's fabric id — the key DELETE addresses.
Id *string `json:"id,omitempty"`
// Name is the identity's name within the org.
Name *string `json:"name,omitempty"`
// Roles are the identity's role attributes as the fabric holds them: the \"org-<org>\" of every org it was ensured in, plus any org-scoped roles.
Roles []string `json:"roles,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NetworkIdentityView NetworkIdentityView
// NewNetworkIdentityView instantiates a new NetworkIdentityView 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 NewNetworkIdentityView() *NetworkIdentityView {
this := NetworkIdentityView{}
return &this
}
// NewNetworkIdentityViewWithDefaults instantiates a new NetworkIdentityView 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 NewNetworkIdentityViewWithDefaults() *NetworkIdentityView {
this := NetworkIdentityView{}
return &this
}
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *NetworkIdentityView) GetExternalId() string {
if o == nil || IsNil(o.ExternalId) {
var ret string
return ret
}
return *o.ExternalId
}
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkIdentityView) GetExternalIdOk() (*string, bool) {
if o == nil || IsNil(o.ExternalId) {
return nil, false
}
return o.ExternalId, true
}
// HasExternalId returns a boolean if a field has been set.
func (o *NetworkIdentityView) HasExternalId() bool {
if o != nil && !IsNil(o.ExternalId) {
return true
}
return false
}
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
func (o *NetworkIdentityView) SetExternalId(v string) {
o.ExternalId = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) SetName(v string) {
o.Name = &v
}
// GetRoles returns the Roles field value if set, zero value otherwise.
func (o *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) 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 *NetworkIdentityView) SetRoles(v []string) {
o.Roles = v
}
func (o NetworkIdentityView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NetworkIdentityView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExternalId) {
toSerialize["externalId"] = o.ExternalId
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Roles) {
toSerialize["roles"] = o.Roles
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NetworkIdentityView) UnmarshalJSON(data []byte) (err error) {
varNetworkIdentityView := _NetworkIdentityView{}
err = json.Unmarshal(data, &varNetworkIdentityView)
if err != nil {
return err
}
*o = NetworkIdentityView(varNetworkIdentityView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "externalId")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "roles")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNetworkIdentityView struct {
value *NetworkIdentityView
isSet bool
}
func (v NullableNetworkIdentityView) Get() *NetworkIdentityView {
return v.value
}
func (v *NullableNetworkIdentityView) Set(val *NetworkIdentityView) {
v.value = val
v.isSet = true
}
func (v NullableNetworkIdentityView) IsSet() bool {
return v.isSet
}
func (v *NullableNetworkIdentityView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetworkIdentityView(val *NetworkIdentityView) *NullableNetworkIdentityView {
return &NullableNetworkIdentityView{value: val, isSet: true}
}
func (v NullableNetworkIdentityView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetworkIdentityView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}