mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.5 KiB
Go
345 lines
9.5 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 BillingSubscriptionLine type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingSubscriptionLine{}
|
|
|
|
// BillingSubscriptionLine struct for BillingSubscriptionLine
|
|
type BillingSubscriptionLine struct {
|
|
// Name is the seat type's display name, e.g. \"Team Premium\".
|
|
Name *string `json:"name,omitempty"`
|
|
// PendingQuantity is the seats of it the next period opens at, when a change waits for the renewal that charges it; absent when none does.
|
|
PendingQuantity *int64 `json:"pendingQuantity,omitempty"`
|
|
// Plan is the seat type's catalog plan, e.g. \"team-premium\".
|
|
Plan *string `json:"plan,omitempty"`
|
|
// Price is one seat of it for the row's period, in cents.
|
|
Price *int64 `json:"price,omitempty"`
|
|
// Quantity is the seats of it the row holds.
|
|
Quantity *int64 `json:"quantity,omitempty"`
|
|
// Seats is the seats of it the period in hand was paid for; 0 when unpaid.
|
|
Seats *int64 `json:"seats,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingSubscriptionLine BillingSubscriptionLine
|
|
|
|
// NewBillingSubscriptionLine instantiates a new BillingSubscriptionLine 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 NewBillingSubscriptionLine() *BillingSubscriptionLine {
|
|
this := BillingSubscriptionLine{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingSubscriptionLineWithDefaults instantiates a new BillingSubscriptionLine 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 NewBillingSubscriptionLineWithDefaults() *BillingSubscriptionLine {
|
|
this := BillingSubscriptionLine{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) 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 *BillingSubscriptionLine) 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 *BillingSubscriptionLine) 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 *BillingSubscriptionLine) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPendingQuantity returns the PendingQuantity field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) GetPendingQuantity() int64 {
|
|
if o == nil || IsNil(o.PendingQuantity) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.PendingQuantity
|
|
}
|
|
|
|
// GetPendingQuantityOk returns a tuple with the PendingQuantity field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptionLine) GetPendingQuantityOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.PendingQuantity) {
|
|
return nil, false
|
|
}
|
|
return o.PendingQuantity, true
|
|
}
|
|
|
|
// HasPendingQuantity returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptionLine) HasPendingQuantity() bool {
|
|
if o != nil && !IsNil(o.PendingQuantity) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPendingQuantity gets a reference to the given int64 and assigns it to the PendingQuantity field.
|
|
func (o *BillingSubscriptionLine) SetPendingQuantity(v int64) {
|
|
o.PendingQuantity = &v
|
|
}
|
|
|
|
// GetPlan returns the Plan field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) GetPlan() string {
|
|
if o == nil || IsNil(o.Plan) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Plan
|
|
}
|
|
|
|
// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptionLine) GetPlanOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Plan) {
|
|
return nil, false
|
|
}
|
|
return o.Plan, true
|
|
}
|
|
|
|
// HasPlan returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptionLine) HasPlan() bool {
|
|
if o != nil && !IsNil(o.Plan) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPlan gets a reference to the given string and assigns it to the Plan field.
|
|
func (o *BillingSubscriptionLine) SetPlan(v string) {
|
|
o.Plan = &v
|
|
}
|
|
|
|
// GetPrice returns the Price field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) GetPrice() int64 {
|
|
if o == nil || IsNil(o.Price) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Price
|
|
}
|
|
|
|
// GetPriceOk returns a tuple with the Price field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptionLine) GetPriceOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Price) {
|
|
return nil, false
|
|
}
|
|
return o.Price, true
|
|
}
|
|
|
|
// HasPrice returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptionLine) HasPrice() bool {
|
|
if o != nil && !IsNil(o.Price) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPrice gets a reference to the given int64 and assigns it to the Price field.
|
|
func (o *BillingSubscriptionLine) SetPrice(v int64) {
|
|
o.Price = &v
|
|
}
|
|
|
|
// GetQuantity returns the Quantity field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) GetQuantity() int64 {
|
|
if o == nil || IsNil(o.Quantity) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Quantity
|
|
}
|
|
|
|
// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptionLine) GetQuantityOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Quantity) {
|
|
return nil, false
|
|
}
|
|
return o.Quantity, true
|
|
}
|
|
|
|
// HasQuantity returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptionLine) HasQuantity() bool {
|
|
if o != nil && !IsNil(o.Quantity) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQuantity gets a reference to the given int64 and assigns it to the Quantity field.
|
|
func (o *BillingSubscriptionLine) SetQuantity(v int64) {
|
|
o.Quantity = &v
|
|
}
|
|
|
|
// GetSeats returns the Seats field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptionLine) GetSeats() int64 {
|
|
if o == nil || IsNil(o.Seats) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Seats
|
|
}
|
|
|
|
// GetSeatsOk returns a tuple with the Seats field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptionLine) GetSeatsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Seats) {
|
|
return nil, false
|
|
}
|
|
return o.Seats, true
|
|
}
|
|
|
|
// HasSeats returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptionLine) HasSeats() bool {
|
|
if o != nil && !IsNil(o.Seats) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeats gets a reference to the given int64 and assigns it to the Seats field.
|
|
func (o *BillingSubscriptionLine) SetSeats(v int64) {
|
|
o.Seats = &v
|
|
}
|
|
|
|
func (o BillingSubscriptionLine) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingSubscriptionLine) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.PendingQuantity) {
|
|
toSerialize["pendingQuantity"] = o.PendingQuantity
|
|
}
|
|
if !IsNil(o.Plan) {
|
|
toSerialize["plan"] = o.Plan
|
|
}
|
|
if !IsNil(o.Price) {
|
|
toSerialize["price"] = o.Price
|
|
}
|
|
if !IsNil(o.Quantity) {
|
|
toSerialize["quantity"] = o.Quantity
|
|
}
|
|
if !IsNil(o.Seats) {
|
|
toSerialize["seats"] = o.Seats
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingSubscriptionLine) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingSubscriptionLine := _BillingSubscriptionLine{}
|
|
|
|
err = json.Unmarshal(data, &varBillingSubscriptionLine)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingSubscriptionLine(varBillingSubscriptionLine)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "pendingQuantity")
|
|
delete(additionalProperties, "plan")
|
|
delete(additionalProperties, "price")
|
|
delete(additionalProperties, "quantity")
|
|
delete(additionalProperties, "seats")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingSubscriptionLine struct {
|
|
value *BillingSubscriptionLine
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingSubscriptionLine) Get() *BillingSubscriptionLine {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptionLine) Set(val *BillingSubscriptionLine) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingSubscriptionLine) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptionLine) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingSubscriptionLine(val *BillingSubscriptionLine) *NullableBillingSubscriptionLine {
|
|
return &NullableBillingSubscriptionLine{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingSubscriptionLine) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptionLine) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|