## 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>
172 lines
4.7 KiB
Go
172 lines
4.7 KiB
Go
/*
|
|
STACKIT IaaS API
|
|
|
|
This API allows you to create and modify IaaS resources.
|
|
|
|
API version: 2beta1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package iaasbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PublicNetwork{}
|
|
|
|
/*
|
|
types and functions for cidr
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PublicNetworkGetCidrAttributeType = *string
|
|
|
|
func getPublicNetworkGetCidrAttributeTypeOk(arg PublicNetworkGetCidrAttributeType) (ret PublicNetworkGetCidrRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPublicNetworkGetCidrAttributeType(arg *PublicNetworkGetCidrAttributeType, val PublicNetworkGetCidrRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PublicNetworkGetCidrArgType = string
|
|
type PublicNetworkGetCidrRetType = string
|
|
|
|
/*
|
|
types and functions for region
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PublicNetworkGetRegionAttributeType = *string
|
|
|
|
func getPublicNetworkGetRegionAttributeTypeOk(arg PublicNetworkGetRegionAttributeType) (ret PublicNetworkGetRegionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPublicNetworkGetRegionAttributeType(arg *PublicNetworkGetRegionAttributeType, val PublicNetworkGetRegionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PublicNetworkGetRegionArgType = string
|
|
type PublicNetworkGetRegionRetType = string
|
|
|
|
// PublicNetwork Public network.
|
|
type PublicNetwork struct {
|
|
// Classless Inter-Domain Routing (CIDR).
|
|
// REQUIRED
|
|
Cidr PublicNetworkGetCidrAttributeType `json:"cidr" required:"true"`
|
|
// Name of the region.
|
|
// REQUIRED
|
|
Region PublicNetworkGetRegionAttributeType `json:"region" required:"true"`
|
|
}
|
|
|
|
type _PublicNetwork PublicNetwork
|
|
|
|
// NewPublicNetwork instantiates a new PublicNetwork 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 NewPublicNetwork(cidr PublicNetworkGetCidrArgType, region PublicNetworkGetRegionArgType) *PublicNetwork {
|
|
this := PublicNetwork{}
|
|
setPublicNetworkGetCidrAttributeType(&this.Cidr, cidr)
|
|
setPublicNetworkGetRegionAttributeType(&this.Region, region)
|
|
return &this
|
|
}
|
|
|
|
// NewPublicNetworkWithDefaults instantiates a new PublicNetwork 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 NewPublicNetworkWithDefaults() *PublicNetwork {
|
|
this := PublicNetwork{}
|
|
return &this
|
|
}
|
|
|
|
// GetCidr returns the Cidr field value
|
|
func (o *PublicNetwork) GetCidr() (ret PublicNetworkGetCidrRetType) {
|
|
ret, _ = o.GetCidrOk()
|
|
return ret
|
|
}
|
|
|
|
// GetCidrOk returns a tuple with the Cidr field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PublicNetwork) GetCidrOk() (ret PublicNetworkGetCidrRetType, ok bool) {
|
|
return getPublicNetworkGetCidrAttributeTypeOk(o.Cidr)
|
|
}
|
|
|
|
// SetCidr sets field value
|
|
func (o *PublicNetwork) SetCidr(v PublicNetworkGetCidrRetType) {
|
|
setPublicNetworkGetCidrAttributeType(&o.Cidr, v)
|
|
}
|
|
|
|
// GetRegion returns the Region field value
|
|
func (o *PublicNetwork) GetRegion() (ret PublicNetworkGetRegionRetType) {
|
|
ret, _ = o.GetRegionOk()
|
|
return ret
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PublicNetwork) GetRegionOk() (ret PublicNetworkGetRegionRetType, ok bool) {
|
|
return getPublicNetworkGetRegionAttributeTypeOk(o.Region)
|
|
}
|
|
|
|
// SetRegion sets field value
|
|
func (o *PublicNetwork) SetRegion(v PublicNetworkGetRegionRetType) {
|
|
setPublicNetworkGetRegionAttributeType(&o.Region, v)
|
|
}
|
|
|
|
func (o PublicNetwork) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getPublicNetworkGetCidrAttributeTypeOk(o.Cidr); ok {
|
|
toSerialize["Cidr"] = val
|
|
}
|
|
if val, ok := getPublicNetworkGetRegionAttributeTypeOk(o.Region); ok {
|
|
toSerialize["Region"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullablePublicNetwork struct {
|
|
value *PublicNetwork
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePublicNetwork) Get() *PublicNetwork {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePublicNetwork) Set(val *PublicNetwork) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePublicNetwork) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePublicNetwork) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork {
|
|
return &NullablePublicNetwork{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|