Files
sdk/model_form_crm.go

269 lines
6.5 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 FormCRM type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormCRM{}
// FormCRM struct for FormCRM
type FormCRM struct {
// Company is the ref of the field whose answer is the person's company.
Company *string `json:"company,omitempty"`
// Email is the ref of the field whose answer is the person's address. Empty, the first email field is. A signed-in respondent is always the address their account holds.
Email *string `json:"email,omitempty"`
// List is the CRM list the person joins, by name (a subscribe form's mailing list). Empty joins none.
List *string `json:"list,omitempty"`
// Name is the ref of the field whose answer is the person's name.
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormCRM FormCRM
// NewFormCRM instantiates a new FormCRM 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 NewFormCRM() *FormCRM {
this := FormCRM{}
return &this
}
// NewFormCRMWithDefaults instantiates a new FormCRM 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 NewFormCRMWithDefaults() *FormCRM {
this := FormCRM{}
return &this
}
// GetCompany returns the Company field value if set, zero value otherwise.
func (o *FormCRM) GetCompany() string {
if o == nil || IsNil(o.Company) {
var ret string
return ret
}
return *o.Company
}
// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormCRM) GetCompanyOk() (*string, bool) {
if o == nil || IsNil(o.Company) {
return nil, false
}
return o.Company, true
}
// HasCompany returns a boolean if a field has been set.
func (o *FormCRM) HasCompany() bool {
if o != nil && !IsNil(o.Company) {
return true
}
return false
}
// SetCompany gets a reference to the given string and assigns it to the Company field.
func (o *FormCRM) SetCompany(v string) {
o.Company = &v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *FormCRM) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormCRM) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *FormCRM) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *FormCRM) SetEmail(v string) {
o.Email = &v
}
// GetList returns the List field value if set, zero value otherwise.
func (o *FormCRM) GetList() string {
if o == nil || IsNil(o.List) {
var ret string
return ret
}
return *o.List
}
// GetListOk returns a tuple with the List field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormCRM) GetListOk() (*string, bool) {
if o == nil || IsNil(o.List) {
return nil, false
}
return o.List, true
}
// HasList returns a boolean if a field has been set.
func (o *FormCRM) HasList() bool {
if o != nil && !IsNil(o.List) {
return true
}
return false
}
// SetList gets a reference to the given string and assigns it to the List field.
func (o *FormCRM) SetList(v string) {
o.List = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *FormCRM) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormCRM) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *FormCRM) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *FormCRM) SetName(v string) {
o.Name = &v
}
func (o FormCRM) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormCRM) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Company) {
toSerialize["company"] = o.Company
}
if !IsNil(o.Email) {
toSerialize["email"] = o.Email
}
if !IsNil(o.List) {
toSerialize["list"] = o.List
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormCRM) UnmarshalJSON(data []byte) (err error) {
varFormCRM := _FormCRM{}
err = json.Unmarshal(data, &varFormCRM)
if err != nil {
return err
}
*o = FormCRM(varFormCRM)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "company")
delete(additionalProperties, "email")
delete(additionalProperties, "list")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormCRM struct {
value *FormCRM
isSet bool
}
func (v NullableFormCRM) Get() *FormCRM {
return v.value
}
func (v *NullableFormCRM) Set(val *FormCRM) {
v.value = val
v.isSet = true
}
func (v NullableFormCRM) IsSet() bool {
return v.isSet
}
func (v *NullableFormCRM) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormCRM(val *FormCRM) *NullableFormCRM {
return &NullableFormCRM{value: val, isSet: true}
}
func (v NullableFormCRM) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormCRM) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}