From 3c714cdc7a378152fb99e99ff31f18f20babbd1a Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 13 May 2025 14:57:18 +0000 Subject: [PATCH] Generate alb --- services/alb/model_path.go | 178 +++++++++++++++++++++++++++++++++++++ services/alb/model_rule.go | 49 +++++++++- 2 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 services/alb/model_path.go diff --git a/services/alb/model_path.go b/services/alb/model_path.go new file mode 100644 index 000000000..af74cb45d --- /dev/null +++ b/services/alb/model_path.go @@ -0,0 +1,178 @@ +/* +Application Load Balancer API + +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 alb + +import ( + "encoding/json" +) + +// checks if the Path type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Path{} + +/* + types and functions for exact +*/ + +// isNotNullableString +type PathGetExactAttributeType = *string + +func getPathGetExactAttributeTypeOk(arg PathGetExactAttributeType) (ret PathGetExactRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPathGetExactAttributeType(arg *PathGetExactAttributeType, val PathGetExactRetType) { + *arg = &val +} + +type PathGetExactArgType = string +type PathGetExactRetType = string + +/* + types and functions for prefix +*/ + +// isNotNullableString +type PathGetPrefixAttributeType = *string + +func getPathGetPrefixAttributeTypeOk(arg PathGetPrefixAttributeType) (ret PathGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPathGetPrefixAttributeType(arg *PathGetPrefixAttributeType, val PathGetPrefixRetType) { + *arg = &val +} + +type PathGetPrefixArgType = string +type PathGetPrefixRetType = string + +// Path struct for Path +type Path struct { + // Exact path match. Only a request path exactly equal to the value will match, e.g. '/foo' matches only '/foo', not '/foo/bar' or '/foobar'. + Exact PathGetExactAttributeType `json:"exact,omitempty"` + // Prefix path match. Only matches on full segment boundaries, e.g. '/foo' matches '/foo' and '/foo/bar' but NOT '/foobar'. + Prefix PathGetPrefixAttributeType `json:"prefix,omitempty"` +} + +// NewPath instantiates a new Path 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 NewPath() *Path { + this := Path{} + return &this +} + +// NewPathWithDefaults instantiates a new Path 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 NewPathWithDefaults() *Path { + this := Path{} + return &this +} + +// GetExact returns the Exact field value if set, zero value otherwise. +func (o *Path) GetExact() (res PathGetExactRetType) { + res, _ = o.GetExactOk() + return +} + +// GetExactOk returns a tuple with the Exact field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Path) GetExactOk() (ret PathGetExactRetType, ok bool) { + return getPathGetExactAttributeTypeOk(o.Exact) +} + +// HasExact returns a boolean if a field has been set. +func (o *Path) HasExact() bool { + _, ok := o.GetExactOk() + return ok +} + +// SetExact gets a reference to the given string and assigns it to the Exact field. +func (o *Path) SetExact(v PathGetExactRetType) { + setPathGetExactAttributeType(&o.Exact, v) +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *Path) GetPrefix() (res PathGetPrefixRetType) { + res, _ = o.GetPrefixOk() + return +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Path) GetPrefixOk() (ret PathGetPrefixRetType, ok bool) { + return getPathGetPrefixAttributeTypeOk(o.Prefix) +} + +// HasPrefix returns a boolean if a field has been set. +func (o *Path) HasPrefix() bool { + _, ok := o.GetPrefixOk() + return ok +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *Path) SetPrefix(v PathGetPrefixRetType) { + setPathGetPrefixAttributeType(&o.Prefix, v) +} + +func (o Path) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPathGetExactAttributeTypeOk(o.Exact); ok { + toSerialize["Exact"] = val + } + if val, ok := getPathGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val + } + return toSerialize, nil +} + +type NullablePath struct { + value *Path + isSet bool +} + +func (v NullablePath) Get() *Path { + return v.value +} + +func (v *NullablePath) Set(val *Path) { + v.value = val + v.isSet = true +} + +func (v NullablePath) IsSet() bool { + return v.isSet +} + +func (v *NullablePath) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePath(val *Path) *NullablePath { + return &NullablePath{value: val, isSet: true} +} + +func (v NullablePath) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePath) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/model_rule.go b/services/alb/model_rule.go index 5e5e1afe0..8005546ba 100644 --- a/services/alb/model_rule.go +++ b/services/alb/model_rule.go @@ -57,6 +57,26 @@ func setRuleGetHeadersAttributeType(arg *RuleGetHeadersAttributeType, val RuleGe *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 */ @@ -144,7 +164,8 @@ type Rule struct { CookiePersistence RuleGetCookiePersistenceAttributeType `json:"cookiePersistence,omitempty"` // Headers for the rule. Headers RuleGetHeadersAttributeType `json:"headers,omitempty"` - // Path prefix for the rule. If empty or '/', it matches the root path. + 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"` @@ -217,6 +238,29 @@ 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() @@ -317,6 +361,9 @@ func (o Rule) ToMap() (map[string]interface{}, error) { 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 }