/* * Subset of Influx API covered by Influx CLI * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package api import ( "encoding/json" ) // PermissionResource struct for PermissionResource type PermissionResource struct { Type string `json:"type"` // If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. Id NullableString `json:"id,omitempty"` // Optional name of the resource if the resource has a name field. Name NullableString `json:"name,omitempty"` // If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type. OrgID NullableString `json:"orgID,omitempty"` // Optional name of the organization of the organization with orgID. Org NullableString `json:"org,omitempty"` } // NewPermissionResource instantiates a new PermissionResource 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 NewPermissionResource(type_ string) *PermissionResource { this := PermissionResource{} this.Type = type_ return &this } // NewPermissionResourceWithDefaults instantiates a new PermissionResource 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 NewPermissionResourceWithDefaults() *PermissionResource { this := PermissionResource{} return &this } // GetType returns the Type field value func (o *PermissionResource) GetType() string { if o == nil { var ret string return ret } return o.Type } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *PermissionResource) GetTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.Type, true } // SetType sets field value func (o *PermissionResource) SetType(v string) { o.Type = v } // GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PermissionResource) GetId() string { if o == nil || o.Id.Get() == nil { var ret string return ret } return *o.Id.Get() } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PermissionResource) GetIdOk() (*string, bool) { if o == nil { return nil, false } return o.Id.Get(), o.Id.IsSet() } // HasId returns a boolean if a field has been set. func (o *PermissionResource) HasId() bool { if o != nil && o.Id.IsSet() { return true } return false } // SetId gets a reference to the given NullableString and assigns it to the Id field. func (o *PermissionResource) SetId(v string) { o.Id.Set(&v) } // SetIdNil sets the value for Id to be an explicit nil func (o *PermissionResource) SetIdNil() { o.Id.Set(nil) } // UnsetId ensures that no value is present for Id, not even an explicit nil func (o *PermissionResource) UnsetId() { o.Id.Unset() } // GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PermissionResource) GetName() string { if o == nil || o.Name.Get() == nil { var ret string return ret } return *o.Name.Get() } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PermissionResource) GetNameOk() (*string, bool) { if o == nil { return nil, false } return o.Name.Get(), o.Name.IsSet() } // HasName returns a boolean if a field has been set. func (o *PermissionResource) HasName() bool { if o != nil && o.Name.IsSet() { return true } return false } // SetName gets a reference to the given NullableString and assigns it to the Name field. func (o *PermissionResource) SetName(v string) { o.Name.Set(&v) } // SetNameNil sets the value for Name to be an explicit nil func (o *PermissionResource) SetNameNil() { o.Name.Set(nil) } // UnsetName ensures that no value is present for Name, not even an explicit nil func (o *PermissionResource) UnsetName() { o.Name.Unset() } // GetOrgID returns the OrgID field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PermissionResource) GetOrgID() string { if o == nil || o.OrgID.Get() == nil { var ret string return ret } return *o.OrgID.Get() } // GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PermissionResource) GetOrgIDOk() (*string, bool) { if o == nil { return nil, false } return o.OrgID.Get(), o.OrgID.IsSet() } // HasOrgID returns a boolean if a field has been set. func (o *PermissionResource) HasOrgID() bool { if o != nil && o.OrgID.IsSet() { return true } return false } // SetOrgID gets a reference to the given NullableString and assigns it to the OrgID field. func (o *PermissionResource) SetOrgID(v string) { o.OrgID.Set(&v) } // SetOrgIDNil sets the value for OrgID to be an explicit nil func (o *PermissionResource) SetOrgIDNil() { o.OrgID.Set(nil) } // UnsetOrgID ensures that no value is present for OrgID, not even an explicit nil func (o *PermissionResource) UnsetOrgID() { o.OrgID.Unset() } // GetOrg returns the Org field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PermissionResource) GetOrg() string { if o == nil || o.Org.Get() == nil { var ret string return ret } return *o.Org.Get() } // GetOrgOk returns a tuple with the Org field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PermissionResource) GetOrgOk() (*string, bool) { if o == nil { return nil, false } return o.Org.Get(), o.Org.IsSet() } // HasOrg returns a boolean if a field has been set. func (o *PermissionResource) HasOrg() bool { if o != nil && o.Org.IsSet() { return true } return false } // SetOrg gets a reference to the given NullableString and assigns it to the Org field. func (o *PermissionResource) SetOrg(v string) { o.Org.Set(&v) } // SetOrgNil sets the value for Org to be an explicit nil func (o *PermissionResource) SetOrgNil() { o.Org.Set(nil) } // UnsetOrg ensures that no value is present for Org, not even an explicit nil func (o *PermissionResource) UnsetOrg() { o.Org.Unset() } func (o PermissionResource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { toSerialize["type"] = o.Type } if o.Id.IsSet() { toSerialize["id"] = o.Id.Get() } if o.Name.IsSet() { toSerialize["name"] = o.Name.Get() } if o.OrgID.IsSet() { toSerialize["orgID"] = o.OrgID.Get() } if o.Org.IsSet() { toSerialize["org"] = o.Org.Get() } return json.Marshal(toSerialize) } type NullablePermissionResource struct { value *PermissionResource isSet bool } func (v NullablePermissionResource) Get() *PermissionResource { return v.value } func (v *NullablePermissionResource) Set(val *PermissionResource) { v.value = val v.isSet = true } func (v NullablePermissionResource) IsSet() bool { return v.isSet } func (v *NullablePermissionResource) Unset() { v.value = nil v.isSet = false } func NewNullablePermissionResource(val *PermissionResource) *NullablePermissionResource { return &NullablePermissionResource{value: val, isSet: true} } func (v NullablePermissionResource) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullablePermissionResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }