diff --git a/services/albwaf/oas_commit b/services/albwaf/oas_commit index cca6a5e9a..36076afe8 100644 --- a/services/albwaf/oas_commit +++ b/services/albwaf/oas_commit @@ -1 +1 @@ -95de5cba3201a683657cb472d5fa30aa768f19cc +87a3ad63dec0a953ff5c6072ad9a15fddd8ec5f8 diff --git a/services/albwaf/v1alphaapi/model_crs_rule.go b/services/albwaf/v1alphaapi/model_crs_rule.go new file mode 100644 index 000000000..b7ba6795b --- /dev/null +++ b/services/albwaf/v1alphaapi/model_crs_rule.go @@ -0,0 +1,230 @@ +/* +STACKIT Application Load Balancer Web Application Firewall API + +Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" +) + +// checks if the CRSRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CRSRule{} + +// CRSRule Rule represents an individual security or validation rule. +type CRSRule struct { + // Description of the specific rule. + Description *string `json:"description,omitempty"` + // The unique numeric ID of the rule. + Id *int32 `json:"id,omitempty"` + // The impact level of the rule trigger. + Severity *string `json:"severity,omitempty" validate:"regexp=^(CRITICAL|ERROR|WARNING|INFO)$"` + AdditionalProperties map[string]interface{} +} + +type _CRSRule CRSRule + +// NewCRSRule instantiates a new CRSRule 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 NewCRSRule() *CRSRule { + this := CRSRule{} + return &this +} + +// NewCRSRuleWithDefaults instantiates a new CRSRule 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 NewCRSRuleWithDefaults() *CRSRule { + this := CRSRule{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CRSRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// 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 *CRSRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CRSRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CRSRule) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CRSRule) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 + return ret + } + return *o.Id +} + +// 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 *CRSRule) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CRSRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *CRSRule) SetId(v int32) { + o.Id = &v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *CRSRule) GetSeverity() string { + if o == nil || IsNil(o.Severity) { + var ret string + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CRSRule) GetSeverityOk() (*string, bool) { + if o == nil || IsNil(o.Severity) { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *CRSRule) HasSeverity() bool { + if o != nil && !IsNil(o.Severity) { + return true + } + + return false +} + +// SetSeverity gets a reference to the given string and assigns it to the Severity field. +func (o *CRSRule) SetSeverity(v string) { + o.Severity = &v +} + +func (o CRSRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CRSRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CRSRule) UnmarshalJSON(data []byte) (err error) { + varCRSRule := _CRSRule{} + + err = json.Unmarshal(data, &varCRSRule) + + if err != nil { + return err + } + + *o = CRSRule(varCRSRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "severity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCRSRule struct { + value *CRSRule + isSet bool +} + +func (v NullableCRSRule) Get() *CRSRule { + return v.value +} + +func (v *NullableCRSRule) Set(val *CRSRule) { + v.value = val + v.isSet = true +} + +func (v NullableCRSRule) IsSet() bool { + return v.isSet +} + +func (v *NullableCRSRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCRSRule(val *CRSRule) *NullableCRSRule { + return &NullableCRSRule{value: val, isSet: true} +} + +func (v NullableCRSRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCRSRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1alphaapi/model_crs_rule_group.go b/services/albwaf/v1alphaapi/model_crs_rule_group.go new file mode 100644 index 000000000..25e99ea31 --- /dev/null +++ b/services/albwaf/v1alphaapi/model_crs_rule_group.go @@ -0,0 +1,230 @@ +/* +STACKIT Application Load Balancer Web Application Firewall API + +Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" +) + +// checks if the CRSRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CRSRuleGroup{} + +// CRSRuleGroup RuleGroup represents a collection of rules associated with a specific group. +type CRSRuleGroup struct { + // A description of what this group covers. + Description *string `json:"description,omitempty"` + // The name for the rule group. + GroupName *string `json:"groupName,omitempty" validate:"regexp=^[a-zA-Z\\\\(\\\\) ]+$"` + // The list of individual rules contained within this group. + Rules []CRSRule `json:"rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CRSRuleGroup CRSRuleGroup + +// NewCRSRuleGroup instantiates a new CRSRuleGroup 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 NewCRSRuleGroup() *CRSRuleGroup { + this := CRSRuleGroup{} + return &this +} + +// NewCRSRuleGroupWithDefaults instantiates a new CRSRuleGroup 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 NewCRSRuleGroupWithDefaults() *CRSRuleGroup { + this := CRSRuleGroup{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CRSRuleGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// 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 *CRSRuleGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CRSRuleGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CRSRuleGroup) SetDescription(v string) { + o.Description = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *CRSRuleGroup) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CRSRuleGroup) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *CRSRuleGroup) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *CRSRuleGroup) SetGroupName(v string) { + o.GroupName = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CRSRuleGroup) GetRules() []CRSRule { + if o == nil || IsNil(o.Rules) { + var ret []CRSRule + return ret + } + return o.Rules +} + +// 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 *CRSRuleGroup) GetRulesOk() ([]CRSRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *CRSRuleGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []CRSRule and assigns it to the Rules field. +func (o *CRSRuleGroup) SetRules(v []CRSRule) { + o.Rules = v +} + +func (o CRSRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CRSRuleGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.GroupName) { + toSerialize["groupName"] = o.GroupName + } + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CRSRuleGroup) UnmarshalJSON(data []byte) (err error) { + varCRSRuleGroup := _CRSRuleGroup{} + + err = json.Unmarshal(data, &varCRSRuleGroup) + + if err != nil { + return err + } + + *o = CRSRuleGroup(varCRSRuleGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "groupName") + delete(additionalProperties, "rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCRSRuleGroup struct { + value *CRSRuleGroup + isSet bool +} + +func (v NullableCRSRuleGroup) Get() *CRSRuleGroup { + return v.value +} + +func (v *NullableCRSRuleGroup) Set(val *CRSRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullableCRSRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableCRSRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCRSRuleGroup(val *CRSRuleGroup) *NullableCRSRuleGroup { + return &NullableCRSRuleGroup{value: val, isSet: true} +} + +func (v NullableCRSRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCRSRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go b/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go index 79c056e05..3b0c3dc71 100644 --- a/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go @@ -20,11 +20,14 @@ var _ MappedNullable = &GetCoreRuleSetResponse{} // GetCoreRuleSetResponse GetCoreRuleSetResponse returns rule configuration name and it's rules. type GetCoreRuleSetResponse struct { // Indicates if the OWASP core rule set is active. - Active *bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` + Groups []CRSRuleGroup `json:"groups,omitempty"` // Core rule set configuration name. Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + // Core rule set version. + Version *string `json:"version,omitempty" validate:"regexp=^v\\\\d+\\\\.\\\\d+\\\\.\\\\d+$"` AdditionalProperties map[string]interface{} } @@ -79,6 +82,38 @@ func (o *GetCoreRuleSetResponse) SetActive(v bool) { o.Active = &v } +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *GetCoreRuleSetResponse) GetGroups() []CRSRuleGroup { + if o == nil || IsNil(o.Groups) { + var ret []CRSRuleGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCoreRuleSetResponse) GetGroupsOk() ([]CRSRuleGroup, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *GetCoreRuleSetResponse) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []CRSRuleGroup and assigns it to the Groups field. +func (o *GetCoreRuleSetResponse) SetGroups(v []CRSRuleGroup) { + o.Groups = v +} + // GetName returns the Name field value if set, zero value otherwise. func (o *GetCoreRuleSetResponse) GetName() string { if o == nil || IsNil(o.Name) { @@ -143,6 +178,38 @@ func (o *GetCoreRuleSetResponse) SetRegion(v string) { o.Region = &v } +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *GetCoreRuleSetResponse) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCoreRuleSetResponse) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *GetCoreRuleSetResponse) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *GetCoreRuleSetResponse) SetVersion(v string) { + o.Version = &v +} + func (o GetCoreRuleSetResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -156,12 +223,18 @@ func (o GetCoreRuleSetResponse) ToMap() (map[string]interface{}, error) { if !IsNil(o.Active) { toSerialize["active"] = o.Active } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } if !IsNil(o.Name) { toSerialize["name"] = o.Name } if !IsNil(o.Region) { toSerialize["region"] = o.Region } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -185,8 +258,10 @@ func (o *GetCoreRuleSetResponse) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "active") + delete(additionalProperties, "groups") delete(additionalProperties, "name") delete(additionalProperties, "region") + delete(additionalProperties, "version") o.AdditionalProperties = additionalProperties } diff --git a/services/albwaf/v1alphaapi/model_get_limited_core_rule_set_response.go b/services/albwaf/v1alphaapi/model_get_limited_core_rule_set_response.go new file mode 100644 index 000000000..02320eb9c --- /dev/null +++ b/services/albwaf/v1alphaapi/model_get_limited_core_rule_set_response.go @@ -0,0 +1,230 @@ +/* +STACKIT Application Load Balancer Web Application Firewall API + +Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" +) + +// checks if the GetLimitedCoreRuleSetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLimitedCoreRuleSetResponse{} + +// GetLimitedCoreRuleSetResponse struct for GetLimitedCoreRuleSetResponse +type GetLimitedCoreRuleSetResponse struct { + // Indicates if the OWASP core rule set is active. + Active *bool `json:"active,omitempty"` + // Core rule set configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + AdditionalProperties map[string]interface{} +} + +type _GetLimitedCoreRuleSetResponse GetLimitedCoreRuleSetResponse + +// NewGetLimitedCoreRuleSetResponse instantiates a new GetLimitedCoreRuleSetResponse 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 NewGetLimitedCoreRuleSetResponse() *GetLimitedCoreRuleSetResponse { + this := GetLimitedCoreRuleSetResponse{} + return &this +} + +// NewGetLimitedCoreRuleSetResponseWithDefaults instantiates a new GetLimitedCoreRuleSetResponse 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 NewGetLimitedCoreRuleSetResponseWithDefaults() *GetLimitedCoreRuleSetResponse { + this := GetLimitedCoreRuleSetResponse{} + return &this +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *GetLimitedCoreRuleSetResponse) GetActive() bool { + if o == nil || IsNil(o.Active) { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLimitedCoreRuleSetResponse) GetActiveOk() (*bool, bool) { + if o == nil || IsNil(o.Active) { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *GetLimitedCoreRuleSetResponse) HasActive() bool { + if o != nil && !IsNil(o.Active) { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *GetLimitedCoreRuleSetResponse) SetActive(v bool) { + o.Active = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetLimitedCoreRuleSetResponse) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLimitedCoreRuleSetResponse) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GetLimitedCoreRuleSetResponse) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetLimitedCoreRuleSetResponse) SetName(v string) { + o.Name = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *GetLimitedCoreRuleSetResponse) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLimitedCoreRuleSetResponse) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *GetLimitedCoreRuleSetResponse) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *GetLimitedCoreRuleSetResponse) SetRegion(v string) { + o.Region = &v +} + +func (o GetLimitedCoreRuleSetResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLimitedCoreRuleSetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Active) { + toSerialize["active"] = o.Active + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetLimitedCoreRuleSetResponse) UnmarshalJSON(data []byte) (err error) { + varGetLimitedCoreRuleSetResponse := _GetLimitedCoreRuleSetResponse{} + + err = json.Unmarshal(data, &varGetLimitedCoreRuleSetResponse) + + if err != nil { + return err + } + + *o = GetLimitedCoreRuleSetResponse(varGetLimitedCoreRuleSetResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "active") + delete(additionalProperties, "name") + delete(additionalProperties, "region") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetLimitedCoreRuleSetResponse struct { + value *GetLimitedCoreRuleSetResponse + isSet bool +} + +func (v NullableGetLimitedCoreRuleSetResponse) Get() *GetLimitedCoreRuleSetResponse { + return v.value +} + +func (v *NullableGetLimitedCoreRuleSetResponse) Set(val *GetLimitedCoreRuleSetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLimitedCoreRuleSetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLimitedCoreRuleSetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLimitedCoreRuleSetResponse(val *GetLimitedCoreRuleSetResponse) *NullableGetLimitedCoreRuleSetResponse { + return &NullableGetLimitedCoreRuleSetResponse{value: val, isSet: true} +} + +func (v NullableGetLimitedCoreRuleSetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLimitedCoreRuleSetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go b/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go index 37c530992..eb7df4577 100644 --- a/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ListCoreRuleSetResponse{} // ListCoreRuleSetResponse ListCoreRuleSetResponse returns a list of rule configuration responses. type ListCoreRuleSetResponse struct { - Items []GetCoreRuleSetResponse `json:"items,omitempty"` + Items []GetLimitedCoreRuleSetResponse `json:"items,omitempty"` // Continue token from the ListCoreRuleSetResponse with Limit option NextPageId *string `json:"nextPageId,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` AdditionalProperties map[string]interface{} @@ -45,9 +45,9 @@ func NewListCoreRuleSetResponseWithDefaults() *ListCoreRuleSetResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListCoreRuleSetResponse) GetItems() []GetCoreRuleSetResponse { +func (o *ListCoreRuleSetResponse) GetItems() []GetLimitedCoreRuleSetResponse { if o == nil || IsNil(o.Items) { - var ret []GetCoreRuleSetResponse + var ret []GetLimitedCoreRuleSetResponse return ret } return o.Items @@ -55,7 +55,7 @@ func (o *ListCoreRuleSetResponse) GetItems() []GetCoreRuleSetResponse { // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCoreRuleSetResponse) GetItemsOk() ([]GetCoreRuleSetResponse, bool) { +func (o *ListCoreRuleSetResponse) GetItemsOk() ([]GetLimitedCoreRuleSetResponse, bool) { if o == nil || IsNil(o.Items) { return nil, false } @@ -71,8 +71,8 @@ func (o *ListCoreRuleSetResponse) HasItems() bool { return false } -// SetItems gets a reference to the given []GetCoreRuleSetResponse and assigns it to the Items field. -func (o *ListCoreRuleSetResponse) SetItems(v []GetCoreRuleSetResponse) { +// SetItems gets a reference to the given []GetLimitedCoreRuleSetResponse and assigns it to the Items field. +func (o *ListCoreRuleSetResponse) SetItems(v []GetLimitedCoreRuleSetResponse) { o.Items = v }