mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
783 lines
20 KiB
Go
783 lines
20 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 BillingAlert type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingAlert{}
|
|
|
|
// BillingAlert struct for BillingAlert
|
|
type BillingAlert struct {
|
|
CreatedAt *string `json:"createdAt,omitempty"`
|
|
Currency *string `json:"currency,omitempty"`
|
|
Enforce *bool `json:"enforce,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Over *bool `json:"over,omitempty"`
|
|
Period *string `json:"period,omitempty"`
|
|
PeriodSpentCents *int64 `json:"periodSpentCents,omitempty"`
|
|
Project *string `json:"project,omitempty"`
|
|
RateLimitRpm *int64 `json:"rateLimitRpm,omitempty"`
|
|
ResetsAt *string `json:"resetsAt,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SoftPct *int64 `json:"softPct,omitempty"`
|
|
Threshold *int64 `json:"threshold,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
TriggeredAt *string `json:"triggeredAt,omitempty"`
|
|
UpdatedAt *string `json:"updatedAt,omitempty"`
|
|
UserId *string `json:"userId,omitempty"`
|
|
Warn *bool `json:"warn,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingAlert BillingAlert
|
|
|
|
// NewBillingAlert instantiates a new BillingAlert 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 NewBillingAlert() *BillingAlert {
|
|
this := BillingAlert{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingAlertWithDefaults instantiates a new BillingAlert 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 NewBillingAlertWithDefaults() *BillingAlert {
|
|
this := BillingAlert{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetCreatedAt() string {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
|
|
func (o *BillingAlert) SetCreatedAt(v string) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetEnforce returns the Enforce field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetEnforce(v bool) {
|
|
o.Enforce = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetOver returns the Over field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetOver() bool {
|
|
if o == nil || IsNil(o.Over) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Over
|
|
}
|
|
|
|
// GetOverOk returns a tuple with the Over field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetOverOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Over) {
|
|
return nil, false
|
|
}
|
|
return o.Over, true
|
|
}
|
|
|
|
// HasOver returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasOver() bool {
|
|
if o != nil && !IsNil(o.Over) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOver gets a reference to the given bool and assigns it to the Over field.
|
|
func (o *BillingAlert) SetOver(v bool) {
|
|
o.Over = &v
|
|
}
|
|
|
|
// GetPeriod returns the Period field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetPeriod() string {
|
|
if o == nil || IsNil(o.Period) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Period
|
|
}
|
|
|
|
// GetPeriodOk returns a tuple with the Period field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetPeriodOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Period) {
|
|
return nil, false
|
|
}
|
|
return o.Period, true
|
|
}
|
|
|
|
// HasPeriod returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasPeriod() bool {
|
|
if o != nil && !IsNil(o.Period) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPeriod gets a reference to the given string and assigns it to the Period field.
|
|
func (o *BillingAlert) SetPeriod(v string) {
|
|
o.Period = &v
|
|
}
|
|
|
|
// GetPeriodSpentCents returns the PeriodSpentCents field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetPeriodSpentCents() int64 {
|
|
if o == nil || IsNil(o.PeriodSpentCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.PeriodSpentCents
|
|
}
|
|
|
|
// GetPeriodSpentCentsOk returns a tuple with the PeriodSpentCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetPeriodSpentCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.PeriodSpentCents) {
|
|
return nil, false
|
|
}
|
|
return o.PeriodSpentCents, true
|
|
}
|
|
|
|
// HasPeriodSpentCents returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasPeriodSpentCents() bool {
|
|
if o != nil && !IsNil(o.PeriodSpentCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPeriodSpentCents gets a reference to the given int64 and assigns it to the PeriodSpentCents field.
|
|
func (o *BillingAlert) SetPeriodSpentCents(v int64) {
|
|
o.PeriodSpentCents = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetRateLimitRpm returns the RateLimitRpm field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetRateLimitRpm(v int64) {
|
|
o.RateLimitRpm = &v
|
|
}
|
|
|
|
// GetResetsAt returns the ResetsAt field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetResetsAt() string {
|
|
if o == nil || IsNil(o.ResetsAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ResetsAt
|
|
}
|
|
|
|
// GetResetsAtOk returns a tuple with the ResetsAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetResetsAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ResetsAt) {
|
|
return nil, false
|
|
}
|
|
return o.ResetsAt, true
|
|
}
|
|
|
|
// HasResetsAt returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasResetsAt() bool {
|
|
if o != nil && !IsNil(o.ResetsAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResetsAt gets a reference to the given string and assigns it to the ResetsAt field.
|
|
func (o *BillingAlert) SetResetsAt(v string) {
|
|
o.ResetsAt = &v
|
|
}
|
|
|
|
// GetService returns the Service field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetService(v string) {
|
|
o.Service = &v
|
|
}
|
|
|
|
// GetSoftPct returns the SoftPct field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetSoftPct(v int64) {
|
|
o.SoftPct = &v
|
|
}
|
|
|
|
// GetThreshold returns the Threshold field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetThreshold(v int64) {
|
|
o.Threshold = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) 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 *BillingAlert) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetTriggeredAt() string {
|
|
if o == nil || IsNil(o.TriggeredAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TriggeredAt
|
|
}
|
|
|
|
// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetTriggeredAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TriggeredAt) {
|
|
return nil, false
|
|
}
|
|
return o.TriggeredAt, true
|
|
}
|
|
|
|
// HasTriggeredAt returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasTriggeredAt() bool {
|
|
if o != nil && !IsNil(o.TriggeredAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field.
|
|
func (o *BillingAlert) SetTriggeredAt(v string) {
|
|
o.TriggeredAt = &v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetUpdatedAt() string {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UpdatedAt
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetUpdatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.UpdatedAt, true
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasUpdatedAt() bool {
|
|
if o != nil && !IsNil(o.UpdatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
|
|
func (o *BillingAlert) SetUpdatedAt(v string) {
|
|
o.UpdatedAt = &v
|
|
}
|
|
|
|
// GetUserId returns the UserId field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetUserId() string {
|
|
if o == nil || IsNil(o.UserId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UserId
|
|
}
|
|
|
|
// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetUserIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UserId) {
|
|
return nil, false
|
|
}
|
|
return o.UserId, true
|
|
}
|
|
|
|
// HasUserId returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasUserId() bool {
|
|
if o != nil && !IsNil(o.UserId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserId gets a reference to the given string and assigns it to the UserId field.
|
|
func (o *BillingAlert) SetUserId(v string) {
|
|
o.UserId = &v
|
|
}
|
|
|
|
// GetWarn returns the Warn field value if set, zero value otherwise.
|
|
func (o *BillingAlert) GetWarn() bool {
|
|
if o == nil || IsNil(o.Warn) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Warn
|
|
}
|
|
|
|
// GetWarnOk returns a tuple with the Warn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingAlert) GetWarnOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Warn) {
|
|
return nil, false
|
|
}
|
|
return o.Warn, true
|
|
}
|
|
|
|
// HasWarn returns a boolean if a field has been set.
|
|
func (o *BillingAlert) HasWarn() bool {
|
|
if o != nil && !IsNil(o.Warn) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWarn gets a reference to the given bool and assigns it to the Warn field.
|
|
func (o *BillingAlert) SetWarn(v bool) {
|
|
o.Warn = &v
|
|
}
|
|
|
|
func (o BillingAlert) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingAlert) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.Enforce) {
|
|
toSerialize["enforce"] = o.Enforce
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Over) {
|
|
toSerialize["over"] = o.Over
|
|
}
|
|
if !IsNil(o.Period) {
|
|
toSerialize["period"] = o.Period
|
|
}
|
|
if !IsNil(o.PeriodSpentCents) {
|
|
toSerialize["periodSpentCents"] = o.PeriodSpentCents
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
if !IsNil(o.RateLimitRpm) {
|
|
toSerialize["rateLimitRpm"] = o.RateLimitRpm
|
|
}
|
|
if !IsNil(o.ResetsAt) {
|
|
toSerialize["resetsAt"] = o.ResetsAt
|
|
}
|
|
if !IsNil(o.Service) {
|
|
toSerialize["service"] = o.Service
|
|
}
|
|
if !IsNil(o.SoftPct) {
|
|
toSerialize["softPct"] = o.SoftPct
|
|
}
|
|
if !IsNil(o.Threshold) {
|
|
toSerialize["threshold"] = o.Threshold
|
|
}
|
|
if !IsNil(o.Title) {
|
|
toSerialize["title"] = o.Title
|
|
}
|
|
if !IsNil(o.TriggeredAt) {
|
|
toSerialize["triggeredAt"] = o.TriggeredAt
|
|
}
|
|
if !IsNil(o.UpdatedAt) {
|
|
toSerialize["updatedAt"] = o.UpdatedAt
|
|
}
|
|
if !IsNil(o.UserId) {
|
|
toSerialize["userId"] = o.UserId
|
|
}
|
|
if !IsNil(o.Warn) {
|
|
toSerialize["warn"] = o.Warn
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingAlert) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingAlert := _BillingAlert{}
|
|
|
|
err = json.Unmarshal(data, &varBillingAlert)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingAlert(varBillingAlert)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "enforce")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "over")
|
|
delete(additionalProperties, "period")
|
|
delete(additionalProperties, "periodSpentCents")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "rateLimitRpm")
|
|
delete(additionalProperties, "resetsAt")
|
|
delete(additionalProperties, "service")
|
|
delete(additionalProperties, "softPct")
|
|
delete(additionalProperties, "threshold")
|
|
delete(additionalProperties, "title")
|
|
delete(additionalProperties, "triggeredAt")
|
|
delete(additionalProperties, "updatedAt")
|
|
delete(additionalProperties, "userId")
|
|
delete(additionalProperties, "warn")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingAlert struct {
|
|
value *BillingAlert
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingAlert) Get() *BillingAlert {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingAlert) Set(val *BillingAlert) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingAlert) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingAlert) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingAlert(val *BillingAlert) *NullableBillingAlert {
|
|
return &NullableBillingAlert{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingAlert) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingAlert) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|