Files
sdk/model_utm.go

302 lines
7.0 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 UTM type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UTM{}
// UTM struct for UTM
type UTM struct {
Campaign *string `json:"campaign,omitempty"`
Content *string `json:"content,omitempty"`
Medium *string `json:"medium,omitempty"`
Source *string `json:"source,omitempty"`
Term *string `json:"term,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UTM UTM
// NewUTM instantiates a new UTM 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 NewUTM() *UTM {
this := UTM{}
return &this
}
// NewUTMWithDefaults instantiates a new UTM 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 NewUTMWithDefaults() *UTM {
this := UTM{}
return &this
}
// GetCampaign returns the Campaign field value if set, zero value otherwise.
func (o *UTM) GetCampaign() string {
if o == nil || IsNil(o.Campaign) {
var ret string
return ret
}
return *o.Campaign
}
// GetCampaignOk returns a tuple with the Campaign field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UTM) GetCampaignOk() (*string, bool) {
if o == nil || IsNil(o.Campaign) {
return nil, false
}
return o.Campaign, true
}
// HasCampaign returns a boolean if a field has been set.
func (o *UTM) HasCampaign() bool {
if o != nil && !IsNil(o.Campaign) {
return true
}
return false
}
// SetCampaign gets a reference to the given string and assigns it to the Campaign field.
func (o *UTM) SetCampaign(v string) {
o.Campaign = &v
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *UTM) GetContent() string {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
return *o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UTM) GetContentOk() (*string, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *UTM) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *UTM) SetContent(v string) {
o.Content = &v
}
// GetMedium returns the Medium field value if set, zero value otherwise.
func (o *UTM) GetMedium() string {
if o == nil || IsNil(o.Medium) {
var ret string
return ret
}
return *o.Medium
}
// GetMediumOk returns a tuple with the Medium field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UTM) GetMediumOk() (*string, bool) {
if o == nil || IsNil(o.Medium) {
return nil, false
}
return o.Medium, true
}
// HasMedium returns a boolean if a field has been set.
func (o *UTM) HasMedium() bool {
if o != nil && !IsNil(o.Medium) {
return true
}
return false
}
// SetMedium gets a reference to the given string and assigns it to the Medium field.
func (o *UTM) SetMedium(v string) {
o.Medium = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *UTM) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UTM) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *UTM) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *UTM) SetSource(v string) {
o.Source = &v
}
// GetTerm returns the Term field value if set, zero value otherwise.
func (o *UTM) GetTerm() string {
if o == nil || IsNil(o.Term) {
var ret string
return ret
}
return *o.Term
}
// GetTermOk returns a tuple with the Term field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UTM) GetTermOk() (*string, bool) {
if o == nil || IsNil(o.Term) {
return nil, false
}
return o.Term, true
}
// HasTerm returns a boolean if a field has been set.
func (o *UTM) HasTerm() bool {
if o != nil && !IsNil(o.Term) {
return true
}
return false
}
// SetTerm gets a reference to the given string and assigns it to the Term field.
func (o *UTM) SetTerm(v string) {
o.Term = &v
}
func (o UTM) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UTM) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Campaign) {
toSerialize["campaign"] = o.Campaign
}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.Medium) {
toSerialize["medium"] = o.Medium
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Term) {
toSerialize["term"] = o.Term
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UTM) UnmarshalJSON(data []byte) (err error) {
varUTM := _UTM{}
err = json.Unmarshal(data, &varUTM)
if err != nil {
return err
}
*o = UTM(varUTM)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "campaign")
delete(additionalProperties, "content")
delete(additionalProperties, "medium")
delete(additionalProperties, "source")
delete(additionalProperties, "term")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUTM struct {
value *UTM
isSet bool
}
func (v NullableUTM) Get() *UTM {
return v.value
}
func (v *NullableUTM) Set(val *UTM) {
v.value = val
v.isSet = true
}
func (v NullableUTM) IsSet() bool {
return v.isSet
}
func (v *NullableUTM) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUTM(val *UTM) *NullableUTM {
return &NullableUTM{value: val, isSet: true}
}
func (v NullableUTM) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUTM) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}