Files
sdk/model_o11y_http_client_config.go

611 lines
19 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 O11yHTTPClientConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yHTTPClientConfig{}
// O11yHTTPClientConfig struct for O11yHTTPClientConfig
type O11yHTTPClientConfig struct {
// The HTTP authorization credentials for the targets.
Authorization *O11yAuthorization `json:"authorization,omitempty"`
// The HTTP basic authentication credentials for the targets.
BasicAuth *O11yBasicAuth `json:"basic_auth,omitempty"`
BearerToken interface{} `json:"bearer_token,omitempty"`
// The bearer token file for the targets. Deprecated in favour of Authorization.CredentialsFile.
BearerTokenFile *string `json:"bearer_token_file,omitempty"`
// EnableHTTP2 specifies whether the client should configure HTTP2. The omitempty flag is not set, because it would be hidden from the marshalled configuration when set to false.
EnableHttp2 *bool `json:"enable_http2,omitempty"`
// FollowRedirects specifies whether the client should follow HTTP 3xx redirects. The omitempty flag is not set, because it would be hidden from the marshalled configuration when set to false.
FollowRedirects *bool `json:"follow_redirects,omitempty"`
HttpHeaders interface{} `json:"http_headers,omitempty"`
// NoProxy contains addresses that should not use a proxy.
NoProxy *string `json:"no_proxy,omitempty"`
// The OAuth2 client credentials used to fetch a token for the targets.
Oauth2 *O11yOAuth2 `json:"oauth2,omitempty"`
// ProxyConnectHeader optionally specifies headers to send to proxies during CONNECT requests. Assume that at least _some_ of these headers are going to contain secrets and use Secret as the value type instead of string.
ProxyConnectHeader map[string][]interface{} `json:"proxy_connect_header,omitempty"`
// ProxyFromEnvironment makes use of net/http ProxyFromEnvironment function to determine proxies.
ProxyFromEnvironment *bool `json:"proxy_from_environment,omitempty"`
ProxyUrl interface{} `json:"proxy_url,omitempty"`
// TLSConfig to use to connect to the targets.
TlsConfig *O11yTLSConfig `json:"tls_config,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yHTTPClientConfig O11yHTTPClientConfig
// NewO11yHTTPClientConfig instantiates a new O11yHTTPClientConfig 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 NewO11yHTTPClientConfig() *O11yHTTPClientConfig {
this := O11yHTTPClientConfig{}
return &this
}
// NewO11yHTTPClientConfigWithDefaults instantiates a new O11yHTTPClientConfig 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 NewO11yHTTPClientConfigWithDefaults() *O11yHTTPClientConfig {
this := O11yHTTPClientConfig{}
return &this
}
// GetAuthorization returns the Authorization field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetAuthorization() O11yAuthorization {
if o == nil || IsNil(o.Authorization) {
var ret O11yAuthorization
return ret
}
return *o.Authorization
}
// GetAuthorizationOk returns a tuple with the Authorization field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetAuthorizationOk() (*O11yAuthorization, bool) {
if o == nil || IsNil(o.Authorization) {
return nil, false
}
return o.Authorization, true
}
// HasAuthorization returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasAuthorization() bool {
if o != nil && !IsNil(o.Authorization) {
return true
}
return false
}
// SetAuthorization gets a reference to the given O11yAuthorization and assigns it to the Authorization field.
func (o *O11yHTTPClientConfig) SetAuthorization(v O11yAuthorization) {
o.Authorization = &v
}
// GetBasicAuth returns the BasicAuth field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetBasicAuth() O11yBasicAuth {
if o == nil || IsNil(o.BasicAuth) {
var ret O11yBasicAuth
return ret
}
return *o.BasicAuth
}
// GetBasicAuthOk returns a tuple with the BasicAuth field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetBasicAuthOk() (*O11yBasicAuth, bool) {
if o == nil || IsNil(o.BasicAuth) {
return nil, false
}
return o.BasicAuth, true
}
// HasBasicAuth returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasBasicAuth() bool {
if o != nil && !IsNil(o.BasicAuth) {
return true
}
return false
}
// SetBasicAuth gets a reference to the given O11yBasicAuth and assigns it to the BasicAuth field.
func (o *O11yHTTPClientConfig) SetBasicAuth(v O11yBasicAuth) {
o.BasicAuth = &v
}
// GetBearerToken returns the BearerToken field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11yHTTPClientConfig) GetBearerToken() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.BearerToken
}
// GetBearerTokenOk returns a tuple with the BearerToken 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 *O11yHTTPClientConfig) GetBearerTokenOk() (*interface{}, bool) {
if o == nil || IsNil(o.BearerToken) {
return nil, false
}
return &o.BearerToken, true
}
// HasBearerToken returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasBearerToken() bool {
if o != nil && !IsNil(o.BearerToken) {
return true
}
return false
}
// SetBearerToken gets a reference to the given interface{} and assigns it to the BearerToken field.
func (o *O11yHTTPClientConfig) SetBearerToken(v interface{}) {
o.BearerToken = v
}
// GetBearerTokenFile returns the BearerTokenFile field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetBearerTokenFile() string {
if o == nil || IsNil(o.BearerTokenFile) {
var ret string
return ret
}
return *o.BearerTokenFile
}
// GetBearerTokenFileOk returns a tuple with the BearerTokenFile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetBearerTokenFileOk() (*string, bool) {
if o == nil || IsNil(o.BearerTokenFile) {
return nil, false
}
return o.BearerTokenFile, true
}
// HasBearerTokenFile returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasBearerTokenFile() bool {
if o != nil && !IsNil(o.BearerTokenFile) {
return true
}
return false
}
// SetBearerTokenFile gets a reference to the given string and assigns it to the BearerTokenFile field.
func (o *O11yHTTPClientConfig) SetBearerTokenFile(v string) {
o.BearerTokenFile = &v
}
// GetEnableHttp2 returns the EnableHttp2 field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetEnableHttp2() bool {
if o == nil || IsNil(o.EnableHttp2) {
var ret bool
return ret
}
return *o.EnableHttp2
}
// GetEnableHttp2Ok returns a tuple with the EnableHttp2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetEnableHttp2Ok() (*bool, bool) {
if o == nil || IsNil(o.EnableHttp2) {
return nil, false
}
return o.EnableHttp2, true
}
// HasEnableHttp2 returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasEnableHttp2() bool {
if o != nil && !IsNil(o.EnableHttp2) {
return true
}
return false
}
// SetEnableHttp2 gets a reference to the given bool and assigns it to the EnableHttp2 field.
func (o *O11yHTTPClientConfig) SetEnableHttp2(v bool) {
o.EnableHttp2 = &v
}
// GetFollowRedirects returns the FollowRedirects field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetFollowRedirects() bool {
if o == nil || IsNil(o.FollowRedirects) {
var ret bool
return ret
}
return *o.FollowRedirects
}
// GetFollowRedirectsOk returns a tuple with the FollowRedirects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetFollowRedirectsOk() (*bool, bool) {
if o == nil || IsNil(o.FollowRedirects) {
return nil, false
}
return o.FollowRedirects, true
}
// HasFollowRedirects returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasFollowRedirects() bool {
if o != nil && !IsNil(o.FollowRedirects) {
return true
}
return false
}
// SetFollowRedirects gets a reference to the given bool and assigns it to the FollowRedirects field.
func (o *O11yHTTPClientConfig) SetFollowRedirects(v bool) {
o.FollowRedirects = &v
}
// GetHttpHeaders returns the HttpHeaders field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11yHTTPClientConfig) GetHttpHeaders() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.HttpHeaders
}
// GetHttpHeadersOk returns a tuple with the HttpHeaders 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 *O11yHTTPClientConfig) GetHttpHeadersOk() (*interface{}, bool) {
if o == nil || IsNil(o.HttpHeaders) {
return nil, false
}
return &o.HttpHeaders, true
}
// HasHttpHeaders returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasHttpHeaders() bool {
if o != nil && !IsNil(o.HttpHeaders) {
return true
}
return false
}
// SetHttpHeaders gets a reference to the given interface{} and assigns it to the HttpHeaders field.
func (o *O11yHTTPClientConfig) SetHttpHeaders(v interface{}) {
o.HttpHeaders = v
}
// GetNoProxy returns the NoProxy field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetNoProxy() string {
if o == nil || IsNil(o.NoProxy) {
var ret string
return ret
}
return *o.NoProxy
}
// GetNoProxyOk returns a tuple with the NoProxy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetNoProxyOk() (*string, bool) {
if o == nil || IsNil(o.NoProxy) {
return nil, false
}
return o.NoProxy, true
}
// HasNoProxy returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasNoProxy() bool {
if o != nil && !IsNil(o.NoProxy) {
return true
}
return false
}
// SetNoProxy gets a reference to the given string and assigns it to the NoProxy field.
func (o *O11yHTTPClientConfig) SetNoProxy(v string) {
o.NoProxy = &v
}
// GetOauth2 returns the Oauth2 field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetOauth2() O11yOAuth2 {
if o == nil || IsNil(o.Oauth2) {
var ret O11yOAuth2
return ret
}
return *o.Oauth2
}
// GetOauth2Ok returns a tuple with the Oauth2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetOauth2Ok() (*O11yOAuth2, bool) {
if o == nil || IsNil(o.Oauth2) {
return nil, false
}
return o.Oauth2, true
}
// HasOauth2 returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasOauth2() bool {
if o != nil && !IsNil(o.Oauth2) {
return true
}
return false
}
// SetOauth2 gets a reference to the given O11yOAuth2 and assigns it to the Oauth2 field.
func (o *O11yHTTPClientConfig) SetOauth2(v O11yOAuth2) {
o.Oauth2 = &v
}
// GetProxyConnectHeader returns the ProxyConnectHeader field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetProxyConnectHeader() map[string][]interface{} {
if o == nil || IsNil(o.ProxyConnectHeader) {
var ret map[string][]interface{}
return ret
}
return o.ProxyConnectHeader
}
// GetProxyConnectHeaderOk returns a tuple with the ProxyConnectHeader field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetProxyConnectHeaderOk() (map[string][]interface{}, bool) {
if o == nil || IsNil(o.ProxyConnectHeader) {
return map[string][]interface{}{}, false
}
return o.ProxyConnectHeader, true
}
// HasProxyConnectHeader returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasProxyConnectHeader() bool {
if o != nil && !IsNil(o.ProxyConnectHeader) {
return true
}
return false
}
// SetProxyConnectHeader gets a reference to the given map[string][]interface{} and assigns it to the ProxyConnectHeader field.
func (o *O11yHTTPClientConfig) SetProxyConnectHeader(v map[string][]interface{}) {
o.ProxyConnectHeader = v
}
// GetProxyFromEnvironment returns the ProxyFromEnvironment field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetProxyFromEnvironment() bool {
if o == nil || IsNil(o.ProxyFromEnvironment) {
var ret bool
return ret
}
return *o.ProxyFromEnvironment
}
// GetProxyFromEnvironmentOk returns a tuple with the ProxyFromEnvironment field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetProxyFromEnvironmentOk() (*bool, bool) {
if o == nil || IsNil(o.ProxyFromEnvironment) {
return nil, false
}
return o.ProxyFromEnvironment, true
}
// HasProxyFromEnvironment returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasProxyFromEnvironment() bool {
if o != nil && !IsNil(o.ProxyFromEnvironment) {
return true
}
return false
}
// SetProxyFromEnvironment gets a reference to the given bool and assigns it to the ProxyFromEnvironment field.
func (o *O11yHTTPClientConfig) SetProxyFromEnvironment(v bool) {
o.ProxyFromEnvironment = &v
}
// GetProxyUrl returns the ProxyUrl field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11yHTTPClientConfig) GetProxyUrl() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.ProxyUrl
}
// GetProxyUrlOk returns a tuple with the ProxyUrl 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 *O11yHTTPClientConfig) GetProxyUrlOk() (*interface{}, bool) {
if o == nil || IsNil(o.ProxyUrl) {
return nil, false
}
return &o.ProxyUrl, true
}
// HasProxyUrl returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasProxyUrl() bool {
if o != nil && !IsNil(o.ProxyUrl) {
return true
}
return false
}
// SetProxyUrl gets a reference to the given interface{} and assigns it to the ProxyUrl field.
func (o *O11yHTTPClientConfig) SetProxyUrl(v interface{}) {
o.ProxyUrl = v
}
// GetTlsConfig returns the TlsConfig field value if set, zero value otherwise.
func (o *O11yHTTPClientConfig) GetTlsConfig() O11yTLSConfig {
if o == nil || IsNil(o.TlsConfig) {
var ret O11yTLSConfig
return ret
}
return *o.TlsConfig
}
// GetTlsConfigOk returns a tuple with the TlsConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHTTPClientConfig) GetTlsConfigOk() (*O11yTLSConfig, bool) {
if o == nil || IsNil(o.TlsConfig) {
return nil, false
}
return o.TlsConfig, true
}
// HasTlsConfig returns a boolean if a field has been set.
func (o *O11yHTTPClientConfig) HasTlsConfig() bool {
if o != nil && !IsNil(o.TlsConfig) {
return true
}
return false
}
// SetTlsConfig gets a reference to the given O11yTLSConfig and assigns it to the TlsConfig field.
func (o *O11yHTTPClientConfig) SetTlsConfig(v O11yTLSConfig) {
o.TlsConfig = &v
}
func (o O11yHTTPClientConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yHTTPClientConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Authorization) {
toSerialize["authorization"] = o.Authorization
}
if !IsNil(o.BasicAuth) {
toSerialize["basic_auth"] = o.BasicAuth
}
if o.BearerToken != nil {
toSerialize["bearer_token"] = o.BearerToken
}
if !IsNil(o.BearerTokenFile) {
toSerialize["bearer_token_file"] = o.BearerTokenFile
}
if !IsNil(o.EnableHttp2) {
toSerialize["enable_http2"] = o.EnableHttp2
}
if !IsNil(o.FollowRedirects) {
toSerialize["follow_redirects"] = o.FollowRedirects
}
if o.HttpHeaders != nil {
toSerialize["http_headers"] = o.HttpHeaders
}
if !IsNil(o.NoProxy) {
toSerialize["no_proxy"] = o.NoProxy
}
if !IsNil(o.Oauth2) {
toSerialize["oauth2"] = o.Oauth2
}
if !IsNil(o.ProxyConnectHeader) {
toSerialize["proxy_connect_header"] = o.ProxyConnectHeader
}
if !IsNil(o.ProxyFromEnvironment) {
toSerialize["proxy_from_environment"] = o.ProxyFromEnvironment
}
if o.ProxyUrl != nil {
toSerialize["proxy_url"] = o.ProxyUrl
}
if !IsNil(o.TlsConfig) {
toSerialize["tls_config"] = o.TlsConfig
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yHTTPClientConfig) UnmarshalJSON(data []byte) (err error) {
varO11yHTTPClientConfig := _O11yHTTPClientConfig{}
err = json.Unmarshal(data, &varO11yHTTPClientConfig)
if err != nil {
return err
}
*o = O11yHTTPClientConfig(varO11yHTTPClientConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "authorization")
delete(additionalProperties, "basic_auth")
delete(additionalProperties, "bearer_token")
delete(additionalProperties, "bearer_token_file")
delete(additionalProperties, "enable_http2")
delete(additionalProperties, "follow_redirects")
delete(additionalProperties, "http_headers")
delete(additionalProperties, "no_proxy")
delete(additionalProperties, "oauth2")
delete(additionalProperties, "proxy_connect_header")
delete(additionalProperties, "proxy_from_environment")
delete(additionalProperties, "proxy_url")
delete(additionalProperties, "tls_config")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yHTTPClientConfig struct {
value *O11yHTTPClientConfig
isSet bool
}
func (v NullableO11yHTTPClientConfig) Get() *O11yHTTPClientConfig {
return v.value
}
func (v *NullableO11yHTTPClientConfig) Set(val *O11yHTTPClientConfig) {
v.value = val
v.isSet = true
}
func (v NullableO11yHTTPClientConfig) IsSet() bool {
return v.isSet
}
func (v *NullableO11yHTTPClientConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yHTTPClientConfig(val *O11yHTTPClientConfig) *NullableO11yHTTPClientConfig {
return &NullableO11yHTTPClientConfig{value: val, isSet: true}
}
func (v NullableO11yHTTPClientConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yHTTPClientConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}