mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
450 lines
12 KiB
Go
450 lines
12 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 BillingAlertSpec type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingAlertSpec{}
|
|
|
|
// BillingAlertSpec struct for BillingAlertSpec
|
|
type BillingAlertSpec struct {
|
|
Currency *string `json:"currency,omitempty"`
|
|
Enforce *bool `json:"enforce,omitempty"`
|
|
Project *string `json:"project,omitempty"`
|
|
RateLimitRpm *int64 `json:"rateLimitRpm,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SoftPct *int64 `json:"softPct,omitempty"`
|
|
Subject *string `json:"subject,omitempty"`
|
|
Threshold *int64 `json:"threshold,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingAlertSpec BillingAlertSpec
|
|
|
|
// NewBillingAlertSpec instantiates a new BillingAlertSpec 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 NewBillingAlertSpec() *BillingAlertSpec {
|
|
this := BillingAlertSpec{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingAlertSpecWithDefaults instantiates a new BillingAlertSpec 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 NewBillingAlertSpecWithDefaults() *BillingAlertSpec {
|
|
this := BillingAlertSpec{}
|
|
return &this
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetCurrency() string {
|
|
if o == nil || IsNil(o.Currency) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Currency
|
|
}
|
|
|
|
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetCurrencyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Currency) {
|
|
return nil, false
|
|
}
|
|
return o.Currency, true
|
|
}
|
|
|
|
// HasCurrency returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasCurrency() bool {
|
|
if o != nil && !IsNil(o.Currency) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
|
func (o *BillingAlertSpec) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetEnforce returns the Enforce field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetEnforce() bool {
|
|
if o == nil || IsNil(o.Enforce) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Enforce
|
|
}
|
|
|
|
// GetEnforceOk returns a tuple with the Enforce field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetEnforceOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Enforce) {
|
|
return nil, false
|
|
}
|
|
return o.Enforce, true
|
|
}
|
|
|
|
// HasEnforce returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasEnforce() bool {
|
|
if o != nil && !IsNil(o.Enforce) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnforce gets a reference to the given bool and assigns it to the Enforce field.
|
|
func (o *BillingAlertSpec) SetEnforce(v bool) {
|
|
o.Enforce = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetProject() string {
|
|
if o == nil || IsNil(o.Project) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Project
|
|
}
|
|
|
|
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetProjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Project) {
|
|
return nil, false
|
|
}
|
|
return o.Project, true
|
|
}
|
|
|
|
// HasProject returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasProject() bool {
|
|
if o != nil && !IsNil(o.Project) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProject gets a reference to the given string and assigns it to the Project field.
|
|
func (o *BillingAlertSpec) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetRateLimitRpm returns the RateLimitRpm field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetRateLimitRpm() int64 {
|
|
if o == nil || IsNil(o.RateLimitRpm) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.RateLimitRpm
|
|
}
|
|
|
|
// GetRateLimitRpmOk returns a tuple with the RateLimitRpm field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetRateLimitRpmOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.RateLimitRpm) {
|
|
return nil, false
|
|
}
|
|
return o.RateLimitRpm, true
|
|
}
|
|
|
|
// HasRateLimitRpm returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasRateLimitRpm() bool {
|
|
if o != nil && !IsNil(o.RateLimitRpm) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRateLimitRpm gets a reference to the given int64 and assigns it to the RateLimitRpm field.
|
|
func (o *BillingAlertSpec) SetRateLimitRpm(v int64) {
|
|
o.RateLimitRpm = &v
|
|
}
|
|
|
|
// GetService returns the Service field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetService() string {
|
|
if o == nil || IsNil(o.Service) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Service
|
|
}
|
|
|
|
// GetServiceOk returns a tuple with the Service field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetServiceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Service) {
|
|
return nil, false
|
|
}
|
|
return o.Service, true
|
|
}
|
|
|
|
// HasService returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasService() bool {
|
|
if o != nil && !IsNil(o.Service) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetService gets a reference to the given string and assigns it to the Service field.
|
|
func (o *BillingAlertSpec) SetService(v string) {
|
|
o.Service = &v
|
|
}
|
|
|
|
// GetSoftPct returns the SoftPct field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetSoftPct() int64 {
|
|
if o == nil || IsNil(o.SoftPct) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.SoftPct
|
|
}
|
|
|
|
// GetSoftPctOk returns a tuple with the SoftPct field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetSoftPctOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.SoftPct) {
|
|
return nil, false
|
|
}
|
|
return o.SoftPct, true
|
|
}
|
|
|
|
// HasSoftPct returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasSoftPct() bool {
|
|
if o != nil && !IsNil(o.SoftPct) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSoftPct gets a reference to the given int64 and assigns it to the SoftPct field.
|
|
func (o *BillingAlertSpec) SetSoftPct(v int64) {
|
|
o.SoftPct = &v
|
|
}
|
|
|
|
// GetSubject returns the Subject field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetSubject() string {
|
|
if o == nil || IsNil(o.Subject) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Subject
|
|
}
|
|
|
|
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetSubjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Subject) {
|
|
return nil, false
|
|
}
|
|
return o.Subject, true
|
|
}
|
|
|
|
// HasSubject returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasSubject() bool {
|
|
if o != nil && !IsNil(o.Subject) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubject gets a reference to the given string and assigns it to the Subject field.
|
|
func (o *BillingAlertSpec) SetSubject(v string) {
|
|
o.Subject = &v
|
|
}
|
|
|
|
// GetThreshold returns the Threshold field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) GetThreshold() int64 {
|
|
if o == nil || IsNil(o.Threshold) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Threshold
|
|
}
|
|
|
|
// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlertSpec) GetThresholdOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Threshold) {
|
|
return nil, false
|
|
}
|
|
return o.Threshold, true
|
|
}
|
|
|
|
// HasThreshold returns a boolean if a field has been set.
|
|
func (o *BillingAlertSpec) HasThreshold() bool {
|
|
if o != nil && !IsNil(o.Threshold) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetThreshold gets a reference to the given int64 and assigns it to the Threshold field.
|
|
func (o *BillingAlertSpec) SetThreshold(v int64) {
|
|
o.Threshold = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *BillingAlertSpec) 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 *BillingAlertSpec) 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 *BillingAlertSpec) 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 *BillingAlertSpec) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
func (o BillingAlertSpec) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingAlertSpec) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.Enforce) {
|
|
toSerialize["enforce"] = o.Enforce
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
if !IsNil(o.RateLimitRpm) {
|
|
toSerialize["rateLimitRpm"] = o.RateLimitRpm
|
|
}
|
|
if !IsNil(o.Service) {
|
|
toSerialize["service"] = o.Service
|
|
}
|
|
if !IsNil(o.SoftPct) {
|
|
toSerialize["softPct"] = o.SoftPct
|
|
}
|
|
if !IsNil(o.Subject) {
|
|
toSerialize["subject"] = o.Subject
|
|
}
|
|
if !IsNil(o.Threshold) {
|
|
toSerialize["threshold"] = o.Threshold
|
|
}
|
|
if !IsNil(o.Title) {
|
|
toSerialize["title"] = o.Title
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingAlertSpec) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingAlertSpec := _BillingAlertSpec{}
|
|
|
|
err = json.Unmarshal(data, &varBillingAlertSpec)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingAlertSpec(varBillingAlertSpec)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "enforce")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "rateLimitRpm")
|
|
delete(additionalProperties, "service")
|
|
delete(additionalProperties, "softPct")
|
|
delete(additionalProperties, "subject")
|
|
delete(additionalProperties, "threshold")
|
|
delete(additionalProperties, "title")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingAlertSpec struct {
|
|
value *BillingAlertSpec
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingAlertSpec) Get() *BillingAlertSpec {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingAlertSpec) Set(val *BillingAlertSpec) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingAlertSpec) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingAlertSpec) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingAlertSpec(val *BillingAlertSpec) *NullableBillingAlertSpec {
|
|
return &NullableBillingAlertSpec{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingAlertSpec) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingAlertSpec) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|