Files
sdk/model_marketing_segment.go

383 lines
9.8 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 MarketingSegment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MarketingSegment{}
// MarketingSegment struct for MarketingSegment
type MarketingSegment struct {
// Count is how many subscribers it selects now; filled on read of one.
Count *int64 `json:"count,omitempty"`
// CreatedAt is when it was saved, unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Filter is the selection.
Filter *MarketingFilter `json:"filter,omitempty"`
// ID is the segment's id (\"seg_\" and 96 random bits in hex).
Id *string `json:"id,omitempty"`
// List is the list it selects from.
List *string `json:"list,omitempty"`
// Name is what the segment is called; at most 200 characters.
Name *string `json:"name,omitempty"`
// UpdatedAt is the last change, unix seconds.
UpdatedAt *int64 `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MarketingSegment MarketingSegment
// NewMarketingSegment instantiates a new MarketingSegment 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 NewMarketingSegment() *MarketingSegment {
this := MarketingSegment{}
return &this
}
// NewMarketingSegmentWithDefaults instantiates a new MarketingSegment 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 NewMarketingSegmentWithDefaults() *MarketingSegment {
this := MarketingSegment{}
return &this
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *MarketingSegment) GetCount() int64 {
if o == nil || IsNil(o.Count) {
var ret int64
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetCountOk() (*int64, bool) {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *MarketingSegment) HasCount() bool {
if o != nil && !IsNil(o.Count) {
return true
}
return false
}
// SetCount gets a reference to the given int64 and assigns it to the Count field.
func (o *MarketingSegment) SetCount(v int64) {
o.Count = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *MarketingSegment) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *MarketingSegment) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *MarketingSegment) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetFilter returns the Filter field value if set, zero value otherwise.
func (o *MarketingSegment) GetFilter() MarketingFilter {
if o == nil || IsNil(o.Filter) {
var ret MarketingFilter
return ret
}
return *o.Filter
}
// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetFilterOk() (*MarketingFilter, bool) {
if o == nil || IsNil(o.Filter) {
return nil, false
}
return o.Filter, true
}
// HasFilter returns a boolean if a field has been set.
func (o *MarketingSegment) HasFilter() bool {
if o != nil && !IsNil(o.Filter) {
return true
}
return false
}
// SetFilter gets a reference to the given MarketingFilter and assigns it to the Filter field.
func (o *MarketingSegment) SetFilter(v MarketingFilter) {
o.Filter = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *MarketingSegment) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *MarketingSegment) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *MarketingSegment) SetId(v string) {
o.Id = &v
}
// GetList returns the List field value if set, zero value otherwise.
func (o *MarketingSegment) GetList() string {
if o == nil || IsNil(o.List) {
var ret string
return ret
}
return *o.List
}
// GetListOk returns a tuple with the List field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetListOk() (*string, bool) {
if o == nil || IsNil(o.List) {
return nil, false
}
return o.List, true
}
// HasList returns a boolean if a field has been set.
func (o *MarketingSegment) HasList() bool {
if o != nil && !IsNil(o.List) {
return true
}
return false
}
// SetList gets a reference to the given string and assigns it to the List field.
func (o *MarketingSegment) SetList(v string) {
o.List = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *MarketingSegment) 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 *MarketingSegment) 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 *MarketingSegment) 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 *MarketingSegment) SetName(v string) {
o.Name = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *MarketingSegment) GetUpdatedAt() int64 {
if o == nil || IsNil(o.UpdatedAt) {
var ret int64
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MarketingSegment) GetUpdatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *MarketingSegment) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
func (o *MarketingSegment) SetUpdatedAt(v int64) {
o.UpdatedAt = &v
}
func (o MarketingSegment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MarketingSegment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Filter) {
toSerialize["filter"] = o.Filter
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.List) {
toSerialize["list"] = o.List
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MarketingSegment) UnmarshalJSON(data []byte) (err error) {
varMarketingSegment := _MarketingSegment{}
err = json.Unmarshal(data, &varMarketingSegment)
if err != nil {
return err
}
*o = MarketingSegment(varMarketingSegment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "count")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "filter")
delete(additionalProperties, "id")
delete(additionalProperties, "list")
delete(additionalProperties, "name")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMarketingSegment struct {
value *MarketingSegment
isSet bool
}
func (v NullableMarketingSegment) Get() *MarketingSegment {
return v.value
}
func (v *NullableMarketingSegment) Set(val *MarketingSegment) {
v.value = val
v.isSet = true
}
func (v NullableMarketingSegment) IsSet() bool {
return v.isSet
}
func (v *NullableMarketingSegment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMarketingSegment(val *MarketingSegment) *NullableMarketingSegment {
return &NullableMarketingSegment{value: val, isSet: true}
}
func (v NullableMarketingSegment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMarketingSegment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}