Files
sdk/model_auto_post_result.go

231 lines
5.7 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 AutoPostResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AutoPostResult{}
// AutoPostResult struct for AutoPostResult
type AutoPostResult struct {
// Error is the platform's reason it did not go; absent when it did.
Error *string `json:"error,omitempty"`
// To is the account's platform: x, linkedin or facebook.
To *string `json:"to,omitempty"`
// URL opens the post; absent when it did not go.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AutoPostResult AutoPostResult
// NewAutoPostResult instantiates a new AutoPostResult 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 NewAutoPostResult() *AutoPostResult {
this := AutoPostResult{}
return &this
}
// NewAutoPostResultWithDefaults instantiates a new AutoPostResult 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 NewAutoPostResultWithDefaults() *AutoPostResult {
this := AutoPostResult{}
return &this
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *AutoPostResult) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoPostResult) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *AutoPostResult) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *AutoPostResult) SetError(v string) {
o.Error = &v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *AutoPostResult) GetTo() string {
if o == nil || IsNil(o.To) {
var ret string
return ret
}
return *o.To
}
// GetToOk returns a tuple with the To field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoPostResult) GetToOk() (*string, bool) {
if o == nil || IsNil(o.To) {
return nil, false
}
return o.To, true
}
// HasTo returns a boolean if a field has been set.
func (o *AutoPostResult) HasTo() bool {
if o != nil && !IsNil(o.To) {
return true
}
return false
}
// SetTo gets a reference to the given string and assigns it to the To field.
func (o *AutoPostResult) SetTo(v string) {
o.To = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *AutoPostResult) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoPostResult) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *AutoPostResult) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *AutoPostResult) SetUrl(v string) {
o.Url = &v
}
func (o AutoPostResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AutoPostResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.To) {
toSerialize["to"] = o.To
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AutoPostResult) UnmarshalJSON(data []byte) (err error) {
varAutoPostResult := _AutoPostResult{}
err = json.Unmarshal(data, &varAutoPostResult)
if err != nil {
return err
}
*o = AutoPostResult(varAutoPostResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "to")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAutoPostResult struct {
value *AutoPostResult
isSet bool
}
func (v NullableAutoPostResult) Get() *AutoPostResult {
return v.value
}
func (v *NullableAutoPostResult) Set(val *AutoPostResult) {
v.value = val
v.isSet = true
}
func (v NullableAutoPostResult) IsSet() bool {
return v.isSet
}
func (v *NullableAutoPostResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAutoPostResult(val *AutoPostResult) *NullableAutoPostResult {
return &NullableAutoPostResult{value: val, isSet: true}
}
func (v NullableAutoPostResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAutoPostResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}