diff --git a/services/ufw/oas_commit b/services/ufw/oas_commit index 234b67fbe6..c2313a2afd 100644 --- a/services/ufw/oas_commit +++ b/services/ufw/oas_commit @@ -1 +1 @@ -43f467b6558ae9272562a18cdc63cb850b918bae +ede41f6d10cc44e9ac1b809bf790ccebd5cfa575 diff --git a/services/ufw/v1api/api_default.go b/services/ufw/v1api/api_default.go index ca75ec2764..a24fa07633 100644 --- a/services/ufw/v1api/api_default.go +++ b/services/ufw/v1api/api_default.go @@ -115,8 +115,8 @@ type DefaultAPI interface { ListProviderOptions(ctx context.Context, regionId string) ApiListProviderOptionsRequest // ListProviderOptionsExecute executes the request - // @return []ProviderOptionsResponse - ListProviderOptionsExecute(r ApiListProviderOptionsRequest) ([]ProviderOptionsResponse, error) + // @return ProviderOptionsResponse + ListProviderOptionsExecute(r ApiListProviderOptionsRequest) (*ProviderOptionsResponse, error) /* ListRules Get rules for a project @@ -1119,7 +1119,7 @@ type ApiListProviderOptionsRequest struct { regionId string } -func (r ApiListProviderOptionsRequest) Execute() ([]ProviderOptionsResponse, error) { +func (r ApiListProviderOptionsRequest) Execute() (*ProviderOptionsResponse, error) { return r.ApiService.ListProviderOptionsExecute(r) } @@ -1142,13 +1142,13 @@ func (a *DefaultAPIService) ListProviderOptions(ctx context.Context, regionId st // Execute executes the request // -// @return []ProviderOptionsResponse -func (a *DefaultAPIService) ListProviderOptionsExecute(r ApiListProviderOptionsRequest) ([]ProviderOptionsResponse, error) { +// @return ProviderOptionsResponse +func (a *DefaultAPIService) ListProviderOptionsExecute(r ApiListProviderOptionsRequest) (*ProviderOptionsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []ProviderOptionsResponse + localVarReturnValue *ProviderOptionsResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListProviderOptions") diff --git a/services/ufw/v1api/api_default_mock.go b/services/ufw/v1api/api_default_mock.go index 540cef6c7d..9b3eb260c0 100644 --- a/services/ufw/v1api/api_default_mock.go +++ b/services/ufw/v1api/api_default_mock.go @@ -31,7 +31,7 @@ type DefaultAPIServiceMock struct { // ListOrganizationContainersExecuteMock can be populated to implement the behavior of the ListOrganizationContainersExecute function of this mock ListOrganizationContainersExecuteMock *func(r ApiListOrganizationContainersRequest) (*ListContainersResponse, error) // ListProviderOptionsExecuteMock can be populated to implement the behavior of the ListProviderOptionsExecute function of this mock - ListProviderOptionsExecuteMock *func(r ApiListProviderOptionsRequest) ([]ProviderOptionsResponse, error) + ListProviderOptionsExecuteMock *func(r ApiListProviderOptionsRequest) (*ProviderOptionsResponse, error) // ListRulesExecuteMock can be populated to implement the behavior of the ListRulesExecute function of this mock ListRulesExecuteMock *func(r ApiListRulesRequest) (*ListRulesResponse, error) // UpdateRuleExecuteMock can be populated to implement the behavior of the UpdateRuleExecute function of this mock @@ -142,9 +142,9 @@ func (a DefaultAPIServiceMock) ListProviderOptions(ctx context.Context, regionId } // ListProviderOptionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListProviderOptionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListProviderOptionsExecute(r ApiListProviderOptionsRequest) ([]ProviderOptionsResponse, error) { +func (a DefaultAPIServiceMock) ListProviderOptionsExecute(r ApiListProviderOptionsRequest) (*ProviderOptionsResponse, error) { if a.ListProviderOptionsExecuteMock == nil { - var localVarReturnValue []ProviderOptionsResponse + var localVarReturnValue *ProviderOptionsResponse return localVarReturnValue, nil } diff --git a/services/ufw/v1api/model_rule_response.go b/services/ufw/v1api/model_rule_response.go index ccaff7b022..a53dd99646 100644 --- a/services/ufw/v1api/model_rule_response.go +++ b/services/ufw/v1api/model_rule_response.go @@ -32,13 +32,14 @@ type RuleResponse struct { PortRange *string `json:"portRange,omitempty"` Product string `json:"product"` Protocol *string `json:"protocol,omitempty"` + RefId *string `json:"refId,omitempty"` Region *string `json:"region,omitempty"` RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` SecurityGroup *string `json:"securityGroup,omitempty"` SecurityGroupId *string `json:"securityGroupId,omitempty"` SourceIP string `json:"sourceIP"` Status RuleResponseStatus `json:"status"` - Type string `json:"type"` + Type RuleResponseType `json:"type"` AdditionalProperties map[string]interface{} } @@ -48,7 +49,7 @@ type _RuleResponse RuleResponse // 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 NewRuleResponse(destination string, instanceId string, product string, sourceIP string, status RuleResponseStatus, types string) *RuleResponse { +func NewRuleResponse(destination string, instanceId string, product string, sourceIP string, status RuleResponseStatus, types RuleResponseType) *RuleResponse { this := RuleResponse{} this.Destination = destination this.InstanceId = instanceId @@ -427,6 +428,38 @@ func (o *RuleResponse) SetProtocol(v string) { o.Protocol = &v } +// GetRefId returns the RefId field value if set, zero value otherwise. +func (o *RuleResponse) GetRefId() string { + if o == nil || IsNil(o.RefId) { + var ret string + return ret + } + return *o.RefId +} + +// GetRefIdOk returns a tuple with the RefId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RuleResponse) GetRefIdOk() (*string, bool) { + if o == nil || IsNil(o.RefId) { + return nil, false + } + return o.RefId, true +} + +// HasRefId returns a boolean if a field has been set. +func (o *RuleResponse) HasRefId() bool { + if o != nil && !IsNil(o.RefId) { + return true + } + + return false +} + +// SetRefId gets a reference to the given string and assigns it to the RefId field. +func (o *RuleResponse) SetRefId(v string) { + o.RefId = &v +} + // GetRegion returns the Region field value if set, zero value otherwise. func (o *RuleResponse) GetRegion() string { if o == nil || IsNil(o.Region) { @@ -604,9 +637,9 @@ func (o *RuleResponse) SetStatus(v RuleResponseStatus) { } // GetType returns the Type field value -func (o *RuleResponse) GetType() string { +func (o *RuleResponse) GetType() RuleResponseType { if o == nil { - var ret string + var ret RuleResponseType return ret } @@ -615,7 +648,7 @@ func (o *RuleResponse) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *RuleResponse) GetTypeOk() (*string, bool) { +func (o *RuleResponse) GetTypeOk() (*RuleResponseType, bool) { if o == nil { return nil, false } @@ -623,7 +656,7 @@ func (o *RuleResponse) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *RuleResponse) SetType(v string) { +func (o *RuleResponse) SetType(v RuleResponseType) { o.Type = v } @@ -667,6 +700,9 @@ func (o RuleResponse) ToMap() (map[string]interface{}, error) { if !IsNil(o.Protocol) { toSerialize["protocol"] = o.Protocol } + if !IsNil(o.RefId) { + toSerialize["refId"] = o.RefId + } if !IsNil(o.Region) { toSerialize["region"] = o.Region } @@ -742,6 +778,7 @@ func (o *RuleResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "portRange") delete(additionalProperties, "product") delete(additionalProperties, "protocol") + delete(additionalProperties, "refId") delete(additionalProperties, "region") delete(additionalProperties, "remoteSecurityGroupId") delete(additionalProperties, "securityGroup") diff --git a/services/ufw/v1api/model_rule_response_type.go b/services/ufw/v1api/model_rule_response_type.go new file mode 100644 index 0000000000..bf78e37d5e --- /dev/null +++ b/services/ufw/v1api/model_rule_response_type.go @@ -0,0 +1,117 @@ +/* +STACKIT Unified Firewall API + +API for managing and controlling the STACKIT Unified Firewall. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// RuleResponseType The type of the rule (e.g., \"ACL\", \"PublicIP\", \"SecurityRule\"). +type RuleResponseType string + +// List of RuleResponse_type +const ( + RULERESPONSETYPE_ACL RuleResponseType = "ACL" + RULERESPONSETYPE_PUBLIC_IP RuleResponseType = "PublicIP" + RULERESPONSETYPE_SECURITY_RULE RuleResponseType = "SecurityRule" + RULERESPONSETYPE_SECURITY_GROUP RuleResponseType = "SecurityGroup" + RULERESPONSETYPE_UNKNOWN_DEFAULT_OPEN_API RuleResponseType = "unknown_default_open_api" +) + +// All allowed values of RuleResponseType enum +var AllowedRuleResponseTypeEnumValues = []RuleResponseType{ + "ACL", + "PublicIP", + "SecurityRule", + "SecurityGroup", + "unknown_default_open_api", +} + +func (v *RuleResponseType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RuleResponseType(value) + for _, existing := range AllowedRuleResponseTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RULERESPONSETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRuleResponseTypeFromValue returns a pointer to a valid RuleResponseType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRuleResponseTypeFromValue(v string) (*RuleResponseType, error) { + ev := RuleResponseType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RuleResponseType: valid values are %v", v, AllowedRuleResponseTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RuleResponseType) IsValid() bool { + for _, existing := range AllowedRuleResponseTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RuleResponse_type value +func (v RuleResponseType) Ptr() *RuleResponseType { + return &v +} + +type NullableRuleResponseType struct { + value *RuleResponseType + isSet bool +} + +func (v NullableRuleResponseType) Get() *RuleResponseType { + return v.value +} + +func (v *NullableRuleResponseType) Set(val *RuleResponseType) { + v.value = val + v.isSet = true +} + +func (v NullableRuleResponseType) IsSet() bool { + return v.isSet +} + +func (v *NullableRuleResponseType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRuleResponseType(val *RuleResponseType) *NullableRuleResponseType { + return &NullableRuleResponseType{value: val, isSet: true} +} + +func (v NullableRuleResponseType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRuleResponseType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}