Files
sdk/model_pricing_rate.go

345 lines
8.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 PricingRate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PricingRate{}
// PricingRate struct for PricingRate
type PricingRate struct {
// Component is which of the four this line bills under.
Component *string `json:"component,omitempty"`
// Name addresses the rate.
Name *string `json:"name,omitempty"`
// Note is what the line covers.
Note *string `json:"note,omitempty"`
// Per names one unit, so a reader never has to guess what the number is per.
Per *string `json:"per,omitempty"`
// Micros is the price of ONE unit, in micro-USD. It is the number the ledger books, resolved through the same authority the metering path reads.
RateMicroUsd *int64 `json:"rate_micro_usd,omitempty"`
// Title is how the line reads on a price list.
Title *string `json:"title,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PricingRate PricingRate
// NewPricingRate instantiates a new PricingRate 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 NewPricingRate() *PricingRate {
this := PricingRate{}
return &this
}
// NewPricingRateWithDefaults instantiates a new PricingRate 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 NewPricingRateWithDefaults() *PricingRate {
this := PricingRate{}
return &this
}
// GetComponent returns the Component field value if set, zero value otherwise.
func (o *PricingRate) GetComponent() string {
if o == nil || IsNil(o.Component) {
var ret string
return ret
}
return *o.Component
}
// GetComponentOk returns a tuple with the Component field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PricingRate) GetComponentOk() (*string, bool) {
if o == nil || IsNil(o.Component) {
return nil, false
}
return o.Component, true
}
// HasComponent returns a boolean if a field has been set.
func (o *PricingRate) HasComponent() bool {
if o != nil && !IsNil(o.Component) {
return true
}
return false
}
// SetComponent gets a reference to the given string and assigns it to the Component field.
func (o *PricingRate) SetComponent(v string) {
o.Component = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *PricingRate) 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 *PricingRate) 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 *PricingRate) 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 *PricingRate) SetName(v string) {
o.Name = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *PricingRate) 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 *PricingRate) 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 *PricingRate) 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 *PricingRate) SetNote(v string) {
o.Note = &v
}
// GetPer returns the Per field value if set, zero value otherwise.
func (o *PricingRate) GetPer() string {
if o == nil || IsNil(o.Per) {
var ret string
return ret
}
return *o.Per
}
// GetPerOk returns a tuple with the Per field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PricingRate) GetPerOk() (*string, bool) {
if o == nil || IsNil(o.Per) {
return nil, false
}
return o.Per, true
}
// HasPer returns a boolean if a field has been set.
func (o *PricingRate) HasPer() bool {
if o != nil && !IsNil(o.Per) {
return true
}
return false
}
// SetPer gets a reference to the given string and assigns it to the Per field.
func (o *PricingRate) SetPer(v string) {
o.Per = &v
}
// GetRateMicroUsd returns the RateMicroUsd field value if set, zero value otherwise.
func (o *PricingRate) GetRateMicroUsd() int64 {
if o == nil || IsNil(o.RateMicroUsd) {
var ret int64
return ret
}
return *o.RateMicroUsd
}
// GetRateMicroUsdOk returns a tuple with the RateMicroUsd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PricingRate) GetRateMicroUsdOk() (*int64, bool) {
if o == nil || IsNil(o.RateMicroUsd) {
return nil, false
}
return o.RateMicroUsd, true
}
// HasRateMicroUsd returns a boolean if a field has been set.
func (o *PricingRate) HasRateMicroUsd() bool {
if o != nil && !IsNil(o.RateMicroUsd) {
return true
}
return false
}
// SetRateMicroUsd gets a reference to the given int64 and assigns it to the RateMicroUsd field.
func (o *PricingRate) SetRateMicroUsd(v int64) {
o.RateMicroUsd = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *PricingRate) 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 *PricingRate) 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 *PricingRate) 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 *PricingRate) SetTitle(v string) {
o.Title = &v
}
func (o PricingRate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PricingRate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Component) {
toSerialize["component"] = o.Component
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Note) {
toSerialize["note"] = o.Note
}
if !IsNil(o.Per) {
toSerialize["per"] = o.Per
}
if !IsNil(o.RateMicroUsd) {
toSerialize["rate_micro_usd"] = o.RateMicroUsd
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PricingRate) UnmarshalJSON(data []byte) (err error) {
varPricingRate := _PricingRate{}
err = json.Unmarshal(data, &varPricingRate)
if err != nil {
return err
}
*o = PricingRate(varPricingRate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "component")
delete(additionalProperties, "name")
delete(additionalProperties, "note")
delete(additionalProperties, "per")
delete(additionalProperties, "rate_micro_usd")
delete(additionalProperties, "title")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePricingRate struct {
value *PricingRate
isSet bool
}
func (v NullablePricingRate) Get() *PricingRate {
return v.value
}
func (v *NullablePricingRate) Set(val *PricingRate) {
v.value = val
v.isSet = true
}
func (v NullablePricingRate) IsSet() bool {
return v.isSet
}
func (v *NullablePricingRate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePricingRate(val *PricingRate) *NullablePricingRate {
return &NullablePricingRate{value: val, isSet: true}
}
func (v NullablePricingRate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePricingRate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}