mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
342 lines
9.3 KiB
Go
342 lines
9.3 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 O11yBasicAuth type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yBasicAuth{}
|
|
|
|
// O11yBasicAuth struct for O11yBasicAuth
|
|
type O11yBasicAuth struct {
|
|
Password interface{} `json:"password,omitempty"`
|
|
PasswordFile *string `json:"password_file,omitempty"`
|
|
// PasswordRef is the name of the secret within the secret manager to use as the password.
|
|
PasswordRef *string `json:"password_ref,omitempty"`
|
|
Username *string `json:"username,omitempty"`
|
|
UsernameFile *string `json:"username_file,omitempty"`
|
|
// UsernameRef is the name of the secret within the secret manager to use as the username.
|
|
UsernameRef *string `json:"username_ref,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yBasicAuth O11yBasicAuth
|
|
|
|
// NewO11yBasicAuth instantiates a new O11yBasicAuth 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 NewO11yBasicAuth() *O11yBasicAuth {
|
|
this := O11yBasicAuth{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yBasicAuthWithDefaults instantiates a new O11yBasicAuth 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 NewO11yBasicAuthWithDefaults() *O11yBasicAuth {
|
|
this := O11yBasicAuth{}
|
|
return &this
|
|
}
|
|
|
|
// GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yBasicAuth) GetPassword() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Password
|
|
}
|
|
|
|
// GetPasswordOk returns a tuple with the Password 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 *O11yBasicAuth) GetPasswordOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Password) {
|
|
return nil, false
|
|
}
|
|
return &o.Password, true
|
|
}
|
|
|
|
// HasPassword returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasPassword() bool {
|
|
if o != nil && !IsNil(o.Password) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPassword gets a reference to the given interface{} and assigns it to the Password field.
|
|
func (o *O11yBasicAuth) SetPassword(v interface{}) {
|
|
o.Password = v
|
|
}
|
|
|
|
// GetPasswordFile returns the PasswordFile field value if set, zero value otherwise.
|
|
func (o *O11yBasicAuth) GetPasswordFile() string {
|
|
if o == nil || IsNil(o.PasswordFile) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.PasswordFile
|
|
}
|
|
|
|
// GetPasswordFileOk returns a tuple with the PasswordFile field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yBasicAuth) GetPasswordFileOk() (*string, bool) {
|
|
if o == nil || IsNil(o.PasswordFile) {
|
|
return nil, false
|
|
}
|
|
return o.PasswordFile, true
|
|
}
|
|
|
|
// HasPasswordFile returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasPasswordFile() bool {
|
|
if o != nil && !IsNil(o.PasswordFile) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPasswordFile gets a reference to the given string and assigns it to the PasswordFile field.
|
|
func (o *O11yBasicAuth) SetPasswordFile(v string) {
|
|
o.PasswordFile = &v
|
|
}
|
|
|
|
// GetPasswordRef returns the PasswordRef field value if set, zero value otherwise.
|
|
func (o *O11yBasicAuth) GetPasswordRef() string {
|
|
if o == nil || IsNil(o.PasswordRef) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.PasswordRef
|
|
}
|
|
|
|
// GetPasswordRefOk returns a tuple with the PasswordRef field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yBasicAuth) GetPasswordRefOk() (*string, bool) {
|
|
if o == nil || IsNil(o.PasswordRef) {
|
|
return nil, false
|
|
}
|
|
return o.PasswordRef, true
|
|
}
|
|
|
|
// HasPasswordRef returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasPasswordRef() bool {
|
|
if o != nil && !IsNil(o.PasswordRef) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPasswordRef gets a reference to the given string and assigns it to the PasswordRef field.
|
|
func (o *O11yBasicAuth) SetPasswordRef(v string) {
|
|
o.PasswordRef = &v
|
|
}
|
|
|
|
// GetUsername returns the Username field value if set, zero value otherwise.
|
|
func (o *O11yBasicAuth) GetUsername() string {
|
|
if o == nil || IsNil(o.Username) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Username
|
|
}
|
|
|
|
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yBasicAuth) GetUsernameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Username) {
|
|
return nil, false
|
|
}
|
|
return o.Username, true
|
|
}
|
|
|
|
// HasUsername returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasUsername() bool {
|
|
if o != nil && !IsNil(o.Username) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUsername gets a reference to the given string and assigns it to the Username field.
|
|
func (o *O11yBasicAuth) SetUsername(v string) {
|
|
o.Username = &v
|
|
}
|
|
|
|
// GetUsernameFile returns the UsernameFile field value if set, zero value otherwise.
|
|
func (o *O11yBasicAuth) GetUsernameFile() string {
|
|
if o == nil || IsNil(o.UsernameFile) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UsernameFile
|
|
}
|
|
|
|
// GetUsernameFileOk returns a tuple with the UsernameFile field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yBasicAuth) GetUsernameFileOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UsernameFile) {
|
|
return nil, false
|
|
}
|
|
return o.UsernameFile, true
|
|
}
|
|
|
|
// HasUsernameFile returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasUsernameFile() bool {
|
|
if o != nil && !IsNil(o.UsernameFile) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUsernameFile gets a reference to the given string and assigns it to the UsernameFile field.
|
|
func (o *O11yBasicAuth) SetUsernameFile(v string) {
|
|
o.UsernameFile = &v
|
|
}
|
|
|
|
// GetUsernameRef returns the UsernameRef field value if set, zero value otherwise.
|
|
func (o *O11yBasicAuth) GetUsernameRef() string {
|
|
if o == nil || IsNil(o.UsernameRef) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UsernameRef
|
|
}
|
|
|
|
// GetUsernameRefOk returns a tuple with the UsernameRef field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yBasicAuth) GetUsernameRefOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UsernameRef) {
|
|
return nil, false
|
|
}
|
|
return o.UsernameRef, true
|
|
}
|
|
|
|
// HasUsernameRef returns a boolean if a field has been set.
|
|
func (o *O11yBasicAuth) HasUsernameRef() bool {
|
|
if o != nil && !IsNil(o.UsernameRef) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUsernameRef gets a reference to the given string and assigns it to the UsernameRef field.
|
|
func (o *O11yBasicAuth) SetUsernameRef(v string) {
|
|
o.UsernameRef = &v
|
|
}
|
|
|
|
func (o O11yBasicAuth) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yBasicAuth) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Password != nil {
|
|
toSerialize["password"] = o.Password
|
|
}
|
|
if !IsNil(o.PasswordFile) {
|
|
toSerialize["password_file"] = o.PasswordFile
|
|
}
|
|
if !IsNil(o.PasswordRef) {
|
|
toSerialize["password_ref"] = o.PasswordRef
|
|
}
|
|
if !IsNil(o.Username) {
|
|
toSerialize["username"] = o.Username
|
|
}
|
|
if !IsNil(o.UsernameFile) {
|
|
toSerialize["username_file"] = o.UsernameFile
|
|
}
|
|
if !IsNil(o.UsernameRef) {
|
|
toSerialize["username_ref"] = o.UsernameRef
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yBasicAuth) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yBasicAuth := _O11yBasicAuth{}
|
|
|
|
err = json.Unmarshal(data, &varO11yBasicAuth)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yBasicAuth(varO11yBasicAuth)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "password")
|
|
delete(additionalProperties, "password_file")
|
|
delete(additionalProperties, "password_ref")
|
|
delete(additionalProperties, "username")
|
|
delete(additionalProperties, "username_file")
|
|
delete(additionalProperties, "username_ref")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yBasicAuth struct {
|
|
value *O11yBasicAuth
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yBasicAuth) Get() *O11yBasicAuth {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yBasicAuth) Set(val *O11yBasicAuth) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yBasicAuth) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yBasicAuth) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yBasicAuth(val *O11yBasicAuth) *NullableO11yBasicAuth {
|
|
return &NullableO11yBasicAuth{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yBasicAuth) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yBasicAuth) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|