Files
sdk/model_billing_alert_patch.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 BillingAlertPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingAlertPatch{}
// BillingAlertPatch struct for BillingAlertPatch
type BillingAlertPatch struct {
Enforce *bool `json:"enforce,omitempty"`
Id *string `json:"id,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 _BillingAlertPatch BillingAlertPatch
// NewBillingAlertPatch instantiates a new BillingAlertPatch 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 NewBillingAlertPatch() *BillingAlertPatch {
this := BillingAlertPatch{}
return &this
}
// NewBillingAlertPatchWithDefaults instantiates a new BillingAlertPatch 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 NewBillingAlertPatchWithDefaults() *BillingAlertPatch {
this := BillingAlertPatch{}
return &this
}
// GetEnforce returns the Enforce field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetEnforce(v bool) {
o.Enforce = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BillingAlertPatch) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingAlertPatch) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *BillingAlertPatch) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *BillingAlertPatch) SetId(v string) {
o.Id = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetProject(v string) {
o.Project = &v
}
// GetRateLimitRpm returns the RateLimitRpm field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetRateLimitRpm(v int64) {
o.RateLimitRpm = &v
}
// GetService returns the Service field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetService(v string) {
o.Service = &v
}
// GetSoftPct returns the SoftPct field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetSoftPct(v int64) {
o.SoftPct = &v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetSubject(v string) {
o.Subject = &v
}
// GetThreshold returns the Threshold field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetThreshold(v int64) {
o.Threshold = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) 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 *BillingAlertPatch) SetTitle(v string) {
o.Title = &v
}
func (o BillingAlertPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingAlertPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enforce) {
toSerialize["enforce"] = o.Enforce
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
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 *BillingAlertPatch) UnmarshalJSON(data []byte) (err error) {
varBillingAlertPatch := _BillingAlertPatch{}
err = json.Unmarshal(data, &varBillingAlertPatch)
if err != nil {
return err
}
*o = BillingAlertPatch(varBillingAlertPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enforce")
delete(additionalProperties, "id")
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 NullableBillingAlertPatch struct {
value *BillingAlertPatch
isSet bool
}
func (v NullableBillingAlertPatch) Get() *BillingAlertPatch {
return v.value
}
func (v *NullableBillingAlertPatch) Set(val *BillingAlertPatch) {
v.value = val
v.isSet = true
}
func (v NullableBillingAlertPatch) IsSet() bool {
return v.isSet
}
func (v *NullableBillingAlertPatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingAlertPatch(val *BillingAlertPatch) *NullableBillingAlertPatch {
return &NullableBillingAlertPatch{value: val, isSet: true}
}
func (v NullableBillingAlertPatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingAlertPatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}