## 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>
176 lines
6 KiB
Go
176 lines
6 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 PatchDistributionPayload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PatchDistributionPayload{}
|
|
|
|
/*
|
|
types and functions for config
|
|
*/
|
|
|
|
// isModel
|
|
type PatchDistributionPayloadGetConfigAttributeType = *ConfigPatch
|
|
type PatchDistributionPayloadGetConfigArgType = ConfigPatch
|
|
type PatchDistributionPayloadGetConfigRetType = ConfigPatch
|
|
|
|
func getPatchDistributionPayloadGetConfigAttributeTypeOk(arg PatchDistributionPayloadGetConfigAttributeType) (ret PatchDistributionPayloadGetConfigRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPatchDistributionPayloadGetConfigAttributeType(arg *PatchDistributionPayloadGetConfigAttributeType, val PatchDistributionPayloadGetConfigRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for intentId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PatchDistributionPayloadGetIntentIdAttributeType = *string
|
|
|
|
func getPatchDistributionPayloadGetIntentIdAttributeTypeOk(arg PatchDistributionPayloadGetIntentIdAttributeType) (ret PatchDistributionPayloadGetIntentIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPatchDistributionPayloadGetIntentIdAttributeType(arg *PatchDistributionPayloadGetIntentIdAttributeType, val PatchDistributionPayloadGetIntentIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PatchDistributionPayloadGetIntentIdArgType = string
|
|
type PatchDistributionPayloadGetIntentIdRetType = string
|
|
|
|
// PatchDistributionPayload Defines a partial distribution. Set values
|
|
type PatchDistributionPayload struct {
|
|
Config PatchDistributionPayloadGetConfigAttributeType `json:"config,omitempty"`
|
|
// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped.
|
|
IntentId PatchDistributionPayloadGetIntentIdAttributeType `json:"intentId,omitempty"`
|
|
}
|
|
|
|
// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload {
|
|
this := PatchDistributionPayload{}
|
|
return &this
|
|
}
|
|
|
|
// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload {
|
|
this := PatchDistributionPayload{}
|
|
return &this
|
|
}
|
|
|
|
// GetConfig returns the Config field value if set, zero value otherwise.
|
|
func (o *PatchDistributionPayload) GetConfig() (res PatchDistributionPayloadGetConfigRetType) {
|
|
res, _ = o.GetConfigOk()
|
|
return
|
|
}
|
|
|
|
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PatchDistributionPayload) GetConfigOk() (ret PatchDistributionPayloadGetConfigRetType, ok bool) {
|
|
return getPatchDistributionPayloadGetConfigAttributeTypeOk(o.Config)
|
|
}
|
|
|
|
// HasConfig returns a boolean if a field has been set.
|
|
func (o *PatchDistributionPayload) HasConfig() bool {
|
|
_, ok := o.GetConfigOk()
|
|
return ok
|
|
}
|
|
|
|
// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field.
|
|
func (o *PatchDistributionPayload) SetConfig(v PatchDistributionPayloadGetConfigRetType) {
|
|
setPatchDistributionPayloadGetConfigAttributeType(&o.Config, v)
|
|
}
|
|
|
|
// GetIntentId returns the IntentId field value if set, zero value otherwise.
|
|
func (o *PatchDistributionPayload) GetIntentId() (res PatchDistributionPayloadGetIntentIdRetType) {
|
|
res, _ = o.GetIntentIdOk()
|
|
return
|
|
}
|
|
|
|
// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PatchDistributionPayload) GetIntentIdOk() (ret PatchDistributionPayloadGetIntentIdRetType, ok bool) {
|
|
return getPatchDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId)
|
|
}
|
|
|
|
// HasIntentId returns a boolean if a field has been set.
|
|
func (o *PatchDistributionPayload) HasIntentId() bool {
|
|
_, ok := o.GetIntentIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetIntentId gets a reference to the given string and assigns it to the IntentId field.
|
|
func (o *PatchDistributionPayload) SetIntentId(v PatchDistributionPayloadGetIntentIdRetType) {
|
|
setPatchDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v)
|
|
}
|
|
|
|
func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getPatchDistributionPayloadGetConfigAttributeTypeOk(o.Config); ok {
|
|
toSerialize["Config"] = val
|
|
}
|
|
if val, ok := getPatchDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId); ok {
|
|
toSerialize["IntentId"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullablePatchDistributionPayload struct {
|
|
value *PatchDistributionPayload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePatchDistributionPayload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePatchDistributionPayload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload {
|
|
return &NullablePatchDistributionPayload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|