Files
sdk/model_iam_consent_record.go

191 lines
5.1 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 IamConsentRecord type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamConsentRecord{}
// IamConsentRecord struct for IamConsentRecord
type IamConsentRecord struct {
Application *string `json:"application,omitempty"`
GrantedScopes []string `json:"grantedScopes,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamConsentRecord IamConsentRecord
// NewIamConsentRecord instantiates a new IamConsentRecord 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 NewIamConsentRecord() *IamConsentRecord {
this := IamConsentRecord{}
return &this
}
// NewIamConsentRecordWithDefaults instantiates a new IamConsentRecord 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 NewIamConsentRecordWithDefaults() *IamConsentRecord {
this := IamConsentRecord{}
return &this
}
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *IamConsentRecord) GetApplication() string {
if o == nil || IsNil(o.Application) {
var ret string
return ret
}
return *o.Application
}
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamConsentRecord) GetApplicationOk() (*string, bool) {
if o == nil || IsNil(o.Application) {
return nil, false
}
return o.Application, true
}
// HasApplication returns a boolean if a field has been set.
func (o *IamConsentRecord) HasApplication() bool {
if o != nil && !IsNil(o.Application) {
return true
}
return false
}
// SetApplication gets a reference to the given string and assigns it to the Application field.
func (o *IamConsentRecord) SetApplication(v string) {
o.Application = &v
}
// GetGrantedScopes returns the GrantedScopes field value if set, zero value otherwise.
func (o *IamConsentRecord) GetGrantedScopes() []string {
if o == nil || IsNil(o.GrantedScopes) {
var ret []string
return ret
}
return o.GrantedScopes
}
// GetGrantedScopesOk returns a tuple with the GrantedScopes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamConsentRecord) GetGrantedScopesOk() ([]string, bool) {
if o == nil || IsNil(o.GrantedScopes) {
return nil, false
}
return o.GrantedScopes, true
}
// HasGrantedScopes returns a boolean if a field has been set.
func (o *IamConsentRecord) HasGrantedScopes() bool {
if o != nil && !IsNil(o.GrantedScopes) {
return true
}
return false
}
// SetGrantedScopes gets a reference to the given []string and assigns it to the GrantedScopes field.
func (o *IamConsentRecord) SetGrantedScopes(v []string) {
o.GrantedScopes = v
}
func (o IamConsentRecord) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamConsentRecord) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Application) {
toSerialize["application"] = o.Application
}
if !IsNil(o.GrantedScopes) {
toSerialize["grantedScopes"] = o.GrantedScopes
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamConsentRecord) UnmarshalJSON(data []byte) (err error) {
varIamConsentRecord := _IamConsentRecord{}
err = json.Unmarshal(data, &varIamConsentRecord)
if err != nil {
return err
}
*o = IamConsentRecord(varIamConsentRecord)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "application")
delete(additionalProperties, "grantedScopes")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamConsentRecord struct {
value *IamConsentRecord
isSet bool
}
func (v NullableIamConsentRecord) Get() *IamConsentRecord {
return v.value
}
func (v *NullableIamConsentRecord) Set(val *IamConsentRecord) {
v.value = val
v.isSet = true
}
func (v NullableIamConsentRecord) IsSet() bool {
return v.isSet
}
func (v *NullableIamConsentRecord) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamConsentRecord(val *IamConsentRecord) *NullableIamConsentRecord {
return &NullableIamConsentRecord{value: val, isSet: true}
}
func (v NullableIamConsentRecord) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamConsentRecord) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}