Files
sdk/model_principal_source.go

193 lines
4.8 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 PrincipalSource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PrincipalSource{}
// PrincipalSource struct for PrincipalSource
type PrincipalSource struct {
// App names it: company, tax, wallet or agent.
App *string `json:"app,omitempty"`
// Status is read, or absent when this deployment does not run it.
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PrincipalSource PrincipalSource
// NewPrincipalSource instantiates a new PrincipalSource 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 NewPrincipalSource() *PrincipalSource {
this := PrincipalSource{}
return &this
}
// NewPrincipalSourceWithDefaults instantiates a new PrincipalSource 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 NewPrincipalSourceWithDefaults() *PrincipalSource {
this := PrincipalSource{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PrincipalSource) GetApp() string {
if o == nil || IsNil(o.App) {
var ret string
return ret
}
return *o.App
}
// GetAppOk returns a tuple with the App field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalSource) GetAppOk() (*string, bool) {
if o == nil || IsNil(o.App) {
return nil, false
}
return o.App, true
}
// HasApp returns a boolean if a field has been set.
func (o *PrincipalSource) HasApp() bool {
if o != nil && !IsNil(o.App) {
return true
}
return false
}
// SetApp gets a reference to the given string and assigns it to the App field.
func (o *PrincipalSource) SetApp(v string) {
o.App = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *PrincipalSource) 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 *PrincipalSource) 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 *PrincipalSource) 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 *PrincipalSource) SetStatus(v string) {
o.Status = &v
}
func (o PrincipalSource) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PrincipalSource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.App) {
toSerialize["app"] = o.App
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PrincipalSource) UnmarshalJSON(data []byte) (err error) {
varPrincipalSource := _PrincipalSource{}
err = json.Unmarshal(data, &varPrincipalSource)
if err != nil {
return err
}
*o = PrincipalSource(varPrincipalSource)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePrincipalSource struct {
value *PrincipalSource
isSet bool
}
func (v NullablePrincipalSource) Get() *PrincipalSource {
return v.value
}
func (v *NullablePrincipalSource) Set(val *PrincipalSource) {
v.value = val
v.isSet = true
}
func (v NullablePrincipalSource) IsSet() bool {
return v.isSet
}
func (v *NullablePrincipalSource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePrincipalSource(val *PrincipalSource) *NullablePrincipalSource {
return &NullablePrincipalSource{value: val, isSet: true}
}
func (v NullablePrincipalSource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePrincipalSource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}