Files
sdk/model_marketing_mapping.go

459 lines
12 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 MarketingMapping type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MarketingMapping{}
// MarketingMapping struct for MarketingMapping
type MarketingMapping struct {
// ConsentAt is a column holding when the person subscribed.
ConsentAt *string `json:"consentAt,omitempty"`
// Email is the column holding the address.
Email *string `json:"email,omitempty"`
// Fields maps a custom field key to the column holding it.
Fields map[string]string `json:"fields,omitempty"`
// First and Last are columns holding the name in two parts.
First *string `json:"first,omitempty"`
// Language is a column holding a language or locale.
Language *string `json:"language,omitempty"`
// Last is the family name's column.
Last *string `json:"last,omitempty"`
// Name is a column holding the whole name.
Name *string `json:"name,omitempty"`
// Status is a column holding a status from another provider (subscribed, unsubscribed, cleaned, bounced, complained and their usual spellings).
Status *string `json:"status,omitempty"`
// Tags is a column of tags separated by commas or semicolons.
Tags *string `json:"tags,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MarketingMapping MarketingMapping
// NewMarketingMapping instantiates a new MarketingMapping 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 NewMarketingMapping() *MarketingMapping {
this := MarketingMapping{}
return &this
}
// NewMarketingMappingWithDefaults instantiates a new MarketingMapping 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 NewMarketingMappingWithDefaults() *MarketingMapping {
this := MarketingMapping{}
return &this
}
// GetConsentAt returns the ConsentAt field value if set, zero value otherwise.
func (o *MarketingMapping) GetConsentAt() string {
if o == nil || IsNil(o.ConsentAt) {
var ret string
return ret
}
return *o.ConsentAt
}
// GetConsentAtOk returns a tuple with the ConsentAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetConsentAtOk() (*string, bool) {
if o == nil || IsNil(o.ConsentAt) {
return nil, false
}
return o.ConsentAt, true
}
// HasConsentAt returns a boolean if a field has been set.
func (o *MarketingMapping) HasConsentAt() bool {
if o != nil && !IsNil(o.ConsentAt) {
return true
}
return false
}
// SetConsentAt gets a reference to the given string and assigns it to the ConsentAt field.
func (o *MarketingMapping) SetConsentAt(v string) {
o.ConsentAt = &v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *MarketingMapping) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *MarketingMapping) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *MarketingMapping) SetEmail(v string) {
o.Email = &v
}
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *MarketingMapping) GetFields() map[string]string {
if o == nil || IsNil(o.Fields) {
var ret map[string]string
return ret
}
return o.Fields
}
// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetFieldsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Fields) {
return map[string]string{}, false
}
return o.Fields, true
}
// HasFields returns a boolean if a field has been set.
func (o *MarketingMapping) HasFields() bool {
if o != nil && !IsNil(o.Fields) {
return true
}
return false
}
// SetFields gets a reference to the given map[string]string and assigns it to the Fields field.
func (o *MarketingMapping) SetFields(v map[string]string) {
o.Fields = v
}
// GetFirst returns the First field value if set, zero value otherwise.
func (o *MarketingMapping) GetFirst() string {
if o == nil || IsNil(o.First) {
var ret string
return ret
}
return *o.First
}
// GetFirstOk returns a tuple with the First field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetFirstOk() (*string, bool) {
if o == nil || IsNil(o.First) {
return nil, false
}
return o.First, true
}
// HasFirst returns a boolean if a field has been set.
func (o *MarketingMapping) HasFirst() bool {
if o != nil && !IsNil(o.First) {
return true
}
return false
}
// SetFirst gets a reference to the given string and assigns it to the First field.
func (o *MarketingMapping) SetFirst(v string) {
o.First = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *MarketingMapping) GetLanguage() string {
if o == nil || IsNil(o.Language) {
var ret string
return ret
}
return *o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetLanguageOk() (*string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *MarketingMapping) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given string and assigns it to the Language field.
func (o *MarketingMapping) SetLanguage(v string) {
o.Language = &v
}
// GetLast returns the Last field value if set, zero value otherwise.
func (o *MarketingMapping) GetLast() string {
if o == nil || IsNil(o.Last) {
var ret string
return ret
}
return *o.Last
}
// GetLastOk returns a tuple with the Last field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetLastOk() (*string, bool) {
if o == nil || IsNil(o.Last) {
return nil, false
}
return o.Last, true
}
// HasLast returns a boolean if a field has been set.
func (o *MarketingMapping) HasLast() bool {
if o != nil && !IsNil(o.Last) {
return true
}
return false
}
// SetLast gets a reference to the given string and assigns it to the Last field.
func (o *MarketingMapping) SetLast(v string) {
o.Last = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *MarketingMapping) 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 *MarketingMapping) 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 *MarketingMapping) 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 *MarketingMapping) SetName(v string) {
o.Name = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *MarketingMapping) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingMapping) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *MarketingMapping) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *MarketingMapping) SetStatus(v string) {
o.Status = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *MarketingMapping) GetTags() string {
if o == nil || IsNil(o.Tags) {
var ret string
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 *MarketingMapping) GetTagsOk() (*string, 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 *MarketingMapping) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given string and assigns it to the Tags field.
func (o *MarketingMapping) SetTags(v string) {
o.Tags = &v
}
func (o MarketingMapping) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MarketingMapping) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ConsentAt) {
toSerialize["consentAt"] = o.ConsentAt
}
if !IsNil(o.Email) {
toSerialize["email"] = o.Email
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.First) {
toSerialize["first"] = o.First
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Last) {
toSerialize["last"] = o.Last
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MarketingMapping) UnmarshalJSON(data []byte) (err error) {
varMarketingMapping := _MarketingMapping{}
err = json.Unmarshal(data, &varMarketingMapping)
if err != nil {
return err
}
*o = MarketingMapping(varMarketingMapping)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "consentAt")
delete(additionalProperties, "email")
delete(additionalProperties, "fields")
delete(additionalProperties, "first")
delete(additionalProperties, "language")
delete(additionalProperties, "last")
delete(additionalProperties, "name")
delete(additionalProperties, "status")
delete(additionalProperties, "tags")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMarketingMapping struct {
value *MarketingMapping
isSet bool
}
func (v NullableMarketingMapping) Get() *MarketingMapping {
return v.value
}
func (v *NullableMarketingMapping) Set(val *MarketingMapping) {
v.value = val
v.isSet = true
}
func (v NullableMarketingMapping) IsSet() bool {
return v.isSet
}
func (v *NullableMarketingMapping) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMarketingMapping(val *MarketingMapping) *NullableMarketingMapping {
return &NullableMarketingMapping{value: val, isSet: true}
}
func (v NullableMarketingMapping) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMarketingMapping) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}