mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
267 lines
7.4 KiB
Go
267 lines
7.4 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 O11yAuthorization type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yAuthorization{}
|
|
|
|
// O11yAuthorization struct for O11yAuthorization
|
|
type O11yAuthorization struct {
|
|
Credentials interface{} `json:"credentials,omitempty"`
|
|
CredentialsFile *string `json:"credentials_file,omitempty"`
|
|
// CredentialsRef is the name of the secret within the secret manager to use as credentials.
|
|
CredentialsRef *string `json:"credentials_ref,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yAuthorization O11yAuthorization
|
|
|
|
// NewO11yAuthorization instantiates a new O11yAuthorization 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 NewO11yAuthorization() *O11yAuthorization {
|
|
this := O11yAuthorization{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yAuthorizationWithDefaults instantiates a new O11yAuthorization 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 NewO11yAuthorizationWithDefaults() *O11yAuthorization {
|
|
this := O11yAuthorization{}
|
|
return &this
|
|
}
|
|
|
|
// GetCredentials returns the Credentials field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *O11yAuthorization) GetCredentials() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Credentials
|
|
}
|
|
|
|
// GetCredentialsOk returns a tuple with the Credentials 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 *O11yAuthorization) GetCredentialsOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Credentials) {
|
|
return nil, false
|
|
}
|
|
return &o.Credentials, true
|
|
}
|
|
|
|
// HasCredentials returns a boolean if a field has been set.
|
|
func (o *O11yAuthorization) HasCredentials() bool {
|
|
if o != nil && !IsNil(o.Credentials) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCredentials gets a reference to the given interface{} and assigns it to the Credentials field.
|
|
func (o *O11yAuthorization) SetCredentials(v interface{}) {
|
|
o.Credentials = v
|
|
}
|
|
|
|
// GetCredentialsFile returns the CredentialsFile field value if set, zero value otherwise.
|
|
func (o *O11yAuthorization) GetCredentialsFile() string {
|
|
if o == nil || IsNil(o.CredentialsFile) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CredentialsFile
|
|
}
|
|
|
|
// GetCredentialsFileOk returns a tuple with the CredentialsFile field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yAuthorization) GetCredentialsFileOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CredentialsFile) {
|
|
return nil, false
|
|
}
|
|
return o.CredentialsFile, true
|
|
}
|
|
|
|
// HasCredentialsFile returns a boolean if a field has been set.
|
|
func (o *O11yAuthorization) HasCredentialsFile() bool {
|
|
if o != nil && !IsNil(o.CredentialsFile) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCredentialsFile gets a reference to the given string and assigns it to the CredentialsFile field.
|
|
func (o *O11yAuthorization) SetCredentialsFile(v string) {
|
|
o.CredentialsFile = &v
|
|
}
|
|
|
|
// GetCredentialsRef returns the CredentialsRef field value if set, zero value otherwise.
|
|
func (o *O11yAuthorization) GetCredentialsRef() string {
|
|
if o == nil || IsNil(o.CredentialsRef) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CredentialsRef
|
|
}
|
|
|
|
// GetCredentialsRefOk returns a tuple with the CredentialsRef field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yAuthorization) GetCredentialsRefOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CredentialsRef) {
|
|
return nil, false
|
|
}
|
|
return o.CredentialsRef, true
|
|
}
|
|
|
|
// HasCredentialsRef returns a boolean if a field has been set.
|
|
func (o *O11yAuthorization) HasCredentialsRef() bool {
|
|
if o != nil && !IsNil(o.CredentialsRef) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCredentialsRef gets a reference to the given string and assigns it to the CredentialsRef field.
|
|
func (o *O11yAuthorization) SetCredentialsRef(v string) {
|
|
o.CredentialsRef = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *O11yAuthorization) 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 *O11yAuthorization) 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 *O11yAuthorization) 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 *O11yAuthorization) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o O11yAuthorization) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yAuthorization) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Credentials != nil {
|
|
toSerialize["credentials"] = o.Credentials
|
|
}
|
|
if !IsNil(o.CredentialsFile) {
|
|
toSerialize["credentials_file"] = o.CredentialsFile
|
|
}
|
|
if !IsNil(o.CredentialsRef) {
|
|
toSerialize["credentials_ref"] = o.CredentialsRef
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yAuthorization) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yAuthorization := _O11yAuthorization{}
|
|
|
|
err = json.Unmarshal(data, &varO11yAuthorization)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yAuthorization(varO11yAuthorization)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "credentials")
|
|
delete(additionalProperties, "credentials_file")
|
|
delete(additionalProperties, "credentials_ref")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yAuthorization struct {
|
|
value *O11yAuthorization
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yAuthorization) Get() *O11yAuthorization {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yAuthorization) Set(val *O11yAuthorization) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yAuthorization) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yAuthorization) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yAuthorization(val *O11yAuthorization) *NullableO11yAuthorization {
|
|
return &NullableO11yAuthorization{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yAuthorization) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yAuthorization) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|