terraform-provider-stackitp.../pkg/albbeta/model_rule.go
Marcel S. Henselin 9f41c4da7f
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s
feat: auto generated files and new structure (#4)
## 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>
2026-01-29 14:10:25 +00:00

416 lines
13 KiB
Go

/*
STACKIT Application Load Balancer API
### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
API version: 2beta2.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package albbeta
import (
"encoding/json"
)
// checks if the Rule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Rule{}
/*
types and functions for cookiePersistence
*/
// isModel
type RuleGetCookiePersistenceAttributeType = *CookiePersistence
type RuleGetCookiePersistenceArgType = CookiePersistence
type RuleGetCookiePersistenceRetType = CookiePersistence
func getRuleGetCookiePersistenceAttributeTypeOk(arg RuleGetCookiePersistenceAttributeType) (ret RuleGetCookiePersistenceRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetCookiePersistenceAttributeType(arg *RuleGetCookiePersistenceAttributeType, val RuleGetCookiePersistenceRetType) {
*arg = &val
}
/*
types and functions for headers
*/
// isArray
type RuleGetHeadersAttributeType = *[]HttpHeader
type RuleGetHeadersArgType = []HttpHeader
type RuleGetHeadersRetType = []HttpHeader
func getRuleGetHeadersAttributeTypeOk(arg RuleGetHeadersAttributeType) (ret RuleGetHeadersRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetHeadersAttributeType(arg *RuleGetHeadersAttributeType, val RuleGetHeadersRetType) {
*arg = &val
}
/*
types and functions for path
*/
// isModel
type RuleGetPathAttributeType = *Path
type RuleGetPathArgType = Path
type RuleGetPathRetType = Path
func getRuleGetPathAttributeTypeOk(arg RuleGetPathAttributeType) (ret RuleGetPathRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetPathAttributeType(arg *RuleGetPathAttributeType, val RuleGetPathRetType) {
*arg = &val
}
/*
types and functions for pathPrefix
*/
// isNotNullableString
type RuleGetPathPrefixAttributeType = *string
func getRuleGetPathPrefixAttributeTypeOk(arg RuleGetPathPrefixAttributeType) (ret RuleGetPathPrefixRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetPathPrefixAttributeType(arg *RuleGetPathPrefixAttributeType, val RuleGetPathPrefixRetType) {
*arg = &val
}
type RuleGetPathPrefixArgType = string
type RuleGetPathPrefixRetType = string
/*
types and functions for queryParameters
*/
// isArray
type RuleGetQueryParametersAttributeType = *[]QueryParameter
type RuleGetQueryParametersArgType = []QueryParameter
type RuleGetQueryParametersRetType = []QueryParameter
func getRuleGetQueryParametersAttributeTypeOk(arg RuleGetQueryParametersAttributeType) (ret RuleGetQueryParametersRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetQueryParametersAttributeType(arg *RuleGetQueryParametersAttributeType, val RuleGetQueryParametersRetType) {
*arg = &val
}
/*
types and functions for targetPool
*/
// isNotNullableString
type RuleGetTargetPoolAttributeType = *string
func getRuleGetTargetPoolAttributeTypeOk(arg RuleGetTargetPoolAttributeType) (ret RuleGetTargetPoolRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRuleGetTargetPoolAttributeType(arg *RuleGetTargetPoolAttributeType, val RuleGetTargetPoolRetType) {
*arg = &val
}
type RuleGetTargetPoolArgType = string
type RuleGetTargetPoolRetType = string
/*
types and functions for webSocket
*/
// isBoolean
type RulegetWebSocketAttributeType = *bool
type RulegetWebSocketArgType = bool
type RulegetWebSocketRetType = bool
func getRulegetWebSocketAttributeTypeOk(arg RulegetWebSocketAttributeType) (ret RulegetWebSocketRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setRulegetWebSocketAttributeType(arg *RulegetWebSocketAttributeType, val RulegetWebSocketRetType) {
*arg = &val
}
// Rule struct for Rule
type Rule struct {
CookiePersistence RuleGetCookiePersistenceAttributeType `json:"cookiePersistence,omitempty"`
// Headers for the rule.
Headers RuleGetHeadersAttributeType `json:"headers,omitempty"`
Path RuleGetPathAttributeType `json:"path,omitempty"`
// Legacy path prefix match. Optional. If not set, defaults to root path '/'. Cannot be set if 'path' is used. Prefer using 'path.prefix' instead. Only matches on full segment boundaries, e.g. '/foo' matches '/foo' and '/foo/bar' but NOT '/foobar'.
PathPrefix RuleGetPathPrefixAttributeType `json:"pathPrefix,omitempty"`
// Query Parameters for the rule.
QueryParameters RuleGetQueryParametersAttributeType `json:"queryParameters,omitempty"`
// Reference target pool by target pool name.
TargetPool RuleGetTargetPoolAttributeType `json:"targetPool,omitempty"`
// If enabled, when client sends an HTTP request with and Upgrade header, indicating the desire to establish a Websocket connection, if backend server supports WebSocket, it responds with HTTP 101 status code, switching protocols from HTTP to WebSocket. Hence the client and the server can exchange data in real-time using one long-lived TCP connection.
WebSocket RulegetWebSocketAttributeType `json:"webSocket,omitempty"`
}
// NewRule instantiates a new Rule 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 NewRule() *Rule {
this := Rule{}
return &this
}
// NewRuleWithDefaults instantiates a new Rule 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 NewRuleWithDefaults() *Rule {
this := Rule{}
return &this
}
// GetCookiePersistence returns the CookiePersistence field value if set, zero value otherwise.
func (o *Rule) GetCookiePersistence() (res RuleGetCookiePersistenceRetType) {
res, _ = o.GetCookiePersistenceOk()
return
}
// GetCookiePersistenceOk returns a tuple with the CookiePersistence field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetCookiePersistenceOk() (ret RuleGetCookiePersistenceRetType, ok bool) {
return getRuleGetCookiePersistenceAttributeTypeOk(o.CookiePersistence)
}
// HasCookiePersistence returns a boolean if a field has been set.
func (o *Rule) HasCookiePersistence() bool {
_, ok := o.GetCookiePersistenceOk()
return ok
}
// SetCookiePersistence gets a reference to the given CookiePersistence and assigns it to the CookiePersistence field.
func (o *Rule) SetCookiePersistence(v RuleGetCookiePersistenceRetType) {
setRuleGetCookiePersistenceAttributeType(&o.CookiePersistence, v)
}
// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *Rule) GetHeaders() (res RuleGetHeadersRetType) {
res, _ = o.GetHeadersOk()
return
}
// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetHeadersOk() (ret RuleGetHeadersRetType, ok bool) {
return getRuleGetHeadersAttributeTypeOk(o.Headers)
}
// HasHeaders returns a boolean if a field has been set.
func (o *Rule) HasHeaders() bool {
_, ok := o.GetHeadersOk()
return ok
}
// SetHeaders gets a reference to the given []HttpHeader and assigns it to the Headers field.
func (o *Rule) SetHeaders(v RuleGetHeadersRetType) {
setRuleGetHeadersAttributeType(&o.Headers, v)
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *Rule) GetPath() (res RuleGetPathRetType) {
res, _ = o.GetPathOk()
return
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetPathOk() (ret RuleGetPathRetType, ok bool) {
return getRuleGetPathAttributeTypeOk(o.Path)
}
// HasPath returns a boolean if a field has been set.
func (o *Rule) HasPath() bool {
_, ok := o.GetPathOk()
return ok
}
// SetPath gets a reference to the given Path and assigns it to the Path field.
func (o *Rule) SetPath(v RuleGetPathRetType) {
setRuleGetPathAttributeType(&o.Path, v)
}
// GetPathPrefix returns the PathPrefix field value if set, zero value otherwise.
func (o *Rule) GetPathPrefix() (res RuleGetPathPrefixRetType) {
res, _ = o.GetPathPrefixOk()
return
}
// GetPathPrefixOk returns a tuple with the PathPrefix field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetPathPrefixOk() (ret RuleGetPathPrefixRetType, ok bool) {
return getRuleGetPathPrefixAttributeTypeOk(o.PathPrefix)
}
// HasPathPrefix returns a boolean if a field has been set.
func (o *Rule) HasPathPrefix() bool {
_, ok := o.GetPathPrefixOk()
return ok
}
// SetPathPrefix gets a reference to the given string and assigns it to the PathPrefix field.
func (o *Rule) SetPathPrefix(v RuleGetPathPrefixRetType) {
setRuleGetPathPrefixAttributeType(&o.PathPrefix, v)
}
// GetQueryParameters returns the QueryParameters field value if set, zero value otherwise.
func (o *Rule) GetQueryParameters() (res RuleGetQueryParametersRetType) {
res, _ = o.GetQueryParametersOk()
return
}
// GetQueryParametersOk returns a tuple with the QueryParameters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetQueryParametersOk() (ret RuleGetQueryParametersRetType, ok bool) {
return getRuleGetQueryParametersAttributeTypeOk(o.QueryParameters)
}
// HasQueryParameters returns a boolean if a field has been set.
func (o *Rule) HasQueryParameters() bool {
_, ok := o.GetQueryParametersOk()
return ok
}
// SetQueryParameters gets a reference to the given []QueryParameter and assigns it to the QueryParameters field.
func (o *Rule) SetQueryParameters(v RuleGetQueryParametersRetType) {
setRuleGetQueryParametersAttributeType(&o.QueryParameters, v)
}
// GetTargetPool returns the TargetPool field value if set, zero value otherwise.
func (o *Rule) GetTargetPool() (res RuleGetTargetPoolRetType) {
res, _ = o.GetTargetPoolOk()
return
}
// GetTargetPoolOk returns a tuple with the TargetPool field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetTargetPoolOk() (ret RuleGetTargetPoolRetType, ok bool) {
return getRuleGetTargetPoolAttributeTypeOk(o.TargetPool)
}
// HasTargetPool returns a boolean if a field has been set.
func (o *Rule) HasTargetPool() bool {
_, ok := o.GetTargetPoolOk()
return ok
}
// SetTargetPool gets a reference to the given string and assigns it to the TargetPool field.
func (o *Rule) SetTargetPool(v RuleGetTargetPoolRetType) {
setRuleGetTargetPoolAttributeType(&o.TargetPool, v)
}
// GetWebSocket returns the WebSocket field value if set, zero value otherwise.
func (o *Rule) GetWebSocket() (res RulegetWebSocketRetType) {
res, _ = o.GetWebSocketOk()
return
}
// GetWebSocketOk returns a tuple with the WebSocket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Rule) GetWebSocketOk() (ret RulegetWebSocketRetType, ok bool) {
return getRulegetWebSocketAttributeTypeOk(o.WebSocket)
}
// HasWebSocket returns a boolean if a field has been set.
func (o *Rule) HasWebSocket() bool {
_, ok := o.GetWebSocketOk()
return ok
}
// SetWebSocket gets a reference to the given bool and assigns it to the WebSocket field.
func (o *Rule) SetWebSocket(v RulegetWebSocketRetType) {
setRulegetWebSocketAttributeType(&o.WebSocket, v)
}
func (o Rule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getRuleGetCookiePersistenceAttributeTypeOk(o.CookiePersistence); ok {
toSerialize["CookiePersistence"] = val
}
if val, ok := getRuleGetHeadersAttributeTypeOk(o.Headers); ok {
toSerialize["Headers"] = val
}
if val, ok := getRuleGetPathAttributeTypeOk(o.Path); ok {
toSerialize["Path"] = val
}
if val, ok := getRuleGetPathPrefixAttributeTypeOk(o.PathPrefix); ok {
toSerialize["PathPrefix"] = val
}
if val, ok := getRuleGetQueryParametersAttributeTypeOk(o.QueryParameters); ok {
toSerialize["QueryParameters"] = val
}
if val, ok := getRuleGetTargetPoolAttributeTypeOk(o.TargetPool); ok {
toSerialize["TargetPool"] = val
}
if val, ok := getRulegetWebSocketAttributeTypeOk(o.WebSocket); ok {
toSerialize["WebSocket"] = val
}
return toSerialize, nil
}
type NullableRule struct {
value *Rule
isSet bool
}
func (v NullableRule) Get() *Rule {
return v.value
}
func (v *NullableRule) Set(val *Rule) {
v.value = val
v.isSet = true
}
func (v NullableRule) IsSet() bool {
return v.isSet
}
func (v *NullableRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRule(val *Rule) *NullableRule {
return &NullableRule{value: val, isSet: true}
}
func (v NullableRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRule) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}