Files
sdk/model_trust_section_write.go

269 lines
7.0 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 TrustSectionWrite type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrustSectionWrite{}
// TrustSectionWrite struct for TrustSectionWrite
type TrustSectionWrite struct {
Data interface{} `json:"data,omitempty"`
// ID is the record's id. Omit it on a create and one is minted; the single-valued sections (profile, risk) hold one record whatever is named.
Id *string `json:"id,omitempty"`
// Kind is the section being written. The URL is the authority.
Kind *string `json:"kind,omitempty"`
// Ord orders this record within its section, ascending, ties broken by id. It is the organization's own ordering — the page renders in it.
Ord *int64 `json:"ord,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrustSectionWrite TrustSectionWrite
// NewTrustSectionWrite instantiates a new TrustSectionWrite 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 NewTrustSectionWrite() *TrustSectionWrite {
this := TrustSectionWrite{}
return &this
}
// NewTrustSectionWriteWithDefaults instantiates a new TrustSectionWrite 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 NewTrustSectionWriteWithDefaults() *TrustSectionWrite {
this := TrustSectionWrite{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrustSectionWrite) GetData() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *TrustSectionWrite) GetDataOk() (*interface{}, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return &o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *TrustSectionWrite) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given interface{} and assigns it to the Data field.
func (o *TrustSectionWrite) SetData(v interface{}) {
o.Data = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrustSectionWrite) 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 *TrustSectionWrite) 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 *TrustSectionWrite) 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 *TrustSectionWrite) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *TrustSectionWrite) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrustSectionWrite) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *TrustSectionWrite) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *TrustSectionWrite) SetKind(v string) {
o.Kind = &v
}
// GetOrd returns the Ord field value if set, zero value otherwise.
func (o *TrustSectionWrite) GetOrd() int64 {
if o == nil || IsNil(o.Ord) {
var ret int64
return ret
}
return *o.Ord
}
// GetOrdOk returns a tuple with the Ord field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrustSectionWrite) GetOrdOk() (*int64, bool) {
if o == nil || IsNil(o.Ord) {
return nil, false
}
return o.Ord, true
}
// HasOrd returns a boolean if a field has been set.
func (o *TrustSectionWrite) HasOrd() bool {
if o != nil && !IsNil(o.Ord) {
return true
}
return false
}
// SetOrd gets a reference to the given int64 and assigns it to the Ord field.
func (o *TrustSectionWrite) SetOrd(v int64) {
o.Ord = &v
}
func (o TrustSectionWrite) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrustSectionWrite) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Data != nil {
toSerialize["data"] = o.Data
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Ord) {
toSerialize["ord"] = o.Ord
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrustSectionWrite) UnmarshalJSON(data []byte) (err error) {
varTrustSectionWrite := _TrustSectionWrite{}
err = json.Unmarshal(data, &varTrustSectionWrite)
if err != nil {
return err
}
*o = TrustSectionWrite(varTrustSectionWrite)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "ord")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrustSectionWrite struct {
value *TrustSectionWrite
isSet bool
}
func (v NullableTrustSectionWrite) Get() *TrustSectionWrite {
return v.value
}
func (v *NullableTrustSectionWrite) Set(val *TrustSectionWrite) {
v.value = val
v.isSet = true
}
func (v NullableTrustSectionWrite) IsSet() bool {
return v.isSet
}
func (v *NullableTrustSectionWrite) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrustSectionWrite(val *TrustSectionWrite) *NullableTrustSectionWrite {
return &NullableTrustSectionWrite{value: val, isSet: true}
}
func (v NullableTrustSectionWrite) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrustSectionWrite) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}