Files
sdk/model_content_channel.go

269 lines
7.4 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 ContentChannel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContentChannel{}
// ContentChannel struct for ContentChannel
type ContentChannel struct {
// Disabled is true for a channel the org switched off at the social edge. It is still listed — this is what the org has CONNECTED, not what it can post to — but a publish never targets it, neither by name nor as part of the \"every channel\" default.
Disabled *bool `json:"disabled,omitempty"`
// ID is the social integration id a post targets. It is the exact value to put in a content item's `channels` list to reach this one connected account.
Id *string `json:"id,omitempty"`
// Name is the account label as the org connected it — the handle a human recognises. It is never an address: a publish resolves channels by ID or by Provider and never by this.
Name *string `json:"name,omitempty"`
// Provider is the network behind the integration: \"x\", \"instagram\", \"tiktok\" and the rest of what the org connected. Naming a provider in a publish targets EVERY connected account of it, so it is the coarse handle where ID is the precise one.
Provider *string `json:"provider,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ContentChannel ContentChannel
// NewContentChannel instantiates a new ContentChannel 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 NewContentChannel() *ContentChannel {
this := ContentChannel{}
return &this
}
// NewContentChannelWithDefaults instantiates a new ContentChannel 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 NewContentChannelWithDefaults() *ContentChannel {
this := ContentChannel{}
return &this
}
// GetDisabled returns the Disabled field value if set, zero value otherwise.
func (o *ContentChannel) GetDisabled() bool {
if o == nil || IsNil(o.Disabled) {
var ret bool
return ret
}
return *o.Disabled
}
// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentChannel) GetDisabledOk() (*bool, bool) {
if o == nil || IsNil(o.Disabled) {
return nil, false
}
return o.Disabled, true
}
// HasDisabled returns a boolean if a field has been set.
func (o *ContentChannel) HasDisabled() bool {
if o != nil && !IsNil(o.Disabled) {
return true
}
return false
}
// SetDisabled gets a reference to the given bool and assigns it to the Disabled field.
func (o *ContentChannel) SetDisabled(v bool) {
o.Disabled = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ContentChannel) 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 *ContentChannel) 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 *ContentChannel) 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 *ContentChannel) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ContentChannel) 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 *ContentChannel) 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 *ContentChannel) 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 *ContentChannel) SetName(v string) {
o.Name = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ContentChannel) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentChannel) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ContentChannel) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ContentChannel) SetProvider(v string) {
o.Provider = &v
}
func (o ContentChannel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContentChannel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Disabled) {
toSerialize["disabled"] = o.Disabled
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContentChannel) UnmarshalJSON(data []byte) (err error) {
varContentChannel := _ContentChannel{}
err = json.Unmarshal(data, &varContentChannel)
if err != nil {
return err
}
*o = ContentChannel(varContentChannel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "disabled")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "provider")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContentChannel struct {
value *ContentChannel
isSet bool
}
func (v NullableContentChannel) Get() *ContentChannel {
return v.value
}
func (v *NullableContentChannel) Set(val *ContentChannel) {
v.value = val
v.isSet = true
}
func (v NullableContentChannel) IsSet() bool {
return v.isSet
}
func (v *NullableContentChannel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContentChannel(val *ContentChannel) *NullableContentChannel {
return &NullableContentChannel{value: val, isSet: true}
}
func (v NullableContentChannel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContentChannel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}