terraform-provider-stackitp.../pkg/iaasbeta/model_security_group.go
2026-01-21 09:07:29 +01:00

468 lines
15 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"
"time"
)
// checks if the SecurityGroup type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SecurityGroup{}
/*
types and functions for createdAt
*/
// isDateTime
type SecurityGroupGetCreatedAtAttributeType = *time.Time
type SecurityGroupGetCreatedAtArgType = time.Time
type SecurityGroupGetCreatedAtRetType = time.Time
func getSecurityGroupGetCreatedAtAttributeTypeOk(arg SecurityGroupGetCreatedAtAttributeType) (ret SecurityGroupGetCreatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetCreatedAtAttributeType(arg *SecurityGroupGetCreatedAtAttributeType, val SecurityGroupGetCreatedAtRetType) {
*arg = &val
}
/*
types and functions for description
*/
// isNotNullableString
type SecurityGroupGetDescriptionAttributeType = *string
func getSecurityGroupGetDescriptionAttributeTypeOk(arg SecurityGroupGetDescriptionAttributeType) (ret SecurityGroupGetDescriptionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetDescriptionAttributeType(arg *SecurityGroupGetDescriptionAttributeType, val SecurityGroupGetDescriptionRetType) {
*arg = &val
}
type SecurityGroupGetDescriptionArgType = string
type SecurityGroupGetDescriptionRetType = string
/*
types and functions for id
*/
// isNotNullableString
type SecurityGroupGetIdAttributeType = *string
func getSecurityGroupGetIdAttributeTypeOk(arg SecurityGroupGetIdAttributeType) (ret SecurityGroupGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetIdAttributeType(arg *SecurityGroupGetIdAttributeType, val SecurityGroupGetIdRetType) {
*arg = &val
}
type SecurityGroupGetIdArgType = string
type SecurityGroupGetIdRetType = string
/*
types and functions for labels
*/
// isFreeform
type SecurityGroupGetLabelsAttributeType = *map[string]interface{}
type SecurityGroupGetLabelsArgType = map[string]interface{}
type SecurityGroupGetLabelsRetType = map[string]interface{}
func getSecurityGroupGetLabelsAttributeTypeOk(arg SecurityGroupGetLabelsAttributeType) (ret SecurityGroupGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetLabelsAttributeType(arg *SecurityGroupGetLabelsAttributeType, val SecurityGroupGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type SecurityGroupGetNameAttributeType = *string
func getSecurityGroupGetNameAttributeTypeOk(arg SecurityGroupGetNameAttributeType) (ret SecurityGroupGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetNameAttributeType(arg *SecurityGroupGetNameAttributeType, val SecurityGroupGetNameRetType) {
*arg = &val
}
type SecurityGroupGetNameArgType = string
type SecurityGroupGetNameRetType = string
/*
types and functions for rules
*/
// isArray
type SecurityGroupGetRulesAttributeType = *[]SecurityGroupRule
type SecurityGroupGetRulesArgType = []SecurityGroupRule
type SecurityGroupGetRulesRetType = []SecurityGroupRule
func getSecurityGroupGetRulesAttributeTypeOk(arg SecurityGroupGetRulesAttributeType) (ret SecurityGroupGetRulesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetRulesAttributeType(arg *SecurityGroupGetRulesAttributeType, val SecurityGroupGetRulesRetType) {
*arg = &val
}
/*
types and functions for stateful
*/
// isBoolean
type SecurityGroupgetStatefulAttributeType = *bool
type SecurityGroupgetStatefulArgType = bool
type SecurityGroupgetStatefulRetType = bool
func getSecurityGroupgetStatefulAttributeTypeOk(arg SecurityGroupgetStatefulAttributeType) (ret SecurityGroupgetStatefulRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupgetStatefulAttributeType(arg *SecurityGroupgetStatefulAttributeType, val SecurityGroupgetStatefulRetType) {
*arg = &val
}
/*
types and functions for updatedAt
*/
// isDateTime
type SecurityGroupGetUpdatedAtAttributeType = *time.Time
type SecurityGroupGetUpdatedAtArgType = time.Time
type SecurityGroupGetUpdatedAtRetType = time.Time
func getSecurityGroupGetUpdatedAtAttributeTypeOk(arg SecurityGroupGetUpdatedAtAttributeType) (ret SecurityGroupGetUpdatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setSecurityGroupGetUpdatedAtAttributeType(arg *SecurityGroupGetUpdatedAtAttributeType, val SecurityGroupGetUpdatedAtRetType) {
*arg = &val
}
// SecurityGroup Object that represents a security group.
type SecurityGroup struct {
// Date-time when resource was created.
CreatedAt SecurityGroupGetCreatedAtAttributeType `json:"createdAt,omitempty"`
// Description Object. Allows string up to 255 Characters.
Description SecurityGroupGetDescriptionAttributeType `json:"description,omitempty"`
// Universally Unique Identifier (UUID).
Id SecurityGroupGetIdAttributeType `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 SecurityGroupGetLabelsAttributeType `json:"labels,omitempty"`
// The name for a General Object. Matches Names and also UUIDs.
// REQUIRED
Name SecurityGroupGetNameAttributeType `json:"name" required:"true"`
// A list containing security group rule objects.
Rules SecurityGroupGetRulesAttributeType `json:"rules,omitempty"`
// Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server.
Stateful SecurityGroupgetStatefulAttributeType `json:"stateful,omitempty"`
// Date-time when resource was last updated.
UpdatedAt SecurityGroupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
}
type _SecurityGroup SecurityGroup
// NewSecurityGroup instantiates a new SecurityGroup 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 NewSecurityGroup(name SecurityGroupGetNameArgType) *SecurityGroup {
this := SecurityGroup{}
setSecurityGroupGetNameAttributeType(&this.Name, name)
return &this
}
// NewSecurityGroupWithDefaults instantiates a new SecurityGroup 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 NewSecurityGroupWithDefaults() *SecurityGroup {
this := SecurityGroup{}
var stateful bool = true
this.Stateful = &stateful
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SecurityGroup) GetCreatedAt() (res SecurityGroupGetCreatedAtRetType) {
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 *SecurityGroup) GetCreatedAtOk() (ret SecurityGroupGetCreatedAtRetType, ok bool) {
return getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt)
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *SecurityGroup) 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 *SecurityGroup) SetCreatedAt(v SecurityGroupGetCreatedAtRetType) {
setSecurityGroupGetCreatedAtAttributeType(&o.CreatedAt, v)
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *SecurityGroup) GetDescription() (res SecurityGroupGetDescriptionRetType) {
res, _ = o.GetDescriptionOk()
return
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityGroup) GetDescriptionOk() (ret SecurityGroupGetDescriptionRetType, ok bool) {
return getSecurityGroupGetDescriptionAttributeTypeOk(o.Description)
}
// HasDescription returns a boolean if a field has been set.
func (o *SecurityGroup) HasDescription() bool {
_, ok := o.GetDescriptionOk()
return ok
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *SecurityGroup) SetDescription(v SecurityGroupGetDescriptionRetType) {
setSecurityGroupGetDescriptionAttributeType(&o.Description, v)
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SecurityGroup) GetId() (res SecurityGroupGetIdRetType) {
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 *SecurityGroup) GetIdOk() (ret SecurityGroupGetIdRetType, ok bool) {
return getSecurityGroupGetIdAttributeTypeOk(o.Id)
}
// HasId returns a boolean if a field has been set.
func (o *SecurityGroup) HasId() bool {
_, ok := o.GetIdOk()
return ok
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *SecurityGroup) SetId(v SecurityGroupGetIdRetType) {
setSecurityGroupGetIdAttributeType(&o.Id, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *SecurityGroup) GetLabels() (res SecurityGroupGetLabelsRetType) {
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 *SecurityGroup) GetLabelsOk() (ret SecurityGroupGetLabelsRetType, ok bool) {
return getSecurityGroupGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *SecurityGroup) 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 *SecurityGroup) SetLabels(v SecurityGroupGetLabelsRetType) {
setSecurityGroupGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *SecurityGroup) GetName() (ret SecurityGroupGetNameRetType) {
ret, _ = o.GetNameOk()
return ret
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *SecurityGroup) GetNameOk() (ret SecurityGroupGetNameRetType, ok bool) {
return getSecurityGroupGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *SecurityGroup) SetName(v SecurityGroupGetNameRetType) {
setSecurityGroupGetNameAttributeType(&o.Name, v)
}
// GetRules returns the Rules field value if set, zero value otherwise.
func (o *SecurityGroup) GetRules() (res SecurityGroupGetRulesRetType) {
res, _ = o.GetRulesOk()
return
}
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityGroup) GetRulesOk() (ret SecurityGroupGetRulesRetType, ok bool) {
return getSecurityGroupGetRulesAttributeTypeOk(o.Rules)
}
// HasRules returns a boolean if a field has been set.
func (o *SecurityGroup) HasRules() bool {
_, ok := o.GetRulesOk()
return ok
}
// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field.
func (o *SecurityGroup) SetRules(v SecurityGroupGetRulesRetType) {
setSecurityGroupGetRulesAttributeType(&o.Rules, v)
}
// GetStateful returns the Stateful field value if set, zero value otherwise.
func (o *SecurityGroup) GetStateful() (res SecurityGroupgetStatefulRetType) {
res, _ = o.GetStatefulOk()
return
}
// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityGroup) GetStatefulOk() (ret SecurityGroupgetStatefulRetType, ok bool) {
return getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful)
}
// HasStateful returns a boolean if a field has been set.
func (o *SecurityGroup) HasStateful() bool {
_, ok := o.GetStatefulOk()
return ok
}
// SetStateful gets a reference to the given bool and assigns it to the Stateful field.
func (o *SecurityGroup) SetStateful(v SecurityGroupgetStatefulRetType) {
setSecurityGroupgetStatefulAttributeType(&o.Stateful, v)
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *SecurityGroup) GetUpdatedAt() (res SecurityGroupGetUpdatedAtRetType) {
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 *SecurityGroup) GetUpdatedAtOk() (ret SecurityGroupGetUpdatedAtRetType, ok bool) {
return getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *SecurityGroup) 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 *SecurityGroup) SetUpdatedAt(v SecurityGroupGetUpdatedAtRetType) {
setSecurityGroupGetUpdatedAtAttributeType(&o.UpdatedAt, v)
}
func (o SecurityGroup) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
toSerialize["CreatedAt"] = val
}
if val, ok := getSecurityGroupGetDescriptionAttributeTypeOk(o.Description); ok {
toSerialize["Description"] = val
}
if val, ok := getSecurityGroupGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
if val, ok := getSecurityGroupGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getSecurityGroupGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getSecurityGroupGetRulesAttributeTypeOk(o.Rules); ok {
toSerialize["Rules"] = val
}
if val, ok := getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful); ok {
toSerialize["Stateful"] = val
}
if val, ok := getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
toSerialize["UpdatedAt"] = val
}
return toSerialize, nil
}
type NullableSecurityGroup struct {
value *SecurityGroup
isSet bool
}
func (v NullableSecurityGroup) Get() *SecurityGroup {
return v.value
}
func (v *NullableSecurityGroup) Set(val *SecurityGroup) {
v.value = val
v.isSet = true
}
func (v NullableSecurityGroup) IsSet() bool {
return v.isSet
}
func (v *NullableSecurityGroup) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup {
return &NullableSecurityGroup{value: val, isSet: true}
}
func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}