mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
8.9 KiB
Go
345 lines
8.9 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 PricingComponent type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PricingComponent{}
|
|
|
|
// PricingComponent struct for PricingComponent
|
|
type PricingComponent struct {
|
|
// Basis is what it is metered by, in the fewest words that are true.
|
|
Basis *string `json:"basis,omitempty"`
|
|
// Name is the component's name on the spend breakdown.
|
|
Name *string `json:"name,omitempty"`
|
|
// Note is what the component means, in one sentence.
|
|
Note *string `json:"note,omitempty"`
|
|
// Quoted says whether a call is priced BEFORE it runs. A quoted component can refuse a call that would breach a budget; a measured one is booked from what it used and is bounded by the headroom under the per-task cap instead.
|
|
Quoted *bool `json:"quoted,omitempty"`
|
|
// Tiers are the disjoint tiers this component meters in, where it has them.
|
|
Tiers []string `json:"tiers,omitempty"`
|
|
// Title is how it reads on a price list.
|
|
Title *string `json:"title,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PricingComponent PricingComponent
|
|
|
|
// NewPricingComponent instantiates a new PricingComponent 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 NewPricingComponent() *PricingComponent {
|
|
this := PricingComponent{}
|
|
return &this
|
|
}
|
|
|
|
// NewPricingComponentWithDefaults instantiates a new PricingComponent 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 NewPricingComponentWithDefaults() *PricingComponent {
|
|
this := PricingComponent{}
|
|
return &this
|
|
}
|
|
|
|
// GetBasis returns the Basis field value if set, zero value otherwise.
|
|
func (o *PricingComponent) GetBasis() string {
|
|
if o == nil || IsNil(o.Basis) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Basis
|
|
}
|
|
|
|
// GetBasisOk returns a tuple with the Basis field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PricingComponent) GetBasisOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Basis) {
|
|
return nil, false
|
|
}
|
|
return o.Basis, true
|
|
}
|
|
|
|
// HasBasis returns a boolean if a field has been set.
|
|
func (o *PricingComponent) HasBasis() bool {
|
|
if o != nil && !IsNil(o.Basis) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBasis gets a reference to the given string and assigns it to the Basis field.
|
|
func (o *PricingComponent) SetBasis(v string) {
|
|
o.Basis = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PricingComponent) 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 *PricingComponent) 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 *PricingComponent) 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 *PricingComponent) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetNote returns the Note field value if set, zero value otherwise.
|
|
func (o *PricingComponent) GetNote() string {
|
|
if o == nil || IsNil(o.Note) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Note
|
|
}
|
|
|
|
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PricingComponent) GetNoteOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Note) {
|
|
return nil, false
|
|
}
|
|
return o.Note, true
|
|
}
|
|
|
|
// HasNote returns a boolean if a field has been set.
|
|
func (o *PricingComponent) HasNote() bool {
|
|
if o != nil && !IsNil(o.Note) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNote gets a reference to the given string and assigns it to the Note field.
|
|
func (o *PricingComponent) SetNote(v string) {
|
|
o.Note = &v
|
|
}
|
|
|
|
// GetQuoted returns the Quoted field value if set, zero value otherwise.
|
|
func (o *PricingComponent) GetQuoted() bool {
|
|
if o == nil || IsNil(o.Quoted) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Quoted
|
|
}
|
|
|
|
// GetQuotedOk returns a tuple with the Quoted field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PricingComponent) GetQuotedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Quoted) {
|
|
return nil, false
|
|
}
|
|
return o.Quoted, true
|
|
}
|
|
|
|
// HasQuoted returns a boolean if a field has been set.
|
|
func (o *PricingComponent) HasQuoted() bool {
|
|
if o != nil && !IsNil(o.Quoted) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQuoted gets a reference to the given bool and assigns it to the Quoted field.
|
|
func (o *PricingComponent) SetQuoted(v bool) {
|
|
o.Quoted = &v
|
|
}
|
|
|
|
// GetTiers returns the Tiers field value if set, zero value otherwise.
|
|
func (o *PricingComponent) GetTiers() []string {
|
|
if o == nil || IsNil(o.Tiers) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Tiers
|
|
}
|
|
|
|
// GetTiersOk returns a tuple with the Tiers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PricingComponent) GetTiersOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Tiers) {
|
|
return nil, false
|
|
}
|
|
return o.Tiers, true
|
|
}
|
|
|
|
// HasTiers returns a boolean if a field has been set.
|
|
func (o *PricingComponent) HasTiers() bool {
|
|
if o != nil && !IsNil(o.Tiers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTiers gets a reference to the given []string and assigns it to the Tiers field.
|
|
func (o *PricingComponent) SetTiers(v []string) {
|
|
o.Tiers = v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *PricingComponent) GetTitle() string {
|
|
if o == nil || IsNil(o.Title) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Title
|
|
}
|
|
|
|
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PricingComponent) GetTitleOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Title) {
|
|
return nil, false
|
|
}
|
|
return o.Title, true
|
|
}
|
|
|
|
// HasTitle returns a boolean if a field has been set.
|
|
func (o *PricingComponent) HasTitle() bool {
|
|
if o != nil && !IsNil(o.Title) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTitle gets a reference to the given string and assigns it to the Title field.
|
|
func (o *PricingComponent) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
func (o PricingComponent) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PricingComponent) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Basis) {
|
|
toSerialize["basis"] = o.Basis
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Note) {
|
|
toSerialize["note"] = o.Note
|
|
}
|
|
if !IsNil(o.Quoted) {
|
|
toSerialize["quoted"] = o.Quoted
|
|
}
|
|
if !IsNil(o.Tiers) {
|
|
toSerialize["tiers"] = o.Tiers
|
|
}
|
|
if !IsNil(o.Title) {
|
|
toSerialize["title"] = o.Title
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PricingComponent) UnmarshalJSON(data []byte) (err error) {
|
|
varPricingComponent := _PricingComponent{}
|
|
|
|
err = json.Unmarshal(data, &varPricingComponent)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PricingComponent(varPricingComponent)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "basis")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "note")
|
|
delete(additionalProperties, "quoted")
|
|
delete(additionalProperties, "tiers")
|
|
delete(additionalProperties, "title")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePricingComponent struct {
|
|
value *PricingComponent
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePricingComponent) Get() *PricingComponent {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePricingComponent) Set(val *PricingComponent) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePricingComponent) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePricingComponent) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePricingComponent(val *PricingComponent) *NullablePricingComponent {
|
|
return &NullablePricingComponent{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePricingComponent) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePricingComponent) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|