Files
sdk/model_billing_assignment.go

155 lines
4.3 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 BillingAssignment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingAssignment{}
// BillingAssignment struct for BillingAssignment
type BillingAssignment struct {
// Assigned is every seat assigned: the member, and the seat type (a plan the subscription holds seats of, \"team\" or \"team-premium\") they hold. It replaces what was assigned; an empty list unassigns every seat.
Assigned []BillingSubscriptionSeat `json:"assigned,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingAssignment BillingAssignment
// NewBillingAssignment instantiates a new BillingAssignment 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 NewBillingAssignment() *BillingAssignment {
this := BillingAssignment{}
return &this
}
// NewBillingAssignmentWithDefaults instantiates a new BillingAssignment 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 NewBillingAssignmentWithDefaults() *BillingAssignment {
this := BillingAssignment{}
return &this
}
// GetAssigned returns the Assigned field value if set, zero value otherwise.
func (o *BillingAssignment) 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 *BillingAssignment) 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 *BillingAssignment) 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 *BillingAssignment) SetAssigned(v []BillingSubscriptionSeat) {
o.Assigned = v
}
func (o BillingAssignment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingAssignment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Assigned) {
toSerialize["assigned"] = o.Assigned
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingAssignment) UnmarshalJSON(data []byte) (err error) {
varBillingAssignment := _BillingAssignment{}
err = json.Unmarshal(data, &varBillingAssignment)
if err != nil {
return err
}
*o = BillingAssignment(varBillingAssignment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "assigned")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingAssignment struct {
value *BillingAssignment
isSet bool
}
func (v NullableBillingAssignment) Get() *BillingAssignment {
return v.value
}
func (v *NullableBillingAssignment) Set(val *BillingAssignment) {
v.value = val
v.isSet = true
}
func (v NullableBillingAssignment) IsSet() bool {
return v.isSet
}
func (v *NullableBillingAssignment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingAssignment(val *BillingAssignment) *NullableBillingAssignment {
return &NullableBillingAssignment{value: val, isSet: true}
}
func (v NullableBillingAssignment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingAssignment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}