Files
sdk/model_billing_subscription_plan.go

345 lines
9.4 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 BillingSubscriptionPlan type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingSubscriptionPlan{}
// BillingSubscriptionPlan struct for BillingSubscriptionPlan
type BillingSubscriptionPlan struct {
// Currency is the ISO code the price is in, lower-cased.
Currency *string `json:"currency,omitempty"`
// ID is the plan row the subscription was opened on.
Id *string `json:"id,omitempty"`
// Interval is the billing period: \"month\" or \"year\".
Interval *string `json:"interval,omitempty"`
// Name is the plan's display name, e.g. \"Max 20x\".
Name *string `json:"name,omitempty"`
// Price is what one period costs per seat, in cents, as the subscription snapshotted it: a later catalog price change does not move it.
Price *int64 `json:"price,omitempty"`
// Slug is the catalog plan it was opened on, e.g. \"max-20x\": what a reader matches against GET /v1/billing/plans. Empty on a row that predates it.
Slug *string `json:"slug,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingSubscriptionPlan BillingSubscriptionPlan
// NewBillingSubscriptionPlan instantiates a new BillingSubscriptionPlan 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 NewBillingSubscriptionPlan() *BillingSubscriptionPlan {
this := BillingSubscriptionPlan{}
return &this
}
// NewBillingSubscriptionPlanWithDefaults instantiates a new BillingSubscriptionPlan 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 NewBillingSubscriptionPlanWithDefaults() *BillingSubscriptionPlan {
this := BillingSubscriptionPlan{}
return &this
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) SetCurrency(v string) {
o.Currency = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) SetId(v string) {
o.Id = &v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) GetInterval() string {
if o == nil || IsNil(o.Interval) {
var ret string
return ret
}
return *o.Interval
}
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscriptionPlan) GetIntervalOk() (*string, bool) {
if o == nil || IsNil(o.Interval) {
return nil, false
}
return o.Interval, true
}
// HasInterval returns a boolean if a field has been set.
func (o *BillingSubscriptionPlan) HasInterval() bool {
if o != nil && !IsNil(o.Interval) {
return true
}
return false
}
// SetInterval gets a reference to the given string and assigns it to the Interval field.
func (o *BillingSubscriptionPlan) SetInterval(v string) {
o.Interval = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) SetName(v string) {
o.Name = &v
}
// GetPrice returns the Price field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) 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 *BillingSubscriptionPlan) SetPrice(v int64) {
o.Price = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *BillingSubscriptionPlan) GetSlug() string {
if o == nil || IsNil(o.Slug) {
var ret string
return ret
}
return *o.Slug
}
// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscriptionPlan) GetSlugOk() (*string, bool) {
if o == nil || IsNil(o.Slug) {
return nil, false
}
return o.Slug, true
}
// HasSlug returns a boolean if a field has been set.
func (o *BillingSubscriptionPlan) HasSlug() bool {
if o != nil && !IsNil(o.Slug) {
return true
}
return false
}
// SetSlug gets a reference to the given string and assigns it to the Slug field.
func (o *BillingSubscriptionPlan) SetSlug(v string) {
o.Slug = &v
}
func (o BillingSubscriptionPlan) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingSubscriptionPlan) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Price) {
toSerialize["price"] = o.Price
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingSubscriptionPlan) UnmarshalJSON(data []byte) (err error) {
varBillingSubscriptionPlan := _BillingSubscriptionPlan{}
err = json.Unmarshal(data, &varBillingSubscriptionPlan)
if err != nil {
return err
}
*o = BillingSubscriptionPlan(varBillingSubscriptionPlan)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "currency")
delete(additionalProperties, "id")
delete(additionalProperties, "interval")
delete(additionalProperties, "name")
delete(additionalProperties, "price")
delete(additionalProperties, "slug")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingSubscriptionPlan struct {
value *BillingSubscriptionPlan
isSet bool
}
func (v NullableBillingSubscriptionPlan) Get() *BillingSubscriptionPlan {
return v.value
}
func (v *NullableBillingSubscriptionPlan) Set(val *BillingSubscriptionPlan) {
v.value = val
v.isSet = true
}
func (v NullableBillingSubscriptionPlan) IsSet() bool {
return v.isSet
}
func (v *NullableBillingSubscriptionPlan) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingSubscriptionPlan(val *BillingSubscriptionPlan) *NullableBillingSubscriptionPlan {
return &NullableBillingSubscriptionPlan{value: val, isSet: true}
}
func (v NullableBillingSubscriptionPlan) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingSubscriptionPlan) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}