Files
sdk/model_billing_subscription.go

1181 lines
35 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 BillingSubscription type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingSubscription{}
// BillingSubscription struct for BillingSubscription
type BillingSubscription struct {
// Assigned is which member holds which seat type, as the org's admin set it.
Assigned []BillingSubscriptionSeat `json:"assigned,omitempty"`
// CancelAtPeriodEnd reports that the plan ends at CurrentPeriodEnd.
CancelAtPeriodEnd *bool `json:"cancelAtPeriodEnd,omitempty"`
// CanceledAt is when it was canceled; absent when it was not.
CanceledAt *string `json:"canceledAt,omitempty"`
// ChargedCents is what the period in hand was actually paid, after any discount and net of refunds. 0 when the period is unpaid.
ChargedCents *int64 `json:"chargedCents,omitempty"`
// Coupon is the plan coupon code the first period was bought with, as commerce stores it (upper case); absent when none was.
Coupon *string `json:"coupon,omitempty"`
// CreatedAt is when the row was written, RFC 3339.
CreatedAt *string `json:"createdAt,omitempty"`
// CurrentPeriodEnd is when it ends, RFC 3339. The plan is paid through it.
CurrentPeriodEnd *string `json:"currentPeriodEnd,omitempty"`
// CurrentPeriodStart is when the period in hand began, RFC 3339.
CurrentPeriodStart *string `json:"currentPeriodStart,omitempty"`
// CustomerCents is the price staff agreed this subscriber pays for one seat each period, below the plan's list price; absent when none was. Every invoice bills the plan at list and the difference as the customer's discount. After LastPaid, for the ZAP wire.
CustomerCents *int64 `json:"customerCents,omitempty"`
// DefaultPaymentMethod is the saved method a renewal would use. Empty means there is none, so nothing can charge the plan.
DefaultPaymentMethod *string `json:"defaultPaymentMethod,omitempty"`
// EndedAt is when it ended; absent while it runs.
EndedAt *string `json:"endedAt,omitempty"`
// Held reports that this row is the subject's one paid plan: while it stands, commerce refuses a second paid sale (409).
Held *bool `json:"held,omitempty"`
// ID is the subscription's own id, the one cancel and reactivate take.
Id *string `json:"id,omitempty"`
// LastPaid is when the latest payment for this subscription arrived, RFC 3339: its latest paid invoice's paid time, or, for a period recorded as collected outside commerce, which keeps no time of its own record, the start of the latest period recorded — whichever is later. Any period, not only the one in hand: a plan past due still says when it was last paid. Empty when nothing was, or when the invoices did not read. Last, so every field before it keeps its place on the ZAP wire.
LastPaid *string `json:"lastPaid,omitempty"`
// Lines are a team's other seat types beside Plan (a team of standard and premium seats is Plan \"team\" and one line of \"team-premium\"), each with the seats of it the period in hand was paid for. Seats above counts them too. After Held, so the fields before them keep their places on the ZAP wire.
Lines []BillingSubscriptionLine `json:"lines,omitempty"`
// MRRCents is what this subscription contributes per month — commerce's own figure, interval-normalized and multiplied by its seats, so no reader re-derives it from price and interval.
MrrCents *int64 `json:"mrrCents,omitempty"`
// Plan is the plan as this subscription snapshotted it.
Plan *BillingSubscriptionPlan `json:"plan,omitempty"`
// PlanID is the plan slug, e.g. \"max-20x\".
PlanId *string `json:"planId,omitempty"`
// ProviderType is who collects it: a processor (\"square\"), \"credit\" for a plan bought with credits, \"internal\" or \"bundle\" for a row nobody paid for.
ProviderType *string `json:"providerType,omitempty"`
// Quantity is the seat count; a flat plan holds 1.
Quantity *int64 `json:"quantity,omitempty"`
// Seats is the seat count the period in hand was paid for — its paid invoice's quantity, or the quantity recorded with an external period — never the row's live Quantity, which the holder may change. 0 when the period is unpaid.
Seats *int64 `json:"seats,omitempty"`
// Settled is how the period in hand was paid: \"card\" (a card paid all of it), \"external:<processor>\" (a payment recorded as collected outside commerce), \"balance\", \"credit\" or \"mixed\" (prepaid money). Empty when unpaid or unknown.
Settled *string `json:"settled,omitempty"`
// Status is trialing, active, past_due, canceled or unpaid. Only active and trialing confer the plan.
Status *string `json:"status,omitempty"`
// Test marks a sandbox subscription: sold while its org was in test mode, paid with sandbox money. It is listed and never revenue.
Test *bool `json:"test,omitempty"`
// TrialEnd is when that trial ends; absent when there was none.
TrialEnd *string `json:"trialEnd,omitempty"`
// TrialStart is when a trial began; absent when there was none.
TrialStart *string `json:"trialStart,omitempty"`
// UpdatedAt is when the row last changed, RFC 3339.
UpdatedAt *string `json:"updatedAt,omitempty"`
// UserID is the billing account that holds it: the org slug for an org's own plan, \"<org>/<name>\" for a member's.
UserId *string `json:"userId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingSubscription BillingSubscription
// NewBillingSubscription instantiates a new BillingSubscription 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 NewBillingSubscription() *BillingSubscription {
this := BillingSubscription{}
return &this
}
// NewBillingSubscriptionWithDefaults instantiates a new BillingSubscription 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 NewBillingSubscriptionWithDefaults() *BillingSubscription {
this := BillingSubscription{}
return &this
}
// GetAssigned returns the Assigned field value if set, zero value otherwise.
func (o *BillingSubscription) GetAssigned() []BillingSubscriptionSeat {
if o == nil || IsNil(o.Assigned) {
var ret []BillingSubscriptionSeat
return ret
}
return o.Assigned
}
// GetAssignedOk returns a tuple with the Assigned field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetAssignedOk() ([]BillingSubscriptionSeat, bool) {
if o == nil || IsNil(o.Assigned) {
return nil, false
}
return o.Assigned, true
}
// HasAssigned returns a boolean if a field has been set.
func (o *BillingSubscription) HasAssigned() bool {
if o != nil && !IsNil(o.Assigned) {
return true
}
return false
}
// SetAssigned gets a reference to the given []BillingSubscriptionSeat and assigns it to the Assigned field.
func (o *BillingSubscription) SetAssigned(v []BillingSubscriptionSeat) {
o.Assigned = v
}
// GetCancelAtPeriodEnd returns the CancelAtPeriodEnd field value if set, zero value otherwise.
func (o *BillingSubscription) GetCancelAtPeriodEnd() bool {
if o == nil || IsNil(o.CancelAtPeriodEnd) {
var ret bool
return ret
}
return *o.CancelAtPeriodEnd
}
// GetCancelAtPeriodEndOk returns a tuple with the CancelAtPeriodEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCancelAtPeriodEndOk() (*bool, bool) {
if o == nil || IsNil(o.CancelAtPeriodEnd) {
return nil, false
}
return o.CancelAtPeriodEnd, true
}
// HasCancelAtPeriodEnd returns a boolean if a field has been set.
func (o *BillingSubscription) HasCancelAtPeriodEnd() bool {
if o != nil && !IsNil(o.CancelAtPeriodEnd) {
return true
}
return false
}
// SetCancelAtPeriodEnd gets a reference to the given bool and assigns it to the CancelAtPeriodEnd field.
func (o *BillingSubscription) SetCancelAtPeriodEnd(v bool) {
o.CancelAtPeriodEnd = &v
}
// GetCanceledAt returns the CanceledAt field value if set, zero value otherwise.
func (o *BillingSubscription) GetCanceledAt() string {
if o == nil || IsNil(o.CanceledAt) {
var ret string
return ret
}
return *o.CanceledAt
}
// GetCanceledAtOk returns a tuple with the CanceledAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCanceledAtOk() (*string, bool) {
if o == nil || IsNil(o.CanceledAt) {
return nil, false
}
return o.CanceledAt, true
}
// HasCanceledAt returns a boolean if a field has been set.
func (o *BillingSubscription) HasCanceledAt() bool {
if o != nil && !IsNil(o.CanceledAt) {
return true
}
return false
}
// SetCanceledAt gets a reference to the given string and assigns it to the CanceledAt field.
func (o *BillingSubscription) SetCanceledAt(v string) {
o.CanceledAt = &v
}
// GetChargedCents returns the ChargedCents field value if set, zero value otherwise.
func (o *BillingSubscription) GetChargedCents() int64 {
if o == nil || IsNil(o.ChargedCents) {
var ret int64
return ret
}
return *o.ChargedCents
}
// GetChargedCentsOk returns a tuple with the ChargedCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetChargedCentsOk() (*int64, bool) {
if o == nil || IsNil(o.ChargedCents) {
return nil, false
}
return o.ChargedCents, true
}
// HasChargedCents returns a boolean if a field has been set.
func (o *BillingSubscription) HasChargedCents() bool {
if o != nil && !IsNil(o.ChargedCents) {
return true
}
return false
}
// SetChargedCents gets a reference to the given int64 and assigns it to the ChargedCents field.
func (o *BillingSubscription) SetChargedCents(v int64) {
o.ChargedCents = &v
}
// GetCoupon returns the Coupon field value if set, zero value otherwise.
func (o *BillingSubscription) GetCoupon() string {
if o == nil || IsNil(o.Coupon) {
var ret string
return ret
}
return *o.Coupon
}
// GetCouponOk returns a tuple with the Coupon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCouponOk() (*string, bool) {
if o == nil || IsNil(o.Coupon) {
return nil, false
}
return o.Coupon, true
}
// HasCoupon returns a boolean if a field has been set.
func (o *BillingSubscription) HasCoupon() bool {
if o != nil && !IsNil(o.Coupon) {
return true
}
return false
}
// SetCoupon gets a reference to the given string and assigns it to the Coupon field.
func (o *BillingSubscription) SetCoupon(v string) {
o.Coupon = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetCurrentPeriodEnd returns the CurrentPeriodEnd field value if set, zero value otherwise.
func (o *BillingSubscription) GetCurrentPeriodEnd() string {
if o == nil || IsNil(o.CurrentPeriodEnd) {
var ret string
return ret
}
return *o.CurrentPeriodEnd
}
// GetCurrentPeriodEndOk returns a tuple with the CurrentPeriodEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCurrentPeriodEndOk() (*string, bool) {
if o == nil || IsNil(o.CurrentPeriodEnd) {
return nil, false
}
return o.CurrentPeriodEnd, true
}
// HasCurrentPeriodEnd returns a boolean if a field has been set.
func (o *BillingSubscription) HasCurrentPeriodEnd() bool {
if o != nil && !IsNil(o.CurrentPeriodEnd) {
return true
}
return false
}
// SetCurrentPeriodEnd gets a reference to the given string and assigns it to the CurrentPeriodEnd field.
func (o *BillingSubscription) SetCurrentPeriodEnd(v string) {
o.CurrentPeriodEnd = &v
}
// GetCurrentPeriodStart returns the CurrentPeriodStart field value if set, zero value otherwise.
func (o *BillingSubscription) GetCurrentPeriodStart() string {
if o == nil || IsNil(o.CurrentPeriodStart) {
var ret string
return ret
}
return *o.CurrentPeriodStart
}
// GetCurrentPeriodStartOk returns a tuple with the CurrentPeriodStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCurrentPeriodStartOk() (*string, bool) {
if o == nil || IsNil(o.CurrentPeriodStart) {
return nil, false
}
return o.CurrentPeriodStart, true
}
// HasCurrentPeriodStart returns a boolean if a field has been set.
func (o *BillingSubscription) HasCurrentPeriodStart() bool {
if o != nil && !IsNil(o.CurrentPeriodStart) {
return true
}
return false
}
// SetCurrentPeriodStart gets a reference to the given string and assigns it to the CurrentPeriodStart field.
func (o *BillingSubscription) SetCurrentPeriodStart(v string) {
o.CurrentPeriodStart = &v
}
// GetCustomerCents returns the CustomerCents field value if set, zero value otherwise.
func (o *BillingSubscription) GetCustomerCents() int64 {
if o == nil || IsNil(o.CustomerCents) {
var ret int64
return ret
}
return *o.CustomerCents
}
// GetCustomerCentsOk returns a tuple with the CustomerCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetCustomerCentsOk() (*int64, bool) {
if o == nil || IsNil(o.CustomerCents) {
return nil, false
}
return o.CustomerCents, true
}
// HasCustomerCents returns a boolean if a field has been set.
func (o *BillingSubscription) HasCustomerCents() bool {
if o != nil && !IsNil(o.CustomerCents) {
return true
}
return false
}
// SetCustomerCents gets a reference to the given int64 and assigns it to the CustomerCents field.
func (o *BillingSubscription) SetCustomerCents(v int64) {
o.CustomerCents = &v
}
// GetDefaultPaymentMethod returns the DefaultPaymentMethod field value if set, zero value otherwise.
func (o *BillingSubscription) GetDefaultPaymentMethod() string {
if o == nil || IsNil(o.DefaultPaymentMethod) {
var ret string
return ret
}
return *o.DefaultPaymentMethod
}
// GetDefaultPaymentMethodOk returns a tuple with the DefaultPaymentMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetDefaultPaymentMethodOk() (*string, bool) {
if o == nil || IsNil(o.DefaultPaymentMethod) {
return nil, false
}
return o.DefaultPaymentMethod, true
}
// HasDefaultPaymentMethod returns a boolean if a field has been set.
func (o *BillingSubscription) HasDefaultPaymentMethod() bool {
if o != nil && !IsNil(o.DefaultPaymentMethod) {
return true
}
return false
}
// SetDefaultPaymentMethod gets a reference to the given string and assigns it to the DefaultPaymentMethod field.
func (o *BillingSubscription) SetDefaultPaymentMethod(v string) {
o.DefaultPaymentMethod = &v
}
// GetEndedAt returns the EndedAt field value if set, zero value otherwise.
func (o *BillingSubscription) GetEndedAt() string {
if o == nil || IsNil(o.EndedAt) {
var ret string
return ret
}
return *o.EndedAt
}
// GetEndedAtOk returns a tuple with the EndedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetEndedAtOk() (*string, bool) {
if o == nil || IsNil(o.EndedAt) {
return nil, false
}
return o.EndedAt, true
}
// HasEndedAt returns a boolean if a field has been set.
func (o *BillingSubscription) HasEndedAt() bool {
if o != nil && !IsNil(o.EndedAt) {
return true
}
return false
}
// SetEndedAt gets a reference to the given string and assigns it to the EndedAt field.
func (o *BillingSubscription) SetEndedAt(v string) {
o.EndedAt = &v
}
// GetHeld returns the Held field value if set, zero value otherwise.
func (o *BillingSubscription) GetHeld() bool {
if o == nil || IsNil(o.Held) {
var ret bool
return ret
}
return *o.Held
}
// GetHeldOk returns a tuple with the Held field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetHeldOk() (*bool, bool) {
if o == nil || IsNil(o.Held) {
return nil, false
}
return o.Held, true
}
// HasHeld returns a boolean if a field has been set.
func (o *BillingSubscription) HasHeld() bool {
if o != nil && !IsNil(o.Held) {
return true
}
return false
}
// SetHeld gets a reference to the given bool and assigns it to the Held field.
func (o *BillingSubscription) SetHeld(v bool) {
o.Held = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetId(v string) {
o.Id = &v
}
// GetLastPaid returns the LastPaid field value if set, zero value otherwise.
func (o *BillingSubscription) GetLastPaid() string {
if o == nil || IsNil(o.LastPaid) {
var ret string
return ret
}
return *o.LastPaid
}
// GetLastPaidOk returns a tuple with the LastPaid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetLastPaidOk() (*string, bool) {
if o == nil || IsNil(o.LastPaid) {
return nil, false
}
return o.LastPaid, true
}
// HasLastPaid returns a boolean if a field has been set.
func (o *BillingSubscription) HasLastPaid() bool {
if o != nil && !IsNil(o.LastPaid) {
return true
}
return false
}
// SetLastPaid gets a reference to the given string and assigns it to the LastPaid field.
func (o *BillingSubscription) SetLastPaid(v string) {
o.LastPaid = &v
}
// GetLines returns the Lines field value if set, zero value otherwise.
func (o *BillingSubscription) GetLines() []BillingSubscriptionLine {
if o == nil || IsNil(o.Lines) {
var ret []BillingSubscriptionLine
return ret
}
return o.Lines
}
// GetLinesOk returns a tuple with the Lines field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetLinesOk() ([]BillingSubscriptionLine, bool) {
if o == nil || IsNil(o.Lines) {
return nil, false
}
return o.Lines, true
}
// HasLines returns a boolean if a field has been set.
func (o *BillingSubscription) HasLines() bool {
if o != nil && !IsNil(o.Lines) {
return true
}
return false
}
// SetLines gets a reference to the given []BillingSubscriptionLine and assigns it to the Lines field.
func (o *BillingSubscription) SetLines(v []BillingSubscriptionLine) {
o.Lines = v
}
// GetMrrCents returns the MrrCents field value if set, zero value otherwise.
func (o *BillingSubscription) GetMrrCents() int64 {
if o == nil || IsNil(o.MrrCents) {
var ret int64
return ret
}
return *o.MrrCents
}
// GetMrrCentsOk returns a tuple with the MrrCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetMrrCentsOk() (*int64, bool) {
if o == nil || IsNil(o.MrrCents) {
return nil, false
}
return o.MrrCents, true
}
// HasMrrCents returns a boolean if a field has been set.
func (o *BillingSubscription) HasMrrCents() bool {
if o != nil && !IsNil(o.MrrCents) {
return true
}
return false
}
// SetMrrCents gets a reference to the given int64 and assigns it to the MrrCents field.
func (o *BillingSubscription) SetMrrCents(v int64) {
o.MrrCents = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *BillingSubscription) GetPlan() BillingSubscriptionPlan {
if o == nil || IsNil(o.Plan) {
var ret BillingSubscriptionPlan
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 *BillingSubscription) GetPlanOk() (*BillingSubscriptionPlan, 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 *BillingSubscription) HasPlan() bool {
if o != nil && !IsNil(o.Plan) {
return true
}
return false
}
// SetPlan gets a reference to the given BillingSubscriptionPlan and assigns it to the Plan field.
func (o *BillingSubscription) SetPlan(v BillingSubscriptionPlan) {
o.Plan = &v
}
// GetPlanId returns the PlanId field value if set, zero value otherwise.
func (o *BillingSubscription) GetPlanId() string {
if o == nil || IsNil(o.PlanId) {
var ret string
return ret
}
return *o.PlanId
}
// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetPlanIdOk() (*string, bool) {
if o == nil || IsNil(o.PlanId) {
return nil, false
}
return o.PlanId, true
}
// HasPlanId returns a boolean if a field has been set.
func (o *BillingSubscription) HasPlanId() bool {
if o != nil && !IsNil(o.PlanId) {
return true
}
return false
}
// SetPlanId gets a reference to the given string and assigns it to the PlanId field.
func (o *BillingSubscription) SetPlanId(v string) {
o.PlanId = &v
}
// GetProviderType returns the ProviderType field value if set, zero value otherwise.
func (o *BillingSubscription) GetProviderType() string {
if o == nil || IsNil(o.ProviderType) {
var ret string
return ret
}
return *o.ProviderType
}
// GetProviderTypeOk returns a tuple with the ProviderType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetProviderTypeOk() (*string, bool) {
if o == nil || IsNil(o.ProviderType) {
return nil, false
}
return o.ProviderType, true
}
// HasProviderType returns a boolean if a field has been set.
func (o *BillingSubscription) HasProviderType() bool {
if o != nil && !IsNil(o.ProviderType) {
return true
}
return false
}
// SetProviderType gets a reference to the given string and assigns it to the ProviderType field.
func (o *BillingSubscription) SetProviderType(v string) {
o.ProviderType = &v
}
// GetQuantity returns the Quantity field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetQuantity(v int64) {
o.Quantity = &v
}
// GetSeats returns the Seats field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetSeats(v int64) {
o.Seats = &v
}
// GetSettled returns the Settled field value if set, zero value otherwise.
func (o *BillingSubscription) GetSettled() string {
if o == nil || IsNil(o.Settled) {
var ret string
return ret
}
return *o.Settled
}
// GetSettledOk returns a tuple with the Settled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetSettledOk() (*string, bool) {
if o == nil || IsNil(o.Settled) {
return nil, false
}
return o.Settled, true
}
// HasSettled returns a boolean if a field has been set.
func (o *BillingSubscription) HasSettled() bool {
if o != nil && !IsNil(o.Settled) {
return true
}
return false
}
// SetSettled gets a reference to the given string and assigns it to the Settled field.
func (o *BillingSubscription) SetSettled(v string) {
o.Settled = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *BillingSubscription) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *BillingSubscription) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *BillingSubscription) SetStatus(v string) {
o.Status = &v
}
// GetTest returns the Test field value if set, zero value otherwise.
func (o *BillingSubscription) GetTest() bool {
if o == nil || IsNil(o.Test) {
var ret bool
return ret
}
return *o.Test
}
// GetTestOk returns a tuple with the Test field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetTestOk() (*bool, bool) {
if o == nil || IsNil(o.Test) {
return nil, false
}
return o.Test, true
}
// HasTest returns a boolean if a field has been set.
func (o *BillingSubscription) HasTest() bool {
if o != nil && !IsNil(o.Test) {
return true
}
return false
}
// SetTest gets a reference to the given bool and assigns it to the Test field.
func (o *BillingSubscription) SetTest(v bool) {
o.Test = &v
}
// GetTrialEnd returns the TrialEnd field value if set, zero value otherwise.
func (o *BillingSubscription) GetTrialEnd() string {
if o == nil || IsNil(o.TrialEnd) {
var ret string
return ret
}
return *o.TrialEnd
}
// GetTrialEndOk returns a tuple with the TrialEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetTrialEndOk() (*string, bool) {
if o == nil || IsNil(o.TrialEnd) {
return nil, false
}
return o.TrialEnd, true
}
// HasTrialEnd returns a boolean if a field has been set.
func (o *BillingSubscription) HasTrialEnd() bool {
if o != nil && !IsNil(o.TrialEnd) {
return true
}
return false
}
// SetTrialEnd gets a reference to the given string and assigns it to the TrialEnd field.
func (o *BillingSubscription) SetTrialEnd(v string) {
o.TrialEnd = &v
}
// GetTrialStart returns the TrialStart field value if set, zero value otherwise.
func (o *BillingSubscription) GetTrialStart() string {
if o == nil || IsNil(o.TrialStart) {
var ret string
return ret
}
return *o.TrialStart
}
// GetTrialStartOk returns a tuple with the TrialStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSubscription) GetTrialStartOk() (*string, bool) {
if o == nil || IsNil(o.TrialStart) {
return nil, false
}
return o.TrialStart, true
}
// HasTrialStart returns a boolean if a field has been set.
func (o *BillingSubscription) HasTrialStart() bool {
if o != nil && !IsNil(o.TrialStart) {
return true
}
return false
}
// SetTrialStart gets a reference to the given string and assigns it to the TrialStart field.
func (o *BillingSubscription) SetTrialStart(v string) {
o.TrialStart = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
// GetUserId returns the UserId field value if set, zero value otherwise.
func (o *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) 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 *BillingSubscription) SetUserId(v string) {
o.UserId = &v
}
func (o BillingSubscription) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingSubscription) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Assigned) {
toSerialize["assigned"] = o.Assigned
}
if !IsNil(o.CancelAtPeriodEnd) {
toSerialize["cancelAtPeriodEnd"] = o.CancelAtPeriodEnd
}
if !IsNil(o.CanceledAt) {
toSerialize["canceledAt"] = o.CanceledAt
}
if !IsNil(o.ChargedCents) {
toSerialize["chargedCents"] = o.ChargedCents
}
if !IsNil(o.Coupon) {
toSerialize["coupon"] = o.Coupon
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.CurrentPeriodEnd) {
toSerialize["currentPeriodEnd"] = o.CurrentPeriodEnd
}
if !IsNil(o.CurrentPeriodStart) {
toSerialize["currentPeriodStart"] = o.CurrentPeriodStart
}
if !IsNil(o.CustomerCents) {
toSerialize["customerCents"] = o.CustomerCents
}
if !IsNil(o.DefaultPaymentMethod) {
toSerialize["defaultPaymentMethod"] = o.DefaultPaymentMethod
}
if !IsNil(o.EndedAt) {
toSerialize["endedAt"] = o.EndedAt
}
if !IsNil(o.Held) {
toSerialize["held"] = o.Held
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LastPaid) {
toSerialize["lastPaid"] = o.LastPaid
}
if !IsNil(o.Lines) {
toSerialize["lines"] = o.Lines
}
if !IsNil(o.MrrCents) {
toSerialize["mrrCents"] = o.MrrCents
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.PlanId) {
toSerialize["planId"] = o.PlanId
}
if !IsNil(o.ProviderType) {
toSerialize["providerType"] = o.ProviderType
}
if !IsNil(o.Quantity) {
toSerialize["quantity"] = o.Quantity
}
if !IsNil(o.Seats) {
toSerialize["seats"] = o.Seats
}
if !IsNil(o.Settled) {
toSerialize["settled"] = o.Settled
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Test) {
toSerialize["test"] = o.Test
}
if !IsNil(o.TrialEnd) {
toSerialize["trialEnd"] = o.TrialEnd
}
if !IsNil(o.TrialStart) {
toSerialize["trialStart"] = o.TrialStart
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if !IsNil(o.UserId) {
toSerialize["userId"] = o.UserId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingSubscription) UnmarshalJSON(data []byte) (err error) {
varBillingSubscription := _BillingSubscription{}
err = json.Unmarshal(data, &varBillingSubscription)
if err != nil {
return err
}
*o = BillingSubscription(varBillingSubscription)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "assigned")
delete(additionalProperties, "cancelAtPeriodEnd")
delete(additionalProperties, "canceledAt")
delete(additionalProperties, "chargedCents")
delete(additionalProperties, "coupon")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "currentPeriodEnd")
delete(additionalProperties, "currentPeriodStart")
delete(additionalProperties, "customerCents")
delete(additionalProperties, "defaultPaymentMethod")
delete(additionalProperties, "endedAt")
delete(additionalProperties, "held")
delete(additionalProperties, "id")
delete(additionalProperties, "lastPaid")
delete(additionalProperties, "lines")
delete(additionalProperties, "mrrCents")
delete(additionalProperties, "plan")
delete(additionalProperties, "planId")
delete(additionalProperties, "providerType")
delete(additionalProperties, "quantity")
delete(additionalProperties, "seats")
delete(additionalProperties, "settled")
delete(additionalProperties, "status")
delete(additionalProperties, "test")
delete(additionalProperties, "trialEnd")
delete(additionalProperties, "trialStart")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "userId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingSubscription struct {
value *BillingSubscription
isSet bool
}
func (v NullableBillingSubscription) Get() *BillingSubscription {
return v.value
}
func (v *NullableBillingSubscription) Set(val *BillingSubscription) {
v.value = val
v.isSet = true
}
func (v NullableBillingSubscription) IsSet() bool {
return v.isSet
}
func (v *NullableBillingSubscription) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingSubscription(val *BillingSubscription) *NullableBillingSubscription {
return &NullableBillingSubscription{value: val, isSet: true}
}
func (v NullableBillingSubscription) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingSubscription) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}