Files
sdk/model_usage_usage_scope.go

193 lines
4.9 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 UsageUsageScope type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageUsageScope{}
// UsageUsageScope struct for UsageUsageScope
type UsageUsageScope struct {
// Org is the IAM org slug the rows were read under — the validated principal's, never a client header.
Org *string `json:"org,omitempty"`
// User is the caller's own subject, whose linked-account rows the accounts block carries. Absent on a read that is org-scoped only.
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageUsageScope UsageUsageScope
// NewUsageUsageScope instantiates a new UsageUsageScope 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 NewUsageUsageScope() *UsageUsageScope {
this := UsageUsageScope{}
return &this
}
// NewUsageUsageScopeWithDefaults instantiates a new UsageUsageScope 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 NewUsageUsageScopeWithDefaults() *UsageUsageScope {
this := UsageUsageScope{}
return &this
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *UsageUsageScope) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageScope) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *UsageUsageScope) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *UsageUsageScope) SetOrg(v string) {
o.Org = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *UsageUsageScope) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageScope) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *UsageUsageScope) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *UsageUsageScope) SetUser(v string) {
o.User = &v
}
func (o UsageUsageScope) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageUsageScope) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UsageUsageScope) UnmarshalJSON(data []byte) (err error) {
varUsageUsageScope := _UsageUsageScope{}
err = json.Unmarshal(data, &varUsageUsageScope)
if err != nil {
return err
}
*o = UsageUsageScope(varUsageUsageScope)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "org")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUsageUsageScope struct {
value *UsageUsageScope
isSet bool
}
func (v NullableUsageUsageScope) Get() *UsageUsageScope {
return v.value
}
func (v *NullableUsageUsageScope) Set(val *UsageUsageScope) {
v.value = val
v.isSet = true
}
func (v NullableUsageUsageScope) IsSet() bool {
return v.isSet
}
func (v *NullableUsageUsageScope) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageUsageScope(val *UsageUsageScope) *NullableUsageUsageScope {
return &NullableUsageUsageScope{value: val, isSet: true}
}
func (v NullableUsageUsageScope) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageUsageScope) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}