Files
sdk/model_principal_form.go

571 lines
15 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 PrincipalForm type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PrincipalForm{}
// PrincipalForm struct for PrincipalForm
type PrincipalForm struct {
// Certified is whether the signature covers the current facts.
Certified *bool `json:"certified,omitempty"`
// Chapter3 and Chapter4 are a W-8BEN-E's statuses — to the org's admins.
Chapter3 *string `json:"chapter3,omitempty"`
Chapter4 *string `json:"chapter4,omitempty"`
// Country is US for a W-9, or the country of citizenship or incorporation.
Country *string `json:"country,omitempty"`
// Expires is when a W-8 stops being valid, unix seconds.
Expires *int64 `json:"expires,omitempty"`
ForeignTin *string `json:"foreignTin,omitempty"`
// Form is w9, w8ben or w8bene.
Form *string `json:"form,omitempty"`
// Residence is the country of the permanent residence address.
Residence *string `json:"residence,omitempty"`
// TIN and ForeignTIN are masked — answered to the org's admins.
Tin *string `json:"tin,omitempty"`
// Treaty is a W-8's treaty claim — to the org's admins.
Treaty *PrincipalTreaty `json:"treaty,omitempty"`
// USPerson is true for a W-9.
UsPerson *bool `json:"usPerson,omitempty"`
// Valid is whether it establishes what it certifies today.
Valid *bool `json:"valid,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PrincipalForm PrincipalForm
// NewPrincipalForm instantiates a new PrincipalForm 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 NewPrincipalForm() *PrincipalForm {
this := PrincipalForm{}
return &this
}
// NewPrincipalFormWithDefaults instantiates a new PrincipalForm 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 NewPrincipalFormWithDefaults() *PrincipalForm {
this := PrincipalForm{}
return &this
}
// GetCertified returns the Certified field value if set, zero value otherwise.
func (o *PrincipalForm) GetCertified() bool {
if o == nil || IsNil(o.Certified) {
var ret bool
return ret
}
return *o.Certified
}
// GetCertifiedOk returns a tuple with the Certified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetCertifiedOk() (*bool, bool) {
if o == nil || IsNil(o.Certified) {
return nil, false
}
return o.Certified, true
}
// HasCertified returns a boolean if a field has been set.
func (o *PrincipalForm) HasCertified() bool {
if o != nil && !IsNil(o.Certified) {
return true
}
return false
}
// SetCertified gets a reference to the given bool and assigns it to the Certified field.
func (o *PrincipalForm) SetCertified(v bool) {
o.Certified = &v
}
// GetChapter3 returns the Chapter3 field value if set, zero value otherwise.
func (o *PrincipalForm) GetChapter3() string {
if o == nil || IsNil(o.Chapter3) {
var ret string
return ret
}
return *o.Chapter3
}
// GetChapter3Ok returns a tuple with the Chapter3 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetChapter3Ok() (*string, bool) {
if o == nil || IsNil(o.Chapter3) {
return nil, false
}
return o.Chapter3, true
}
// HasChapter3 returns a boolean if a field has been set.
func (o *PrincipalForm) HasChapter3() bool {
if o != nil && !IsNil(o.Chapter3) {
return true
}
return false
}
// SetChapter3 gets a reference to the given string and assigns it to the Chapter3 field.
func (o *PrincipalForm) SetChapter3(v string) {
o.Chapter3 = &v
}
// GetChapter4 returns the Chapter4 field value if set, zero value otherwise.
func (o *PrincipalForm) GetChapter4() string {
if o == nil || IsNil(o.Chapter4) {
var ret string
return ret
}
return *o.Chapter4
}
// GetChapter4Ok returns a tuple with the Chapter4 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetChapter4Ok() (*string, bool) {
if o == nil || IsNil(o.Chapter4) {
return nil, false
}
return o.Chapter4, true
}
// HasChapter4 returns a boolean if a field has been set.
func (o *PrincipalForm) HasChapter4() bool {
if o != nil && !IsNil(o.Chapter4) {
return true
}
return false
}
// SetChapter4 gets a reference to the given string and assigns it to the Chapter4 field.
func (o *PrincipalForm) SetChapter4(v string) {
o.Chapter4 = &v
}
// GetCountry returns the Country field value if set, zero value otherwise.
func (o *PrincipalForm) GetCountry() string {
if o == nil || IsNil(o.Country) {
var ret string
return ret
}
return *o.Country
}
// GetCountryOk returns a tuple with the Country field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetCountryOk() (*string, bool) {
if o == nil || IsNil(o.Country) {
return nil, false
}
return o.Country, true
}
// HasCountry returns a boolean if a field has been set.
func (o *PrincipalForm) HasCountry() bool {
if o != nil && !IsNil(o.Country) {
return true
}
return false
}
// SetCountry gets a reference to the given string and assigns it to the Country field.
func (o *PrincipalForm) SetCountry(v string) {
o.Country = &v
}
// GetExpires returns the Expires field value if set, zero value otherwise.
func (o *PrincipalForm) GetExpires() int64 {
if o == nil || IsNil(o.Expires) {
var ret int64
return ret
}
return *o.Expires
}
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetExpiresOk() (*int64, bool) {
if o == nil || IsNil(o.Expires) {
return nil, false
}
return o.Expires, true
}
// HasExpires returns a boolean if a field has been set.
func (o *PrincipalForm) HasExpires() bool {
if o != nil && !IsNil(o.Expires) {
return true
}
return false
}
// SetExpires gets a reference to the given int64 and assigns it to the Expires field.
func (o *PrincipalForm) SetExpires(v int64) {
o.Expires = &v
}
// GetForeignTin returns the ForeignTin field value if set, zero value otherwise.
func (o *PrincipalForm) GetForeignTin() string {
if o == nil || IsNil(o.ForeignTin) {
var ret string
return ret
}
return *o.ForeignTin
}
// GetForeignTinOk returns a tuple with the ForeignTin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetForeignTinOk() (*string, bool) {
if o == nil || IsNil(o.ForeignTin) {
return nil, false
}
return o.ForeignTin, true
}
// HasForeignTin returns a boolean if a field has been set.
func (o *PrincipalForm) HasForeignTin() bool {
if o != nil && !IsNil(o.ForeignTin) {
return true
}
return false
}
// SetForeignTin gets a reference to the given string and assigns it to the ForeignTin field.
func (o *PrincipalForm) SetForeignTin(v string) {
o.ForeignTin = &v
}
// GetForm returns the Form field value if set, zero value otherwise.
func (o *PrincipalForm) GetForm() string {
if o == nil || IsNil(o.Form) {
var ret string
return ret
}
return *o.Form
}
// GetFormOk returns a tuple with the Form field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetFormOk() (*string, bool) {
if o == nil || IsNil(o.Form) {
return nil, false
}
return o.Form, true
}
// HasForm returns a boolean if a field has been set.
func (o *PrincipalForm) HasForm() bool {
if o != nil && !IsNil(o.Form) {
return true
}
return false
}
// SetForm gets a reference to the given string and assigns it to the Form field.
func (o *PrincipalForm) SetForm(v string) {
o.Form = &v
}
// GetResidence returns the Residence field value if set, zero value otherwise.
func (o *PrincipalForm) GetResidence() string {
if o == nil || IsNil(o.Residence) {
var ret string
return ret
}
return *o.Residence
}
// GetResidenceOk returns a tuple with the Residence field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetResidenceOk() (*string, bool) {
if o == nil || IsNil(o.Residence) {
return nil, false
}
return o.Residence, true
}
// HasResidence returns a boolean if a field has been set.
func (o *PrincipalForm) HasResidence() bool {
if o != nil && !IsNil(o.Residence) {
return true
}
return false
}
// SetResidence gets a reference to the given string and assigns it to the Residence field.
func (o *PrincipalForm) SetResidence(v string) {
o.Residence = &v
}
// GetTin returns the Tin field value if set, zero value otherwise.
func (o *PrincipalForm) GetTin() string {
if o == nil || IsNil(o.Tin) {
var ret string
return ret
}
return *o.Tin
}
// GetTinOk returns a tuple with the Tin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetTinOk() (*string, bool) {
if o == nil || IsNil(o.Tin) {
return nil, false
}
return o.Tin, true
}
// HasTin returns a boolean if a field has been set.
func (o *PrincipalForm) HasTin() bool {
if o != nil && !IsNil(o.Tin) {
return true
}
return false
}
// SetTin gets a reference to the given string and assigns it to the Tin field.
func (o *PrincipalForm) SetTin(v string) {
o.Tin = &v
}
// GetTreaty returns the Treaty field value if set, zero value otherwise.
func (o *PrincipalForm) GetTreaty() PrincipalTreaty {
if o == nil || IsNil(o.Treaty) {
var ret PrincipalTreaty
return ret
}
return *o.Treaty
}
// GetTreatyOk returns a tuple with the Treaty field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetTreatyOk() (*PrincipalTreaty, bool) {
if o == nil || IsNil(o.Treaty) {
return nil, false
}
return o.Treaty, true
}
// HasTreaty returns a boolean if a field has been set.
func (o *PrincipalForm) HasTreaty() bool {
if o != nil && !IsNil(o.Treaty) {
return true
}
return false
}
// SetTreaty gets a reference to the given PrincipalTreaty and assigns it to the Treaty field.
func (o *PrincipalForm) SetTreaty(v PrincipalTreaty) {
o.Treaty = &v
}
// GetUsPerson returns the UsPerson field value if set, zero value otherwise.
func (o *PrincipalForm) GetUsPerson() bool {
if o == nil || IsNil(o.UsPerson) {
var ret bool
return ret
}
return *o.UsPerson
}
// GetUsPersonOk returns a tuple with the UsPerson field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetUsPersonOk() (*bool, bool) {
if o == nil || IsNil(o.UsPerson) {
return nil, false
}
return o.UsPerson, true
}
// HasUsPerson returns a boolean if a field has been set.
func (o *PrincipalForm) HasUsPerson() bool {
if o != nil && !IsNil(o.UsPerson) {
return true
}
return false
}
// SetUsPerson gets a reference to the given bool and assigns it to the UsPerson field.
func (o *PrincipalForm) SetUsPerson(v bool) {
o.UsPerson = &v
}
// GetValid returns the Valid field value if set, zero value otherwise.
func (o *PrincipalForm) GetValid() bool {
if o == nil || IsNil(o.Valid) {
var ret bool
return ret
}
return *o.Valid
}
// GetValidOk returns a tuple with the Valid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalForm) GetValidOk() (*bool, bool) {
if o == nil || IsNil(o.Valid) {
return nil, false
}
return o.Valid, true
}
// HasValid returns a boolean if a field has been set.
func (o *PrincipalForm) HasValid() bool {
if o != nil && !IsNil(o.Valid) {
return true
}
return false
}
// SetValid gets a reference to the given bool and assigns it to the Valid field.
func (o *PrincipalForm) SetValid(v bool) {
o.Valid = &v
}
func (o PrincipalForm) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PrincipalForm) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Certified) {
toSerialize["certified"] = o.Certified
}
if !IsNil(o.Chapter3) {
toSerialize["chapter3"] = o.Chapter3
}
if !IsNil(o.Chapter4) {
toSerialize["chapter4"] = o.Chapter4
}
if !IsNil(o.Country) {
toSerialize["country"] = o.Country
}
if !IsNil(o.Expires) {
toSerialize["expires"] = o.Expires
}
if !IsNil(o.ForeignTin) {
toSerialize["foreignTin"] = o.ForeignTin
}
if !IsNil(o.Form) {
toSerialize["form"] = o.Form
}
if !IsNil(o.Residence) {
toSerialize["residence"] = o.Residence
}
if !IsNil(o.Tin) {
toSerialize["tin"] = o.Tin
}
if !IsNil(o.Treaty) {
toSerialize["treaty"] = o.Treaty
}
if !IsNil(o.UsPerson) {
toSerialize["usPerson"] = o.UsPerson
}
if !IsNil(o.Valid) {
toSerialize["valid"] = o.Valid
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PrincipalForm) UnmarshalJSON(data []byte) (err error) {
varPrincipalForm := _PrincipalForm{}
err = json.Unmarshal(data, &varPrincipalForm)
if err != nil {
return err
}
*o = PrincipalForm(varPrincipalForm)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "certified")
delete(additionalProperties, "chapter3")
delete(additionalProperties, "chapter4")
delete(additionalProperties, "country")
delete(additionalProperties, "expires")
delete(additionalProperties, "foreignTin")
delete(additionalProperties, "form")
delete(additionalProperties, "residence")
delete(additionalProperties, "tin")
delete(additionalProperties, "treaty")
delete(additionalProperties, "usPerson")
delete(additionalProperties, "valid")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePrincipalForm struct {
value *PrincipalForm
isSet bool
}
func (v NullablePrincipalForm) Get() *PrincipalForm {
return v.value
}
func (v *NullablePrincipalForm) Set(val *PrincipalForm) {
v.value = val
v.isSet = true
}
func (v NullablePrincipalForm) IsSet() bool {
return v.isSet
}
func (v *NullablePrincipalForm) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePrincipalForm(val *PrincipalForm) *NullablePrincipalForm {
return &NullablePrincipalForm{value: val, isSet: true}
}
func (v NullablePrincipalForm) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePrincipalForm) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}