mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
11 KiB
Go
421 lines
11 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 ProviderField type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProviderField{}
|
|
|
|
// ProviderField struct for ProviderField
|
|
type ProviderField struct {
|
|
// Default is what an empty input stands for.
|
|
Default *string `json:"default,omitempty"`
|
|
// Help is the connector's own instruction for finding the value.
|
|
Help *string `json:"help,omitempty"`
|
|
// Label is what the input is called on the form.
|
|
Label *string `json:"label,omitempty"`
|
|
// Name is the key the value is submitted under.
|
|
Name *string `json:"name,omitempty"`
|
|
// Options are the values a choice field accepts.
|
|
Options []ProviderFieldOption `json:"options,omitempty"`
|
|
// Required is whether the form refuses to submit without it.
|
|
Required *bool `json:"required,omitempty"`
|
|
// Secret masks the input; its value is sealed and never read back.
|
|
Secret *bool `json:"secret,omitempty"`
|
|
// Type is \"number\", \"boolean\" or \"text\" (multi-line) when the value is not a single line of text.
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProviderField ProviderField
|
|
|
|
// NewProviderField instantiates a new ProviderField 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 NewProviderField() *ProviderField {
|
|
this := ProviderField{}
|
|
return &this
|
|
}
|
|
|
|
// NewProviderFieldWithDefaults instantiates a new ProviderField 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 NewProviderFieldWithDefaults() *ProviderField {
|
|
this := ProviderField{}
|
|
return &this
|
|
}
|
|
|
|
// GetDefault returns the Default field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetDefault() string {
|
|
if o == nil || IsNil(o.Default) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Default
|
|
}
|
|
|
|
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetDefaultOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Default) {
|
|
return nil, false
|
|
}
|
|
return o.Default, true
|
|
}
|
|
|
|
// HasDefault returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasDefault() bool {
|
|
if o != nil && !IsNil(o.Default) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDefault gets a reference to the given string and assigns it to the Default field.
|
|
func (o *ProviderField) SetDefault(v string) {
|
|
o.Default = &v
|
|
}
|
|
|
|
// GetHelp returns the Help field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetHelp() string {
|
|
if o == nil || IsNil(o.Help) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Help
|
|
}
|
|
|
|
// GetHelpOk returns a tuple with the Help field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetHelpOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Help) {
|
|
return nil, false
|
|
}
|
|
return o.Help, true
|
|
}
|
|
|
|
// HasHelp returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasHelp() bool {
|
|
if o != nil && !IsNil(o.Help) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHelp gets a reference to the given string and assigns it to the Help field.
|
|
func (o *ProviderField) SetHelp(v string) {
|
|
o.Help = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *ProviderField) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ProviderField) 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 *ProviderField) 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 *ProviderField) 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 *ProviderField) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOptions returns the Options field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetOptions() []ProviderFieldOption {
|
|
if o == nil || IsNil(o.Options) {
|
|
var ret []ProviderFieldOption
|
|
return ret
|
|
}
|
|
return o.Options
|
|
}
|
|
|
|
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetOptionsOk() ([]ProviderFieldOption, bool) {
|
|
if o == nil || IsNil(o.Options) {
|
|
return nil, false
|
|
}
|
|
return o.Options, true
|
|
}
|
|
|
|
// HasOptions returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasOptions() bool {
|
|
if o != nil && !IsNil(o.Options) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOptions gets a reference to the given []ProviderFieldOption and assigns it to the Options field.
|
|
func (o *ProviderField) SetOptions(v []ProviderFieldOption) {
|
|
o.Options = v
|
|
}
|
|
|
|
// GetRequired returns the Required field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetRequired() bool {
|
|
if o == nil || IsNil(o.Required) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Required
|
|
}
|
|
|
|
// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetRequiredOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Required) {
|
|
return nil, false
|
|
}
|
|
return o.Required, true
|
|
}
|
|
|
|
// HasRequired returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasRequired() bool {
|
|
if o != nil && !IsNil(o.Required) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRequired gets a reference to the given bool and assigns it to the Required field.
|
|
func (o *ProviderField) SetRequired(v bool) {
|
|
o.Required = &v
|
|
}
|
|
|
|
// GetSecret returns the Secret field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetSecret() bool {
|
|
if o == nil || IsNil(o.Secret) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Secret
|
|
}
|
|
|
|
// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetSecretOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Secret) {
|
|
return nil, false
|
|
}
|
|
return o.Secret, true
|
|
}
|
|
|
|
// HasSecret returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasSecret() bool {
|
|
if o != nil && !IsNil(o.Secret) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSecret gets a reference to the given bool and assigns it to the Secret field.
|
|
func (o *ProviderField) SetSecret(v bool) {
|
|
o.Secret = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *ProviderField) GetType() string {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderField) GetTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *ProviderField) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *ProviderField) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o ProviderField) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProviderField) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Default) {
|
|
toSerialize["default"] = o.Default
|
|
}
|
|
if !IsNil(o.Help) {
|
|
toSerialize["help"] = o.Help
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Options) {
|
|
toSerialize["options"] = o.Options
|
|
}
|
|
if !IsNil(o.Required) {
|
|
toSerialize["required"] = o.Required
|
|
}
|
|
if !IsNil(o.Secret) {
|
|
toSerialize["secret"] = o.Secret
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProviderField) UnmarshalJSON(data []byte) (err error) {
|
|
varProviderField := _ProviderField{}
|
|
|
|
err = json.Unmarshal(data, &varProviderField)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProviderField(varProviderField)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "default")
|
|
delete(additionalProperties, "help")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "options")
|
|
delete(additionalProperties, "required")
|
|
delete(additionalProperties, "secret")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProviderField struct {
|
|
value *ProviderField
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProviderField) Get() *ProviderField {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProviderField) Set(val *ProviderField) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProviderField) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProviderField) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProviderField(val *ProviderField) *NullableProviderField {
|
|
return &NullableProviderField{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProviderField) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProviderField) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|