Files
sdk/model_delivery.go

302 lines
7.5 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 Delivery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Delivery{}
// Delivery struct for Delivery
type Delivery struct {
DetectedSource *string `json:"detected_source,omitempty"`
Model *string `json:"model,omitempty"`
Tier *string `json:"tier,omitempty"`
Translations []Translation `json:"translations,omitempty"`
Usage *Tally `json:"usage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Delivery Delivery
// NewDelivery instantiates a new Delivery 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 NewDelivery() *Delivery {
this := Delivery{}
return &this
}
// NewDeliveryWithDefaults instantiates a new Delivery 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 NewDeliveryWithDefaults() *Delivery {
this := Delivery{}
return &this
}
// GetDetectedSource returns the DetectedSource field value if set, zero value otherwise.
func (o *Delivery) GetDetectedSource() string {
if o == nil || IsNil(o.DetectedSource) {
var ret string
return ret
}
return *o.DetectedSource
}
// GetDetectedSourceOk returns a tuple with the DetectedSource field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Delivery) GetDetectedSourceOk() (*string, bool) {
if o == nil || IsNil(o.DetectedSource) {
return nil, false
}
return o.DetectedSource, true
}
// HasDetectedSource returns a boolean if a field has been set.
func (o *Delivery) HasDetectedSource() bool {
if o != nil && !IsNil(o.DetectedSource) {
return true
}
return false
}
// SetDetectedSource gets a reference to the given string and assigns it to the DetectedSource field.
func (o *Delivery) SetDetectedSource(v string) {
o.DetectedSource = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *Delivery) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Delivery) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *Delivery) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *Delivery) SetModel(v string) {
o.Model = &v
}
// GetTier returns the Tier field value if set, zero value otherwise.
func (o *Delivery) GetTier() string {
if o == nil || IsNil(o.Tier) {
var ret string
return ret
}
return *o.Tier
}
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Delivery) GetTierOk() (*string, bool) {
if o == nil || IsNil(o.Tier) {
return nil, false
}
return o.Tier, true
}
// HasTier returns a boolean if a field has been set.
func (o *Delivery) HasTier() bool {
if o != nil && !IsNil(o.Tier) {
return true
}
return false
}
// SetTier gets a reference to the given string and assigns it to the Tier field.
func (o *Delivery) SetTier(v string) {
o.Tier = &v
}
// GetTranslations returns the Translations field value if set, zero value otherwise.
func (o *Delivery) GetTranslations() []Translation {
if o == nil || IsNil(o.Translations) {
var ret []Translation
return ret
}
return o.Translations
}
// GetTranslationsOk returns a tuple with the Translations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Delivery) GetTranslationsOk() ([]Translation, bool) {
if o == nil || IsNil(o.Translations) {
return nil, false
}
return o.Translations, true
}
// HasTranslations returns a boolean if a field has been set.
func (o *Delivery) HasTranslations() bool {
if o != nil && !IsNil(o.Translations) {
return true
}
return false
}
// SetTranslations gets a reference to the given []Translation and assigns it to the Translations field.
func (o *Delivery) SetTranslations(v []Translation) {
o.Translations = v
}
// GetUsage returns the Usage field value if set, zero value otherwise.
func (o *Delivery) GetUsage() Tally {
if o == nil || IsNil(o.Usage) {
var ret Tally
return ret
}
return *o.Usage
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Delivery) GetUsageOk() (*Tally, bool) {
if o == nil || IsNil(o.Usage) {
return nil, false
}
return o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *Delivery) HasUsage() bool {
if o != nil && !IsNil(o.Usage) {
return true
}
return false
}
// SetUsage gets a reference to the given Tally and assigns it to the Usage field.
func (o *Delivery) SetUsage(v Tally) {
o.Usage = &v
}
func (o Delivery) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Delivery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DetectedSource) {
toSerialize["detected_source"] = o.DetectedSource
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Tier) {
toSerialize["tier"] = o.Tier
}
if !IsNil(o.Translations) {
toSerialize["translations"] = o.Translations
}
if !IsNil(o.Usage) {
toSerialize["usage"] = o.Usage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Delivery) UnmarshalJSON(data []byte) (err error) {
varDelivery := _Delivery{}
err = json.Unmarshal(data, &varDelivery)
if err != nil {
return err
}
*o = Delivery(varDelivery)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "detected_source")
delete(additionalProperties, "model")
delete(additionalProperties, "tier")
delete(additionalProperties, "translations")
delete(additionalProperties, "usage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDelivery struct {
value *Delivery
isSet bool
}
func (v NullableDelivery) Get() *Delivery {
return v.value
}
func (v *NullableDelivery) Set(val *Delivery) {
v.value = val
v.isSet = true
}
func (v NullableDelivery) IsSet() bool {
return v.isSet
}
func (v *NullableDelivery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDelivery(val *Delivery) *NullableDelivery {
return &NullableDelivery{value: val, isSet: true}
}
func (v NullableDelivery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDelivery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}