Files
sdk/model_tag_config.go

228 lines
5.5 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 TagConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagConfig{}
// TagConfig struct for TagConfig
type TagConfig struct {
Audience *string `json:"audience,omitempty"`
Consent *Decision `json:"consent,omitempty"`
Tags []BrowserTagOut `json:"tags,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TagConfig TagConfig
// NewTagConfig instantiates a new TagConfig 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 NewTagConfig() *TagConfig {
this := TagConfig{}
return &this
}
// NewTagConfigWithDefaults instantiates a new TagConfig 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 NewTagConfigWithDefaults() *TagConfig {
this := TagConfig{}
return &this
}
// GetAudience returns the Audience field value if set, zero value otherwise.
func (o *TagConfig) GetAudience() string {
if o == nil || IsNil(o.Audience) {
var ret string
return ret
}
return *o.Audience
}
// GetAudienceOk returns a tuple with the Audience field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TagConfig) GetAudienceOk() (*string, bool) {
if o == nil || IsNil(o.Audience) {
return nil, false
}
return o.Audience, true
}
// HasAudience returns a boolean if a field has been set.
func (o *TagConfig) HasAudience() bool {
if o != nil && !IsNil(o.Audience) {
return true
}
return false
}
// SetAudience gets a reference to the given string and assigns it to the Audience field.
func (o *TagConfig) SetAudience(v string) {
o.Audience = &v
}
// GetConsent returns the Consent field value if set, zero value otherwise.
func (o *TagConfig) GetConsent() Decision {
if o == nil || IsNil(o.Consent) {
var ret Decision
return ret
}
return *o.Consent
}
// GetConsentOk returns a tuple with the Consent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TagConfig) GetConsentOk() (*Decision, bool) {
if o == nil || IsNil(o.Consent) {
return nil, false
}
return o.Consent, true
}
// HasConsent returns a boolean if a field has been set.
func (o *TagConfig) HasConsent() bool {
if o != nil && !IsNil(o.Consent) {
return true
}
return false
}
// SetConsent gets a reference to the given Decision and assigns it to the Consent field.
func (o *TagConfig) SetConsent(v Decision) {
o.Consent = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *TagConfig) GetTags() []BrowserTagOut {
if o == nil || IsNil(o.Tags) {
var ret []BrowserTagOut
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TagConfig) GetTagsOk() ([]BrowserTagOut, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *TagConfig) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []BrowserTagOut and assigns it to the Tags field.
func (o *TagConfig) SetTags(v []BrowserTagOut) {
o.Tags = v
}
func (o TagConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Audience) {
toSerialize["audience"] = o.Audience
}
if !IsNil(o.Consent) {
toSerialize["consent"] = o.Consent
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TagConfig) UnmarshalJSON(data []byte) (err error) {
varTagConfig := _TagConfig{}
err = json.Unmarshal(data, &varTagConfig)
if err != nil {
return err
}
*o = TagConfig(varTagConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "audience")
delete(additionalProperties, "consent")
delete(additionalProperties, "tags")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTagConfig struct {
value *TagConfig
isSet bool
}
func (v NullableTagConfig) Get() *TagConfig {
return v.value
}
func (v *NullableTagConfig) Set(val *TagConfig) {
v.value = val
v.isSet = true
}
func (v NullableTagConfig) IsSet() bool {
return v.isSet
}
func (v *NullableTagConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagConfig(val *TagConfig) *NullableTagConfig {
return &NullableTagConfig{value: val, isSet: true}
}
func (v NullableTagConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}