## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
271 lines
9.4 KiB
Go
271 lines
9.4 KiB
Go
/*
|
|
CDN API
|
|
|
|
API used to create and manage your CDN distributions.
|
|
|
|
API version: 1beta2.0.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package cdnbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &HttpBackendPatch{}
|
|
|
|
/*
|
|
types and functions for geofencing
|
|
*/
|
|
|
|
// isContainer
|
|
type HttpBackendPatchGetGeofencingAttributeType = *map[string][]string
|
|
type HttpBackendPatchGetGeofencingArgType = map[string][]string
|
|
type HttpBackendPatchGetGeofencingRetType = map[string][]string
|
|
|
|
func getHttpBackendPatchGetGeofencingAttributeTypeOk(arg HttpBackendPatchGetGeofencingAttributeType) (ret HttpBackendPatchGetGeofencingRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setHttpBackendPatchGetGeofencingAttributeType(arg *HttpBackendPatchGetGeofencingAttributeType, val HttpBackendPatchGetGeofencingRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for originRequestHeaders
|
|
*/
|
|
|
|
// isContainer
|
|
type HttpBackendPatchGetOriginRequestHeadersAttributeType = *map[string]string
|
|
type HttpBackendPatchGetOriginRequestHeadersArgType = map[string]string
|
|
type HttpBackendPatchGetOriginRequestHeadersRetType = map[string]string
|
|
|
|
func getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendPatchGetOriginRequestHeadersAttributeType) (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setHttpBackendPatchGetOriginRequestHeadersAttributeType(arg *HttpBackendPatchGetOriginRequestHeadersAttributeType, val HttpBackendPatchGetOriginRequestHeadersRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for originUrl
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type HttpBackendPatchGetOriginUrlAttributeType = *string
|
|
|
|
func getHttpBackendPatchGetOriginUrlAttributeTypeOk(arg HttpBackendPatchGetOriginUrlAttributeType) (ret HttpBackendPatchGetOriginUrlRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setHttpBackendPatchGetOriginUrlAttributeType(arg *HttpBackendPatchGetOriginUrlAttributeType, val HttpBackendPatchGetOriginUrlRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type HttpBackendPatchGetOriginUrlArgType = string
|
|
type HttpBackendPatchGetOriginUrlRetType = string
|
|
|
|
/*
|
|
types and functions for type
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type HttpBackendPatchGetTypeAttributeType = *string
|
|
|
|
func getHttpBackendPatchGetTypeAttributeTypeOk(arg HttpBackendPatchGetTypeAttributeType) (ret HttpBackendPatchGetTypeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setHttpBackendPatchGetTypeAttributeType(arg *HttpBackendPatchGetTypeAttributeType, val HttpBackendPatchGetTypeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type HttpBackendPatchGetTypeArgType = string
|
|
type HttpBackendPatchGetTypeRetType = string
|
|
|
|
// HttpBackendPatch A partial HTTP Backend
|
|
type HttpBackendPatch struct {
|
|
// An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins.
|
|
Geofencing HttpBackendPatchGetGeofencingAttributeType `json:"geofencing,omitempty"`
|
|
// Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text.
|
|
OriginRequestHeaders HttpBackendPatchGetOriginRequestHeadersAttributeType `json:"originRequestHeaders,omitempty"`
|
|
OriginUrl HttpBackendPatchGetOriginUrlAttributeType `json:"originUrl,omitempty"`
|
|
// This property is required to determine the used backend type.
|
|
// REQUIRED
|
|
Type HttpBackendPatchGetTypeAttributeType `json:"type" required:"true"`
|
|
}
|
|
|
|
type _HttpBackendPatch HttpBackendPatch
|
|
|
|
// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types HttpBackendPatchGetTypeArgType) *HttpBackendPatch {
|
|
this := HttpBackendPatch{}
|
|
setHttpBackendPatchGetTypeAttributeType(&this.Type, types)
|
|
return &this
|
|
}
|
|
|
|
// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch {
|
|
this := HttpBackendPatch{}
|
|
return &this
|
|
}
|
|
|
|
// GetGeofencing returns the Geofencing field value if set, zero value otherwise.
|
|
func (o *HttpBackendPatch) GetGeofencing() (res HttpBackendPatchGetGeofencingRetType) {
|
|
res, _ = o.GetGeofencingOk()
|
|
return
|
|
}
|
|
|
|
// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *HttpBackendPatch) GetGeofencingOk() (ret HttpBackendPatchGetGeofencingRetType, ok bool) {
|
|
return getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing)
|
|
}
|
|
|
|
// HasGeofencing returns a boolean if a field has been set.
|
|
func (o *HttpBackendPatch) HasGeofencing() bool {
|
|
_, ok := o.GetGeofencingOk()
|
|
return ok
|
|
}
|
|
|
|
// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field.
|
|
func (o *HttpBackendPatch) SetGeofencing(v HttpBackendPatchGetGeofencingRetType) {
|
|
setHttpBackendPatchGetGeofencingAttributeType(&o.Geofencing, v)
|
|
}
|
|
|
|
// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise.
|
|
func (o *HttpBackendPatch) GetOriginRequestHeaders() (res HttpBackendPatchGetOriginRequestHeadersRetType) {
|
|
res, _ = o.GetOriginRequestHeadersOk()
|
|
return
|
|
}
|
|
|
|
// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) {
|
|
return getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders)
|
|
}
|
|
|
|
// HasOriginRequestHeaders returns a boolean if a field has been set.
|
|
func (o *HttpBackendPatch) HasOriginRequestHeaders() bool {
|
|
_, ok := o.GetOriginRequestHeadersOk()
|
|
return ok
|
|
}
|
|
|
|
// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field.
|
|
func (o *HttpBackendPatch) SetOriginRequestHeaders(v HttpBackendPatchGetOriginRequestHeadersRetType) {
|
|
setHttpBackendPatchGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v)
|
|
}
|
|
|
|
// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise.
|
|
func (o *HttpBackendPatch) GetOriginUrl() (res HttpBackendPatchGetOriginUrlRetType) {
|
|
res, _ = o.GetOriginUrlOk()
|
|
return
|
|
}
|
|
|
|
// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *HttpBackendPatch) GetOriginUrlOk() (ret HttpBackendPatchGetOriginUrlRetType, ok bool) {
|
|
return getHttpBackendPatchGetOriginUrlAttributeTypeOk(o.OriginUrl)
|
|
}
|
|
|
|
// HasOriginUrl returns a boolean if a field has been set.
|
|
func (o *HttpBackendPatch) HasOriginUrl() bool {
|
|
_, ok := o.GetOriginUrlOk()
|
|
return ok
|
|
}
|
|
|
|
// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field.
|
|
func (o *HttpBackendPatch) SetOriginUrl(v HttpBackendPatchGetOriginUrlRetType) {
|
|
setHttpBackendPatchGetOriginUrlAttributeType(&o.OriginUrl, v)
|
|
}
|
|
|
|
// GetType returns the Type field value
|
|
func (o *HttpBackendPatch) GetType() (ret HttpBackendPatchGetTypeRetType) {
|
|
ret, _ = o.GetTypeOk()
|
|
return ret
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *HttpBackendPatch) GetTypeOk() (ret HttpBackendPatchGetTypeRetType, ok bool) {
|
|
return getHttpBackendPatchGetTypeAttributeTypeOk(o.Type)
|
|
}
|
|
|
|
// SetType sets field value
|
|
func (o *HttpBackendPatch) SetType(v HttpBackendPatchGetTypeRetType) {
|
|
setHttpBackendPatchGetTypeAttributeType(&o.Type, v)
|
|
}
|
|
|
|
func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing); ok {
|
|
toSerialize["Geofencing"] = val
|
|
}
|
|
if val, ok := getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders); ok {
|
|
toSerialize["OriginRequestHeaders"] = val
|
|
}
|
|
if val, ok := getHttpBackendPatchGetOriginUrlAttributeTypeOk(o.OriginUrl); ok {
|
|
toSerialize["OriginUrl"] = val
|
|
}
|
|
if val, ok := getHttpBackendPatchGetTypeAttributeTypeOk(o.Type); ok {
|
|
toSerialize["Type"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableHttpBackendPatch struct {
|
|
value *HttpBackendPatch
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableHttpBackendPatch) Get() *HttpBackendPatch {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableHttpBackendPatch) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableHttpBackendPatch) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch {
|
|
return &NullableHttpBackendPatch{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|