## 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>
362 lines
10 KiB
Go
362 lines
10 KiB
Go
/*
|
|
STACKIT IaaS API
|
|
|
|
This API allows you to create and modify IaaS resources.
|
|
|
|
API version: 2alpha1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package iaasalpha
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
// checks if the Route type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Route{}
|
|
|
|
/*
|
|
types and functions for createdAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type RouteGetCreatedAtAttributeType = *time.Time
|
|
type RouteGetCreatedAtArgType = time.Time
|
|
type RouteGetCreatedAtRetType = time.Time
|
|
|
|
func getRouteGetCreatedAtAttributeTypeOk(arg RouteGetCreatedAtAttributeType) (ret RouteGetCreatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetCreatedAtAttributeType(arg *RouteGetCreatedAtAttributeType, val RouteGetCreatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for destination
|
|
*/
|
|
|
|
// isModel
|
|
type RouteGetDestinationAttributeType = *RouteDestination
|
|
type RouteGetDestinationArgType = RouteDestination
|
|
type RouteGetDestinationRetType = RouteDestination
|
|
|
|
func getRouteGetDestinationAttributeTypeOk(arg RouteGetDestinationAttributeType) (ret RouteGetDestinationRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetDestinationAttributeType(arg *RouteGetDestinationAttributeType, val RouteGetDestinationRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type RouteGetIdAttributeType = *string
|
|
|
|
func getRouteGetIdAttributeTypeOk(arg RouteGetIdAttributeType) (ret RouteGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetIdAttributeType(arg *RouteGetIdAttributeType, val RouteGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type RouteGetIdArgType = string
|
|
type RouteGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isFreeform
|
|
type RouteGetLabelsAttributeType = *map[string]interface{}
|
|
type RouteGetLabelsArgType = map[string]interface{}
|
|
type RouteGetLabelsRetType = map[string]interface{}
|
|
|
|
func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret RouteGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for nexthop
|
|
*/
|
|
|
|
// isModel
|
|
type RouteGetNexthopAttributeType = *RouteNexthop
|
|
type RouteGetNexthopArgType = RouteNexthop
|
|
type RouteGetNexthopRetType = RouteNexthop
|
|
|
|
func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret RouteGetNexthopRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val RouteGetNexthopRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for updatedAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type RouteGetUpdatedAtAttributeType = *time.Time
|
|
type RouteGetUpdatedAtArgType = time.Time
|
|
type RouteGetUpdatedAtRetType = time.Time
|
|
|
|
func getRouteGetUpdatedAtAttributeTypeOk(arg RouteGetUpdatedAtAttributeType) (ret RouteGetUpdatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setRouteGetUpdatedAtAttributeType(arg *RouteGetUpdatedAtAttributeType, val RouteGetUpdatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// Route Object represents a network route.
|
|
type Route struct {
|
|
// Date-time when resource was created.
|
|
CreatedAt RouteGetCreatedAtAttributeType `json:"createdAt,omitempty"`
|
|
// REQUIRED
|
|
Destination RouteGetDestinationAttributeType `json:"destination" required:"true"`
|
|
// Universally Unique Identifier (UUID).
|
|
Id RouteGetIdAttributeType `json:"id,omitempty"`
|
|
// Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key.
|
|
Labels RouteGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// REQUIRED
|
|
Nexthop RouteGetNexthopAttributeType `json:"nexthop" required:"true"`
|
|
// Date-time when resource was last updated.
|
|
UpdatedAt RouteGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
|
|
}
|
|
|
|
type _Route Route
|
|
|
|
// NewRoute instantiates a new Route 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 NewRoute(destination RouteGetDestinationArgType, nexthop RouteGetNexthopArgType) *Route {
|
|
this := Route{}
|
|
setRouteGetDestinationAttributeType(&this.Destination, destination)
|
|
setRouteGetNexthopAttributeType(&this.Nexthop, nexthop)
|
|
return &this
|
|
}
|
|
|
|
// NewRouteWithDefaults instantiates a new Route 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 NewRouteWithDefaults() *Route {
|
|
this := Route{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *Route) GetCreatedAt() (res RouteGetCreatedAtRetType) {
|
|
res, _ = o.GetCreatedAtOk()
|
|
return
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetCreatedAtOk() (ret RouteGetCreatedAtRetType, ok bool) {
|
|
return getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *Route) HasCreatedAt() bool {
|
|
_, ok := o.GetCreatedAtOk()
|
|
return ok
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
|
|
func (o *Route) SetCreatedAt(v RouteGetCreatedAtRetType) {
|
|
setRouteGetCreatedAtAttributeType(&o.CreatedAt, v)
|
|
}
|
|
|
|
// GetDestination returns the Destination field value
|
|
func (o *Route) GetDestination() (ret RouteGetDestinationRetType) {
|
|
ret, _ = o.GetDestinationOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDestinationOk returns a tuple with the Destination field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetDestinationOk() (ret RouteGetDestinationRetType, ok bool) {
|
|
return getRouteGetDestinationAttributeTypeOk(o.Destination)
|
|
}
|
|
|
|
// SetDestination sets field value
|
|
func (o *Route) SetDestination(v RouteGetDestinationRetType) {
|
|
setRouteGetDestinationAttributeType(&o.Destination, v)
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *Route) GetId() (res RouteGetIdRetType) {
|
|
res, _ = o.GetIdOk()
|
|
return
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetIdOk() (ret RouteGetIdRetType, ok bool) {
|
|
return getRouteGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *Route) HasId() bool {
|
|
_, ok := o.GetIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *Route) SetId(v RouteGetIdRetType) {
|
|
setRouteGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *Route) GetLabels() (res RouteGetLabelsRetType) {
|
|
res, _ = o.GetLabelsOk()
|
|
return
|
|
}
|
|
|
|
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetLabelsOk() (ret RouteGetLabelsRetType, ok bool) {
|
|
return getRouteGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *Route) HasLabels() bool {
|
|
_, ok := o.GetLabelsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
|
|
func (o *Route) SetLabels(v RouteGetLabelsRetType) {
|
|
setRouteGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetNexthop returns the Nexthop field value
|
|
func (o *Route) GetNexthop() (ret RouteGetNexthopRetType) {
|
|
ret, _ = o.GetNexthopOk()
|
|
return ret
|
|
}
|
|
|
|
// GetNexthopOk returns a tuple with the Nexthop field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetNexthopOk() (ret RouteGetNexthopRetType, ok bool) {
|
|
return getRouteGetNexthopAttributeTypeOk(o.Nexthop)
|
|
}
|
|
|
|
// SetNexthop sets field value
|
|
func (o *Route) SetNexthop(v RouteGetNexthopRetType) {
|
|
setRouteGetNexthopAttributeType(&o.Nexthop, v)
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *Route) GetUpdatedAt() (res RouteGetUpdatedAtRetType) {
|
|
res, _ = o.GetUpdatedAtOk()
|
|
return
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Route) GetUpdatedAtOk() (ret RouteGetUpdatedAtRetType, ok bool) {
|
|
return getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *Route) HasUpdatedAt() bool {
|
|
_, ok := o.GetUpdatedAtOk()
|
|
return ok
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
|
|
func (o *Route) SetUpdatedAt(v RouteGetUpdatedAtRetType) {
|
|
setRouteGetUpdatedAtAttributeType(&o.UpdatedAt, v)
|
|
}
|
|
|
|
func (o Route) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
|
toSerialize["CreatedAt"] = val
|
|
}
|
|
if val, ok := getRouteGetDestinationAttributeTypeOk(o.Destination); ok {
|
|
toSerialize["Destination"] = val
|
|
}
|
|
if val, ok := getRouteGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getRouteGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getRouteGetNexthopAttributeTypeOk(o.Nexthop); ok {
|
|
toSerialize["Nexthop"] = val
|
|
}
|
|
if val, ok := getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
|
|
toSerialize["UpdatedAt"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableRoute struct {
|
|
value *Route
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableRoute) Get() *Route {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableRoute) Set(val *Route) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableRoute) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableRoute) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableRoute(val *Route) *NullableRoute {
|
|
return &NullableRoute{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableRoute) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableRoute) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|