## 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>
415 lines
11 KiB
Go
415 lines
11 KiB
Go
/*
|
|
STACKIT Git API
|
|
|
|
STACKIT Git management API.
|
|
|
|
API version: 1beta.0.4
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package gitbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the Flavor type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Flavor{}
|
|
|
|
/*
|
|
types and functions for availability
|
|
*/
|
|
|
|
// isEnum
|
|
|
|
// FlavorAvailability Defines the flavor availability.
|
|
// value type for enums
|
|
type FlavorAvailability string
|
|
|
|
// List of Availability
|
|
const (
|
|
FLAVORAVAILABILITY_AVAILABLE FlavorAvailability = "available"
|
|
FLAVORAVAILABILITY_UNAVAILABLE FlavorAvailability = "unavailable"
|
|
FLAVORAVAILABILITY_INTERNAL FlavorAvailability = "internal"
|
|
FLAVORAVAILABILITY_DEPRECATED FlavorAvailability = "deprecated"
|
|
)
|
|
|
|
// All allowed values of Flavor enum
|
|
var AllowedFlavorAvailabilityEnumValues = []FlavorAvailability{
|
|
"available",
|
|
"unavailable",
|
|
"internal",
|
|
"deprecated",
|
|
}
|
|
|
|
func (v *FlavorAvailability) UnmarshalJSON(src []byte) error {
|
|
// use a type alias to prevent infinite recursion during unmarshal,
|
|
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
|
|
type TmpJson FlavorAvailability
|
|
var value TmpJson
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Allow unmarshalling zero value for testing purposes
|
|
var zeroValue TmpJson
|
|
if value == zeroValue {
|
|
return nil
|
|
}
|
|
enumTypeValue := FlavorAvailability(value)
|
|
for _, existing := range AllowedFlavorAvailabilityEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid Flavor", value)
|
|
}
|
|
|
|
// NewFlavorAvailabilityFromValue returns a pointer to a valid FlavorAvailability
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewFlavorAvailabilityFromValue(v FlavorAvailability) (*FlavorAvailability, error) {
|
|
ev := FlavorAvailability(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for FlavorAvailability: valid values are %v", v, AllowedFlavorAvailabilityEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v FlavorAvailability) IsValid() bool {
|
|
for _, existing := range AllowedFlavorAvailabilityEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to AvailabilityAvailability value
|
|
func (v FlavorAvailability) Ptr() *FlavorAvailability {
|
|
return &v
|
|
}
|
|
|
|
type NullableFlavorAvailability struct {
|
|
value *FlavorAvailability
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFlavorAvailability) Get() *FlavorAvailability {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFlavorAvailability) Set(val *FlavorAvailability) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFlavorAvailability) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFlavorAvailability) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFlavorAvailability(val *FlavorAvailability) *NullableFlavorAvailability {
|
|
return &NullableFlavorAvailability{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFlavorAvailability) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFlavorAvailability) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
type FlavorGetAvailabilityAttributeType = *FlavorAvailability
|
|
type FlavorGetAvailabilityArgType = FlavorAvailability
|
|
type FlavorGetAvailabilityRetType = FlavorAvailability
|
|
|
|
func getFlavorGetAvailabilityAttributeTypeOk(arg FlavorGetAvailabilityAttributeType) (ret FlavorGetAvailabilityRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setFlavorGetAvailabilityAttributeType(arg *FlavorGetAvailabilityAttributeType, val FlavorGetAvailabilityRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for description
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type FlavorGetDescriptionAttributeType = *string
|
|
|
|
func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeType) (ret FlavorGetDescriptionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setFlavorGetDescriptionAttributeType(arg *FlavorGetDescriptionAttributeType, val FlavorGetDescriptionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type FlavorGetDescriptionArgType = string
|
|
type FlavorGetDescriptionRetType = string
|
|
|
|
/*
|
|
types and functions for display_name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type FlavorGetDisplayNameAttributeType = *string
|
|
|
|
func getFlavorGetDisplayNameAttributeTypeOk(arg FlavorGetDisplayNameAttributeType) (ret FlavorGetDisplayNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setFlavorGetDisplayNameAttributeType(arg *FlavorGetDisplayNameAttributeType, val FlavorGetDisplayNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type FlavorGetDisplayNameArgType = string
|
|
type FlavorGetDisplayNameRetType = string
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type FlavorGetIdAttributeType = *string
|
|
|
|
func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setFlavorGetIdAttributeType(arg *FlavorGetIdAttributeType, val FlavorGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type FlavorGetIdArgType = string
|
|
type FlavorGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for sku
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type FlavorGetSkuAttributeType = *string
|
|
|
|
func getFlavorGetSkuAttributeTypeOk(arg FlavorGetSkuAttributeType) (ret FlavorGetSkuRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setFlavorGetSkuAttributeType(arg *FlavorGetSkuAttributeType, val FlavorGetSkuRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type FlavorGetSkuArgType = string
|
|
type FlavorGetSkuRetType = string
|
|
|
|
// Flavor Describes a STACKIT Git Flavor.
|
|
type Flavor struct {
|
|
// Defines the flavor availability.
|
|
// REQUIRED
|
|
Availability FlavorGetAvailabilityAttributeType `json:"availability" required:"true"`
|
|
// Flavor description.
|
|
// REQUIRED
|
|
Description FlavorGetDescriptionAttributeType `json:"description" required:"true"`
|
|
// The display name that will be shown in the Portal.
|
|
// REQUIRED
|
|
DisplayName FlavorGetDisplayNameAttributeType `json:"display_name" required:"true"`
|
|
// Flavor id.
|
|
// REQUIRED
|
|
Id FlavorGetIdAttributeType `json:"id" required:"true"`
|
|
// SAP article number.
|
|
// REQUIRED
|
|
Sku FlavorGetSkuAttributeType `json:"sku" required:"true"`
|
|
}
|
|
|
|
type _Flavor Flavor
|
|
|
|
// NewFlavor instantiates a new Flavor 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 NewFlavor(availability FlavorGetAvailabilityArgType, description FlavorGetDescriptionArgType, displayName FlavorGetDisplayNameArgType, id FlavorGetIdArgType, sku FlavorGetSkuArgType) *Flavor {
|
|
this := Flavor{}
|
|
setFlavorGetAvailabilityAttributeType(&this.Availability, availability)
|
|
setFlavorGetDescriptionAttributeType(&this.Description, description)
|
|
setFlavorGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
|
setFlavorGetIdAttributeType(&this.Id, id)
|
|
setFlavorGetSkuAttributeType(&this.Sku, sku)
|
|
return &this
|
|
}
|
|
|
|
// NewFlavorWithDefaults instantiates a new Flavor 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 NewFlavorWithDefaults() *Flavor {
|
|
this := Flavor{}
|
|
return &this
|
|
}
|
|
|
|
// GetAvailability returns the Availability field value
|
|
func (o *Flavor) GetAvailability() (ret FlavorGetAvailabilityRetType) {
|
|
ret, _ = o.GetAvailabilityOk()
|
|
return ret
|
|
}
|
|
|
|
// GetAvailabilityOk returns a tuple with the Availability field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Flavor) GetAvailabilityOk() (ret FlavorGetAvailabilityRetType, ok bool) {
|
|
return getFlavorGetAvailabilityAttributeTypeOk(o.Availability)
|
|
}
|
|
|
|
// SetAvailability sets field value
|
|
func (o *Flavor) SetAvailability(v FlavorGetAvailabilityRetType) {
|
|
setFlavorGetAvailabilityAttributeType(&o.Availability, v)
|
|
}
|
|
|
|
// GetDescription returns the Description field value
|
|
func (o *Flavor) GetDescription() (ret FlavorGetDescriptionRetType) {
|
|
ret, _ = o.GetDescriptionOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDescriptionOk returns a tuple with the Description field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Flavor) GetDescriptionOk() (ret FlavorGetDescriptionRetType, ok bool) {
|
|
return getFlavorGetDescriptionAttributeTypeOk(o.Description)
|
|
}
|
|
|
|
// SetDescription sets field value
|
|
func (o *Flavor) SetDescription(v FlavorGetDescriptionRetType) {
|
|
setFlavorGetDescriptionAttributeType(&o.Description, v)
|
|
}
|
|
|
|
// GetDisplayName returns the DisplayName field value
|
|
func (o *Flavor) GetDisplayName() (ret FlavorGetDisplayNameRetType) {
|
|
ret, _ = o.GetDisplayNameOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDisplayNameOk returns a tuple with the DisplayName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Flavor) GetDisplayNameOk() (ret FlavorGetDisplayNameRetType, ok bool) {
|
|
return getFlavorGetDisplayNameAttributeTypeOk(o.DisplayName)
|
|
}
|
|
|
|
// SetDisplayName sets field value
|
|
func (o *Flavor) SetDisplayName(v FlavorGetDisplayNameRetType) {
|
|
setFlavorGetDisplayNameAttributeType(&o.DisplayName, v)
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *Flavor) GetId() (ret FlavorGetIdRetType) {
|
|
ret, _ = o.GetIdOk()
|
|
return ret
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Flavor) GetIdOk() (ret FlavorGetIdRetType, ok bool) {
|
|
return getFlavorGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *Flavor) SetId(v FlavorGetIdRetType) {
|
|
setFlavorGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetSku returns the Sku field value
|
|
func (o *Flavor) GetSku() (ret FlavorGetSkuRetType) {
|
|
ret, _ = o.GetSkuOk()
|
|
return ret
|
|
}
|
|
|
|
// GetSkuOk returns a tuple with the Sku field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Flavor) GetSkuOk() (ret FlavorGetSkuRetType, ok bool) {
|
|
return getFlavorGetSkuAttributeTypeOk(o.Sku)
|
|
}
|
|
|
|
// SetSku sets field value
|
|
func (o *Flavor) SetSku(v FlavorGetSkuRetType) {
|
|
setFlavorGetSkuAttributeType(&o.Sku, v)
|
|
}
|
|
|
|
func (o Flavor) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getFlavorGetAvailabilityAttributeTypeOk(o.Availability); ok {
|
|
toSerialize["Availability"] = val
|
|
}
|
|
if val, ok := getFlavorGetDescriptionAttributeTypeOk(o.Description); ok {
|
|
toSerialize["Description"] = val
|
|
}
|
|
if val, ok := getFlavorGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
|
toSerialize["DisplayName"] = val
|
|
}
|
|
if val, ok := getFlavorGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getFlavorGetSkuAttributeTypeOk(o.Sku); ok {
|
|
toSerialize["Sku"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableFlavor struct {
|
|
value *Flavor
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFlavor) Get() *Flavor {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFlavor) Set(val *Flavor) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFlavor) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFlavor) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFlavor(val *Flavor) *NullableFlavor {
|
|
return &NullableFlavor{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFlavor) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFlavor) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|