Files
sdk/model_books_rules_out.go

155 lines
3.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 BooksRulesOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BooksRulesOut{}
// BooksRulesOut struct for BooksRulesOut
type BooksRulesOut struct {
// Rules is every rule the org has set, highest priority first — the order they are matched in.
Rules []BooksRule `json:"rules,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BooksRulesOut BooksRulesOut
// NewBooksRulesOut instantiates a new BooksRulesOut 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 NewBooksRulesOut() *BooksRulesOut {
this := BooksRulesOut{}
return &this
}
// NewBooksRulesOutWithDefaults instantiates a new BooksRulesOut 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 NewBooksRulesOutWithDefaults() *BooksRulesOut {
this := BooksRulesOut{}
return &this
}
// GetRules returns the Rules field value if set, zero value otherwise.
func (o *BooksRulesOut) GetRules() []BooksRule {
if o == nil || IsNil(o.Rules) {
var ret []BooksRule
return ret
}
return o.Rules
}
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksRulesOut) GetRulesOk() ([]BooksRule, bool) {
if o == nil || IsNil(o.Rules) {
return nil, false
}
return o.Rules, true
}
// HasRules returns a boolean if a field has been set.
func (o *BooksRulesOut) HasRules() bool {
if o != nil && !IsNil(o.Rules) {
return true
}
return false
}
// SetRules gets a reference to the given []BooksRule and assigns it to the Rules field.
func (o *BooksRulesOut) SetRules(v []BooksRule) {
o.Rules = v
}
func (o BooksRulesOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BooksRulesOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Rules) {
toSerialize["rules"] = o.Rules
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BooksRulesOut) UnmarshalJSON(data []byte) (err error) {
varBooksRulesOut := _BooksRulesOut{}
err = json.Unmarshal(data, &varBooksRulesOut)
if err != nil {
return err
}
*o = BooksRulesOut(varBooksRulesOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "rules")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBooksRulesOut struct {
value *BooksRulesOut
isSet bool
}
func (v NullableBooksRulesOut) Get() *BooksRulesOut {
return v.value
}
func (v *NullableBooksRulesOut) Set(val *BooksRulesOut) {
v.value = val
v.isSet = true
}
func (v NullableBooksRulesOut) IsSet() bool {
return v.isSet
}
func (v *NullableBooksRulesOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBooksRulesOut(val *BooksRulesOut) *NullableBooksRulesOut {
return &NullableBooksRulesOut{value: val, isSet: true}
}
func (v NullableBooksRulesOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBooksRulesOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}