diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e8b47415..de89c1bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Release (2026-MM-DD) +- `albwaf`: + - [v0.9.0](services/albwaf/CHANGELOG.md#v090) + - `v1alphaapi`: Align package to latest API specification + - `v1betaapi`: Align package to latest API specification - `logme`: - [v1.0.1](services/logme/CHANGELOG.md#v101) - `v1api`: diff --git a/services/albwaf/CHANGELOG.md b/services/albwaf/CHANGELOG.md index d2b0c380c..e57019c47 100644 --- a/services/albwaf/CHANGELOG.md +++ b/services/albwaf/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.9.0 +- `v1alphaapi`: Align package to latest API specification +- `v1betaapi`: Align package to latest API specification + ## v0.8.0 - `v1alphaapi`: Align package to latest API specification diff --git a/services/albwaf/VERSION b/services/albwaf/VERSION index b19b52118..f979adec6 100644 --- a/services/albwaf/VERSION +++ b/services/albwaf/VERSION @@ -1 +1 @@ -v0.8.0 +v0.9.0 diff --git a/services/albwaf/oas_commit b/services/albwaf/oas_commit index 0a0374fad..739d1f43e 100644 --- a/services/albwaf/oas_commit +++ b/services/albwaf/oas_commit @@ -1 +1 @@ -c7230b0915f915450f00f706c6b72352efd434e9 +eeac709b40abdf42e3a23fe2992395cc03565a88 diff --git a/services/albwaf/v1alphaapi/api_default.go b/services/albwaf/v1alphaapi/api_default.go index 37a24a13d..00c03370b 100644 --- a/services/albwaf/v1alphaapi/api_default.go +++ b/services/albwaf/v1alphaapi/api_default.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/api_default_mock.go b/services/albwaf/v1alphaapi/api_default_mock.go index 8a8419ae4..d212d975a 100644 --- a/services/albwaf/v1alphaapi/api_default_mock.go +++ b/services/albwaf/v1alphaapi/api_default_mock.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/client.go b/services/albwaf/v1alphaapi/client.go index a21cbb7a1..d4fdc0462 100644 --- a/services/albwaf/v1alphaapi/client.go +++ b/services/albwaf/v1alphaapi/client.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/configuration.go b/services/albwaf/v1alphaapi/configuration.go index 7d9574f67..774ef3226 100644 --- a/services/albwaf/v1alphaapi/configuration.go +++ b/services/albwaf/v1alphaapi/configuration.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go index 1c09116d8..9f177853a 100644 --- a/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go +++ b/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_create_rules_payload.go b/services/albwaf/v1alphaapi/model_create_rules_payload.go index 1208806e7..daf029070 100644 --- a/services/albwaf/v1alphaapi/model_create_rules_payload.go +++ b/services/albwaf/v1alphaapi/model_create_rules_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_create_rules_response.go b/services/albwaf/v1alphaapi/model_create_rules_response.go index a0e61754a..398e9d696 100644 --- a/services/albwaf/v1alphaapi/model_create_rules_response.go +++ b/services/albwaf/v1alphaapi/model_create_rules_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_create_waf_payload.go b/services/albwaf/v1alphaapi/model_create_waf_payload.go index 62bed193c..dbfabb980 100644 --- a/services/albwaf/v1alphaapi/model_create_waf_payload.go +++ b/services/albwaf/v1alphaapi/model_create_waf_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_create_waf_response.go b/services/albwaf/v1alphaapi/model_create_waf_response.go index 47955df3b..f209320dc 100644 --- a/services/albwaf/v1alphaapi/model_create_waf_response.go +++ b/services/albwaf/v1alphaapi/model_create_waf_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_crs_config_quota.go b/services/albwaf/v1alphaapi/model_crs_config_quota.go index 1843cc682..bc684a9eb 100644 --- a/services/albwaf/v1alphaapi/model_crs_config_quota.go +++ b/services/albwaf/v1alphaapi/model_crs_config_quota.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_crs_rule.go b/services/albwaf/v1alphaapi/model_crs_rule.go index d42cbe48e..5059fc5e9 100644 --- a/services/albwaf/v1alphaapi/model_crs_rule.go +++ b/services/albwaf/v1alphaapi/model_crs_rule.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_crs_rule_group.go b/services/albwaf/v1alphaapi/model_crs_rule_group.go index 07da4fb9f..6f29c6cc5 100644 --- a/services/albwaf/v1alphaapi/model_crs_rule_group.go +++ b/services/albwaf/v1alphaapi/model_crs_rule_group.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_custom_rules_quota.go b/services/albwaf/v1alphaapi/model_custom_rules_quota.go index 3f36f56a0..9c0029e64 100644 --- a/services/albwaf/v1alphaapi/model_custom_rules_quota.go +++ b/services/albwaf/v1alphaapi/model_custom_rules_quota.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ 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 1be9f31f4..19031bacb 100644 --- a/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_get_core_rule_set_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ 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 index 02320eb9c..c77e7c487 100644 --- a/services/albwaf/v1alphaapi/model_get_limited_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_get_limited_core_rule_set_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_get_quota_response.go b/services/albwaf/v1alphaapi/model_get_quota_response.go index 0a016f7ad..245634471 100644 --- a/services/albwaf/v1alphaapi/model_get_quota_response.go +++ b/services/albwaf/v1alphaapi/model_get_quota_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_get_rules_response.go b/services/albwaf/v1alphaapi/model_get_rules_response.go index 1eb229009..1fbf5fb7b 100644 --- a/services/albwaf/v1alphaapi/model_get_rules_response.go +++ b/services/albwaf/v1alphaapi/model_get_rules_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_get_waf_response.go b/services/albwaf/v1alphaapi/model_get_waf_response.go index c441803e2..a1fad311a 100644 --- a/services/albwaf/v1alphaapi/model_get_waf_response.go +++ b/services/albwaf/v1alphaapi/model_get_waf_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_google_protobuf_any.go b/services/albwaf/v1alphaapi/model_google_protobuf_any.go index 0508a5d04..75c5a95cb 100644 --- a/services/albwaf/v1alphaapi/model_google_protobuf_any.go +++ b/services/albwaf/v1alphaapi/model_google_protobuf_any.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ 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 eb7df4577..770e3a9c0 100644 --- a/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_list_core_rule_set_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_list_rules_response.go b/services/albwaf/v1alphaapi/model_list_rules_response.go index 6d524749d..23f7d6e17 100644 --- a/services/albwaf/v1alphaapi/model_list_rules_response.go +++ b/services/albwaf/v1alphaapi/model_list_rules_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_list_waf_response.go b/services/albwaf/v1alphaapi/model_list_waf_response.go index 7fa99c76f..f4fcf74f8 100644 --- a/services/albwaf/v1alphaapi/model_list_waf_response.go +++ b/services/albwaf/v1alphaapi/model_list_waf_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go b/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go index fe718d520..94df1d120 100644 --- a/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go +++ b/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go b/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go index 99afc94c1..b4b28df91 100644 --- a/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go +++ b/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go index c08b1fdeb..e9580fa85 100644 --- a/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go +++ b/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_patch_crs_rule.go b/services/albwaf/v1alphaapi/model_patch_crs_rule.go index af12dc8c0..8792a3870 100644 --- a/services/albwaf/v1alphaapi/model_patch_crs_rule.go +++ b/services/albwaf/v1alphaapi/model_patch_crs_rule.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go b/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go index 0d2c0933b..5d8e3cb89 100644 --- a/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go +++ b/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_quotas.go b/services/albwaf/v1alphaapi/model_quotas.go index ac63c19bc..55aa7b324 100644 --- a/services/albwaf/v1alphaapi/model_quotas.go +++ b/services/albwaf/v1alphaapi/model_quotas.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_status.go b/services/albwaf/v1alphaapi/model_status.go index 6180132d1..75e7b9349 100644 --- a/services/albwaf/v1alphaapi/model_status.go +++ b/services/albwaf/v1alphaapi/model_status.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go index 0e2dbaa5f..d71fda20b 100644 --- a/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go +++ b/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go b/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go index b3cd815ad..3714cf1e8 100644 --- a/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go +++ b/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_rules_payload.go b/services/albwaf/v1alphaapi/model_update_rules_payload.go index d6eb4e1ca..d96edae95 100644 --- a/services/albwaf/v1alphaapi/model_update_rules_payload.go +++ b/services/albwaf/v1alphaapi/model_update_rules_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_rules_response.go b/services/albwaf/v1alphaapi/model_update_rules_response.go index 464bd804c..81eca22c0 100644 --- a/services/albwaf/v1alphaapi/model_update_rules_response.go +++ b/services/albwaf/v1alphaapi/model_update_rules_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_waf_payload.go b/services/albwaf/v1alphaapi/model_update_waf_payload.go index a82adceda..8d1c1ae25 100644 --- a/services/albwaf/v1alphaapi/model_update_waf_payload.go +++ b/services/albwaf/v1alphaapi/model_update_waf_payload.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_update_waf_response.go b/services/albwaf/v1alphaapi/model_update_waf_response.go index 92bf3eab0..95889067c 100644 --- a/services/albwaf/v1alphaapi/model_update_waf_response.go +++ b/services/albwaf/v1alphaapi/model_update_waf_response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/model_waf_config_quota.go b/services/albwaf/v1alphaapi/model_waf_config_quota.go index b40d80128..a8cb7e4bd 100644 --- a/services/albwaf/v1alphaapi/model_waf_config_quota.go +++ b/services/albwaf/v1alphaapi/model_waf_config_quota.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/response.go b/services/albwaf/v1alphaapi/response.go index b613c7b63..6452dea3c 100644 --- a/services/albwaf/v1alphaapi/response.go +++ b/services/albwaf/v1alphaapi/response.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1alphaapi/utils.go b/services/albwaf/v1alphaapi/utils.go index 71356a62a..858295fa3 100644 --- a/services/albwaf/v1alphaapi/utils.go +++ b/services/albwaf/v1alphaapi/utils.go @@ -1,7 +1,7 @@ /* 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. +### DEPRECATED! Use v2alpha instead. 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 */ diff --git a/services/albwaf/v1betaapi/api_default.go b/services/albwaf/v1betaapi/api_default.go new file mode 100644 index 000000000..7f0eecbe4 --- /dev/null +++ b/services/albwaf/v1betaapi/api_default.go @@ -0,0 +1,2493 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateCustomRuleGroup Create a CRG configuration + + Creates a structured rule configuration using the abstract CRG. It can be referenced by any number of WAF configurations in the same project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateCustomRuleGroupRequest + */ + CreateCustomRuleGroup(ctx context.Context, projectId string, region string) ApiCreateCustomRuleGroupRequest + + // CreateCustomRuleGroupExecute executes the request + // @return GetCustomRuleGroupResponse + CreateCustomRuleGroupExecute(r ApiCreateCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) + + /* + CreateManagedRuleSet Create a MRS configuration + + With this endpoint a managed rule set (MRS) configuration is created and stored in this project. Currently it is only possible to enable it. This rule configuration is supposed to be referenced by a WAF configuration. It can be referenced by any number of WAF configurations in the same project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateManagedRuleSetRequest + */ + CreateManagedRuleSet(ctx context.Context, projectId string, region string) ApiCreateManagedRuleSetRequest + + // CreateManagedRuleSetExecute executes the request + // @return GetManagedRuleSetResponse + CreateManagedRuleSetExecute(r ApiCreateManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + + /* + CreateWAF Create a WAF configuration + + This endpoint will create and store a WAF configuration in a project. The name of this WAF configuration is supposed to be used in the listener of an Application Load Balancer, which will activate this configuration and in addition it is possible to enable the managed rule set. This WAF configuration can be used by any number of Application Load Balancers in the same project. The configuration has a reference to a rule configuration. This rule configuration has to exist when trying to create a WAF configuration. Later other configuration references will be added to this object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateWAFRequest + */ + CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest + + // CreateWAFExecute executes the request + // @return GetWAFResponse + CreateWAFExecute(r ApiCreateWAFRequest) (*GetWAFResponse, error) + + /* + DeleteCustomRuleGroup Delete a CRG configuration + + To delete a custom rule group configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteCustomRuleGroupRequest + */ + DeleteCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiDeleteCustomRuleGroupRequest + + // DeleteCustomRuleGroupExecute executes the request + // @return map[string]interface{} + DeleteCustomRuleGroupExecute(r ApiDeleteCustomRuleGroupRequest) (map[string]interface{}, error) + + /* + DeleteManagedRuleSet Delete a MRS configuration + + To delete a managed rule set (MRS) configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteManagedRuleSetRequest + */ + DeleteManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiDeleteManagedRuleSetRequest + + // DeleteManagedRuleSetExecute executes the request + // @return map[string]interface{} + DeleteManagedRuleSetExecute(r ApiDeleteManagedRuleSetRequest) (map[string]interface{}, error) + + /* + DeleteWAF Delete a WAF configuration + + This will delete the specified WAF configuration, but only if it is not used by any Application Load Balancer in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteWAFRequest + */ + DeleteWAF(ctx context.Context, projectId string, region string, name string) ApiDeleteWAFRequest + + // DeleteWAFExecute executes the request + // @return map[string]interface{} + DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string]interface{}, error) + + /* + GetCustomRuleGroup Retrieve a CRG configuration + + Retrieves the specified SecLang custom rule configuration (CRG) structure. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetCustomRuleGroupRequest + */ + GetCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiGetCustomRuleGroupRequest + + // GetCustomRuleGroupExecute executes the request + // @return GetCustomRuleGroupResponse + GetCustomRuleGroupExecute(r ApiGetCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) + + /* + GetManagedRuleSet Retrieve a MRS configuration + + To retrieve an existing managed rule set (MRS) configuration this endpoint can be used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetManagedRuleSetRequest + */ + GetManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiGetManagedRuleSetRequest + + // GetManagedRuleSetExecute executes the request + // @return GetManagedRuleSetResponse + GetManagedRuleSetExecute(r ApiGetManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + + /* + GetQuota Get the quota for WAF resources in a project. + + Retrieves the configured WAF resource quotas for the project. Limit can be changed via service request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiGetQuotaRequest + */ + GetQuota(ctx context.Context, projectId string, region string) ApiGetQuotaRequest + + // GetQuotaExecute executes the request + // @return GetQuotaResponse + GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResponse, error) + + /* + GetWAF Retrieve a WAF configuration + + This endpoint will return the specified WAF configuration. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetWAFRequest + */ + GetWAF(ctx context.Context, projectId string, region string, name string) ApiGetWAFRequest + + // GetWAFExecute executes the request + // @return GetWAFResponse + GetWAFExecute(r ApiGetWAFRequest) (*GetWAFResponse, error) + + /* + ListCustomRuleGroup List of CRG configurations + + List all existing Custom Rule Groups that are stored in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListCustomRuleGroupRequest + */ + ListCustomRuleGroup(ctx context.Context, projectId string, region string) ApiListCustomRuleGroupRequest + + // ListCustomRuleGroupExecute executes the request + // @return ListCustomRuleGroupResponse + ListCustomRuleGroupExecute(r ApiListCustomRuleGroupRequest) (*ListCustomRuleGroupResponse, error) + + /* + ListManagedRuleSets List of MRS configurations + + List all existing managed rule set (MRS) configurations that are stored in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListManagedRuleSetsRequest + */ + ListManagedRuleSets(ctx context.Context, projectId string, region string) ApiListManagedRuleSetsRequest + + // ListManagedRuleSetsExecute executes the request + // @return ListManagedRuleSetResponse + ListManagedRuleSetsExecute(r ApiListManagedRuleSetsRequest) (*ListManagedRuleSetResponse, error) + + /* + ListWAF List of WAF configurations + + To list all WAF configurations stored in a project, use this endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListWAFRequest + */ + ListWAF(ctx context.Context, projectId string, region string) ApiListWAFRequest + + // ListWAFExecute executes the request + // @return ListWAFResponse + ListWAFExecute(r ApiListWAFRequest) (*ListWAFResponse, error) + + /* + PatchManagedRuleSet Granularly update a MRS configuration + + Accepts the same structure as the GET response. Only fields provided with values will be updated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiPatchManagedRuleSetRequest + */ + PatchManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchManagedRuleSetRequest + + // PatchManagedRuleSetExecute executes the request + // @return GetManagedRuleSetResponse + PatchManagedRuleSetExecute(r ApiPatchManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + + /* + UpdateWAF Update a WAF configuration + + The update endpoint will update a stored WAF configuration in project and not yet but later will also update the Load Balancers that reference it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiUpdateWAFRequest + */ + UpdateWAF(ctx context.Context, projectId string, region string, name string) ApiUpdateWAFRequest + + // UpdateWAFExecute executes the request + // @return GetWAFResponse + UpdateWAFExecute(r ApiUpdateWAFRequest) (*GetWAFResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateCustomRuleGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createCustomRuleGroupPayload *CreateCustomRuleGroupPayload +} + +func (r ApiCreateCustomRuleGroupRequest) CreateCustomRuleGroupPayload(createCustomRuleGroupPayload CreateCustomRuleGroupPayload) ApiCreateCustomRuleGroupRequest { + r.createCustomRuleGroupPayload = &createCustomRuleGroupPayload + return r +} + +func (r ApiCreateCustomRuleGroupRequest) Execute() (*GetCustomRuleGroupResponse, error) { + return r.ApiService.CreateCustomRuleGroupExecute(r) +} + +/* +CreateCustomRuleGroup Create a CRG configuration + +Creates a structured rule configuration using the abstract CRG. It can be referenced by any number of WAF configurations in the same project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateCustomRuleGroupRequest +*/ +func (a *DefaultAPIService) CreateCustomRuleGroup(ctx context.Context, projectId string, region string) ApiCreateCustomRuleGroupRequest { + return ApiCreateCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetCustomRuleGroupResponse +func (a *DefaultAPIService) CreateCustomRuleGroupExecute(r ApiCreateCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCustomRuleGroupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCustomRuleGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/custom-rule-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createCustomRuleGroupPayload == nil { + return localVarReturnValue, reportError("createCustomRuleGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCustomRuleGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateManagedRuleSetRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createManagedRuleSetPayload *CreateManagedRuleSetPayload +} + +func (r ApiCreateManagedRuleSetRequest) CreateManagedRuleSetPayload(createManagedRuleSetPayload CreateManagedRuleSetPayload) ApiCreateManagedRuleSetRequest { + r.createManagedRuleSetPayload = &createManagedRuleSetPayload + return r +} + +func (r ApiCreateManagedRuleSetRequest) Execute() (*GetManagedRuleSetResponse, error) { + return r.ApiService.CreateManagedRuleSetExecute(r) +} + +/* +CreateManagedRuleSet Create a MRS configuration + +With this endpoint a managed rule set (MRS) configuration is created and stored in this project. Currently it is only possible to enable it. This rule configuration is supposed to be referenced by a WAF configuration. It can be referenced by any number of WAF configurations in the same project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateManagedRuleSetRequest +*/ +func (a *DefaultAPIService) CreateManagedRuleSet(ctx context.Context, projectId string, region string) ApiCreateManagedRuleSetRequest { + return ApiCreateManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetManagedRuleSetResponse +func (a *DefaultAPIService) CreateManagedRuleSetExecute(r ApiCreateManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetManagedRuleSetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateManagedRuleSet") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/managed-rule-sets" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createManagedRuleSetPayload == nil { + return localVarReturnValue, reportError("createManagedRuleSetPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createManagedRuleSetPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createWAFPayload *CreateWAFPayload +} + +func (r ApiCreateWAFRequest) CreateWAFPayload(createWAFPayload CreateWAFPayload) ApiCreateWAFRequest { + r.createWAFPayload = &createWAFPayload + return r +} + +func (r ApiCreateWAFRequest) Execute() (*GetWAFResponse, error) { + return r.ApiService.CreateWAFExecute(r) +} + +/* +CreateWAF Create a WAF configuration + +This endpoint will create and store a WAF configuration in a project. The name of this WAF configuration is supposed to be used in the listener of an Application Load Balancer, which will activate this configuration and in addition it is possible to enable the managed rule set. This WAF configuration can be used by any number of Application Load Balancers in the same project. The configuration has a reference to a rule configuration. This rule configuration has to exist when trying to create a WAF configuration. Later other configuration references will be added to this object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiCreateWAFRequest +*/ +func (a *DefaultAPIService) CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest { + return ApiCreateWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetWAFResponse +func (a *DefaultAPIService) CreateWAFExecute(r ApiCreateWAFRequest) (*GetWAFResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetWAFResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateWAF") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/wafs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createWAFPayload == nil { + return localVarReturnValue, reportError("createWAFPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createWAFPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCustomRuleGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiDeleteCustomRuleGroupRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteCustomRuleGroupExecute(r) +} + +/* +DeleteCustomRuleGroup Delete a CRG configuration + +To delete a custom rule group configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteCustomRuleGroupRequest +*/ +func (a *DefaultAPIService) DeleteCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiDeleteCustomRuleGroupRequest { + return ApiDeleteCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) DeleteCustomRuleGroupExecute(r ApiDeleteCustomRuleGroupRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomRuleGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/custom-rule-groups/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteManagedRuleSetRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiDeleteManagedRuleSetRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteManagedRuleSetExecute(r) +} + +/* +DeleteManagedRuleSet Delete a MRS configuration + +To delete a managed rule set (MRS) configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteManagedRuleSetRequest +*/ +func (a *DefaultAPIService) DeleteManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiDeleteManagedRuleSetRequest { + return ApiDeleteManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) DeleteManagedRuleSetExecute(r ApiDeleteManagedRuleSetRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteManagedRuleSet") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/managed-rule-sets/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiDeleteWAFRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteWAFExecute(r) +} + +/* +DeleteWAF Delete a WAF configuration + +This will delete the specified WAF configuration, but only if it is not used by any Application Load Balancer in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiDeleteWAFRequest +*/ +func (a *DefaultAPIService) DeleteWAF(ctx context.Context, projectId string, region string, name string) ApiDeleteWAFRequest { + return ApiDeleteWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteWAF") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/wafs/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCustomRuleGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiGetCustomRuleGroupRequest) Execute() (*GetCustomRuleGroupResponse, error) { + return r.ApiService.GetCustomRuleGroupExecute(r) +} + +/* +GetCustomRuleGroup Retrieve a CRG configuration + +Retrieves the specified SecLang custom rule configuration (CRG) structure. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetCustomRuleGroupRequest +*/ +func (a *DefaultAPIService) GetCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiGetCustomRuleGroupRequest { + return ApiGetCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return GetCustomRuleGroupResponse +func (a *DefaultAPIService) GetCustomRuleGroupExecute(r ApiGetCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCustomRuleGroupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomRuleGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/custom-rule-groups/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetManagedRuleSetRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiGetManagedRuleSetRequest) Execute() (*GetManagedRuleSetResponse, error) { + return r.ApiService.GetManagedRuleSetExecute(r) +} + +/* +GetManagedRuleSet Retrieve a MRS configuration + +To retrieve an existing managed rule set (MRS) configuration this endpoint can be used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetManagedRuleSetRequest +*/ +func (a *DefaultAPIService) GetManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiGetManagedRuleSetRequest { + return ApiGetManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return GetManagedRuleSetResponse +func (a *DefaultAPIService) GetManagedRuleSetExecute(r ApiGetManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetManagedRuleSetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetManagedRuleSet") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/managed-rule-sets/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetQuotaRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiGetQuotaRequest) Execute() (*GetQuotaResponse, error) { + return r.ApiService.GetQuotaExecute(r) +} + +/* +GetQuota Get the quota for WAF resources in a project. + +Retrieves the configured WAF resource quotas for the project. Limit can be changed via service request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiGetQuotaRequest +*/ +func (a *DefaultAPIService) GetQuota(ctx context.Context, projectId string, region string) ApiGetQuotaRequest { + return ApiGetQuotaRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetQuotaResponse +func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetQuotaResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetQuota") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string +} + +func (r ApiGetWAFRequest) Execute() (*GetWAFResponse, error) { + return r.ApiService.GetWAFExecute(r) +} + +/* +GetWAF Retrieve a WAF configuration + +This endpoint will return the specified WAF configuration. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiGetWAFRequest +*/ +func (a *DefaultAPIService) GetWAF(ctx context.Context, projectId string, region string, name string) ApiGetWAFRequest { + return ApiGetWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return GetWAFResponse +func (a *DefaultAPIService) GetWAFExecute(r ApiGetWAFRequest) (*GetWAFResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetWAFResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetWAF") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/wafs/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCustomRuleGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + pageSize *string + pageId *string +} + +// page_size specifies how many rule configurations should be returned on this page. Must be a positive number <= 1000 +func (r ApiListCustomRuleGroupRequest) PageSize(pageSize string) ApiListCustomRuleGroupRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page +func (r ApiListCustomRuleGroupRequest) PageId(pageId string) ApiListCustomRuleGroupRequest { + r.pageId = &pageId + return r +} + +func (r ApiListCustomRuleGroupRequest) Execute() (*ListCustomRuleGroupResponse, error) { + return r.ApiService.ListCustomRuleGroupExecute(r) +} + +/* +ListCustomRuleGroup List of CRG configurations + +List all existing Custom Rule Groups that are stored in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListCustomRuleGroupRequest +*/ +func (a *DefaultAPIService) ListCustomRuleGroup(ctx context.Context, projectId string, region string) ApiListCustomRuleGroupRequest { + return ApiListCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListCustomRuleGroupResponse +func (a *DefaultAPIService) ListCustomRuleGroupExecute(r ApiListCustomRuleGroupRequest) (*ListCustomRuleGroupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCustomRuleGroupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCustomRuleGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/custom-rule-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListManagedRuleSetsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + pageSize *string + pageId *string +} + +// page_size specifies how many rule configurations should be returned on this page. Must be a positive number <= 1000 +func (r ApiListManagedRuleSetsRequest) PageSize(pageSize string) ApiListManagedRuleSetsRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page +func (r ApiListManagedRuleSetsRequest) PageId(pageId string) ApiListManagedRuleSetsRequest { + r.pageId = &pageId + return r +} + +func (r ApiListManagedRuleSetsRequest) Execute() (*ListManagedRuleSetResponse, error) { + return r.ApiService.ListManagedRuleSetsExecute(r) +} + +/* +ListManagedRuleSets List of MRS configurations + +List all existing managed rule set (MRS) configurations that are stored in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListManagedRuleSetsRequest +*/ +func (a *DefaultAPIService) ListManagedRuleSets(ctx context.Context, projectId string, region string) ApiListManagedRuleSetsRequest { + return ApiListManagedRuleSetsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListManagedRuleSetResponse +func (a *DefaultAPIService) ListManagedRuleSetsExecute(r ApiListManagedRuleSetsRequest) (*ListManagedRuleSetResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListManagedRuleSetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListManagedRuleSets") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/managed-rule-sets" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + pageSize *string + pageId *string +} + +// page_size specifies how many WAFs should be returned on this page. Must be a positive number <= 1000 +func (r ApiListWAFRequest) PageSize(pageSize string) ApiListWAFRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page +func (r ApiListWAFRequest) PageId(pageId string) ApiListWAFRequest { + r.pageId = &pageId + return r +} + +func (r ApiListWAFRequest) Execute() (*ListWAFResponse, error) { + return r.ApiService.ListWAFExecute(r) +} + +/* +ListWAF List of WAF configurations + +To list all WAF configurations stored in a project, use this endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @return ApiListWAFRequest +*/ +func (a *DefaultAPIService) ListWAF(ctx context.Context, projectId string, region string) ApiListWAFRequest { + return ApiListWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListWAFResponse +func (a *DefaultAPIService) ListWAFExecute(r ApiListWAFRequest) (*ListWAFResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListWAFResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWAF") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/wafs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchManagedRuleSetRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string + patchManagedRuleSetPayload *PatchManagedRuleSetPayload +} + +func (r ApiPatchManagedRuleSetRequest) PatchManagedRuleSetPayload(patchManagedRuleSetPayload PatchManagedRuleSetPayload) ApiPatchManagedRuleSetRequest { + r.patchManagedRuleSetPayload = &patchManagedRuleSetPayload + return r +} + +func (r ApiPatchManagedRuleSetRequest) Execute() (*GetManagedRuleSetResponse, error) { + return r.ApiService.PatchManagedRuleSetExecute(r) +} + +/* +PatchManagedRuleSet Granularly update a MRS configuration + +Accepts the same structure as the GET response. Only fields provided with values will be updated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiPatchManagedRuleSetRequest +*/ +func (a *DefaultAPIService) PatchManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchManagedRuleSetRequest { + return ApiPatchManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return GetManagedRuleSetResponse +func (a *DefaultAPIService) PatchManagedRuleSetExecute(r ApiPatchManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetManagedRuleSetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchManagedRuleSet") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/managed-rule-sets/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.patchManagedRuleSetPayload == nil { + return localVarReturnValue, reportError("patchManagedRuleSetPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchManagedRuleSetPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string + updateWAFPayload *UpdateWAFPayload +} + +func (r ApiUpdateWAFRequest) UpdateWAFPayload(updateWAFPayload UpdateWAFPayload) ApiUpdateWAFRequest { + r.updateWAFPayload = &updateWAFPayload + return r +} + +func (r ApiUpdateWAFRequest) Execute() (*GetWAFResponse, error) { + return r.ApiService.UpdateWAFExecute(r) +} + +/* +UpdateWAF Update a WAF configuration + +The update endpoint will update a stored WAF configuration in project and not yet but later will also update the Load Balancers that reference it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param name + @return ApiUpdateWAFRequest +*/ +func (a *DefaultAPIService) UpdateWAF(ctx context.Context, projectId string, region string, name string) ApiUpdateWAFRequest { + return ApiUpdateWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// Execute executes the request +// +// @return GetWAFResponse +func (a *DefaultAPIService) UpdateWAFExecute(r ApiUpdateWAFRequest) (*GetWAFResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetWAFResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateWAF") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/wafs/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateWAFPayload == nil { + return localVarReturnValue, reportError("updateWAFPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateWAFPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + var v Status + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/albwaf/v1betaapi/api_default_mock.go b/services/albwaf/v1betaapi/api_default_mock.go new file mode 100644 index 000000000..c4188cd25 --- /dev/null +++ b/services/albwaf/v1betaapi/api_default_mock.go @@ -0,0 +1,346 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateCustomRuleGroupExecuteMock can be populated to implement the behavior of the CreateCustomRuleGroupExecute function of this mock + CreateCustomRuleGroupExecuteMock *func(r ApiCreateCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) + // CreateManagedRuleSetExecuteMock can be populated to implement the behavior of the CreateManagedRuleSetExecute function of this mock + CreateManagedRuleSetExecuteMock *func(r ApiCreateManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + // CreateWAFExecuteMock can be populated to implement the behavior of the CreateWAFExecute function of this mock + CreateWAFExecuteMock *func(r ApiCreateWAFRequest) (*GetWAFResponse, error) + // DeleteCustomRuleGroupExecuteMock can be populated to implement the behavior of the DeleteCustomRuleGroupExecute function of this mock + DeleteCustomRuleGroupExecuteMock *func(r ApiDeleteCustomRuleGroupRequest) (map[string]interface{}, error) + // DeleteManagedRuleSetExecuteMock can be populated to implement the behavior of the DeleteManagedRuleSetExecute function of this mock + DeleteManagedRuleSetExecuteMock *func(r ApiDeleteManagedRuleSetRequest) (map[string]interface{}, error) + // DeleteWAFExecuteMock can be populated to implement the behavior of the DeleteWAFExecute function of this mock + DeleteWAFExecuteMock *func(r ApiDeleteWAFRequest) (map[string]interface{}, error) + // GetCustomRuleGroupExecuteMock can be populated to implement the behavior of the GetCustomRuleGroupExecute function of this mock + GetCustomRuleGroupExecuteMock *func(r ApiGetCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) + // GetManagedRuleSetExecuteMock can be populated to implement the behavior of the GetManagedRuleSetExecute function of this mock + GetManagedRuleSetExecuteMock *func(r ApiGetManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + // GetQuotaExecuteMock can be populated to implement the behavior of the GetQuotaExecute function of this mock + GetQuotaExecuteMock *func(r ApiGetQuotaRequest) (*GetQuotaResponse, error) + // GetWAFExecuteMock can be populated to implement the behavior of the GetWAFExecute function of this mock + GetWAFExecuteMock *func(r ApiGetWAFRequest) (*GetWAFResponse, error) + // ListCustomRuleGroupExecuteMock can be populated to implement the behavior of the ListCustomRuleGroupExecute function of this mock + ListCustomRuleGroupExecuteMock *func(r ApiListCustomRuleGroupRequest) (*ListCustomRuleGroupResponse, error) + // ListManagedRuleSetsExecuteMock can be populated to implement the behavior of the ListManagedRuleSetsExecute function of this mock + ListManagedRuleSetsExecuteMock *func(r ApiListManagedRuleSetsRequest) (*ListManagedRuleSetResponse, error) + // ListWAFExecuteMock can be populated to implement the behavior of the ListWAFExecute function of this mock + ListWAFExecuteMock *func(r ApiListWAFRequest) (*ListWAFResponse, error) + // PatchManagedRuleSetExecuteMock can be populated to implement the behavior of the PatchManagedRuleSetExecute function of this mock + PatchManagedRuleSetExecuteMock *func(r ApiPatchManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) + // UpdateWAFExecuteMock can be populated to implement the behavior of the UpdateWAFExecute function of this mock + UpdateWAFExecuteMock *func(r ApiUpdateWAFRequest) (*GetWAFResponse, error) +} + +func (a DefaultAPIServiceMock) CreateCustomRuleGroup(ctx context.Context, projectId string, region string) ApiCreateCustomRuleGroupRequest { + return ApiCreateCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateCustomRuleGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCustomRuleGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCustomRuleGroupExecute(r ApiCreateCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) { + if a.CreateCustomRuleGroupExecuteMock == nil { + var localVarReturnValue *GetCustomRuleGroupResponse + return localVarReturnValue, nil + } + + return (*a.CreateCustomRuleGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateManagedRuleSet(ctx context.Context, projectId string, region string) ApiCreateManagedRuleSetRequest { + return ApiCreateManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateManagedRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateManagedRuleSetExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateManagedRuleSetExecute(r ApiCreateManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + if a.CreateManagedRuleSetExecuteMock == nil { + var localVarReturnValue *GetManagedRuleSetResponse + return localVarReturnValue, nil + } + + return (*a.CreateManagedRuleSetExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest { + return ApiCreateWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateWAFExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateWAFExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateWAFExecute(r ApiCreateWAFRequest) (*GetWAFResponse, error) { + if a.CreateWAFExecuteMock == nil { + var localVarReturnValue *GetWAFResponse + return localVarReturnValue, nil + } + + return (*a.CreateWAFExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiDeleteCustomRuleGroupRequest { + return ApiDeleteCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// DeleteCustomRuleGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomRuleGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCustomRuleGroupExecute(r ApiDeleteCustomRuleGroupRequest) (map[string]interface{}, error) { + if a.DeleteCustomRuleGroupExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.DeleteCustomRuleGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiDeleteManagedRuleSetRequest { + return ApiDeleteManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// DeleteManagedRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteManagedRuleSetExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteManagedRuleSetExecute(r ApiDeleteManagedRuleSetRequest) (map[string]interface{}, error) { + if a.DeleteManagedRuleSetExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.DeleteManagedRuleSetExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteWAF(ctx context.Context, projectId string, region string, name string) ApiDeleteWAFRequest { + return ApiDeleteWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// DeleteWAFExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteWAFExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string]interface{}, error) { + if a.DeleteWAFExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.DeleteWAFExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCustomRuleGroup(ctx context.Context, projectId string, region string, name string) ApiGetCustomRuleGroupRequest { + return ApiGetCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// GetCustomRuleGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomRuleGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCustomRuleGroupExecute(r ApiGetCustomRuleGroupRequest) (*GetCustomRuleGroupResponse, error) { + if a.GetCustomRuleGroupExecuteMock == nil { + var localVarReturnValue *GetCustomRuleGroupResponse + return localVarReturnValue, nil + } + + return (*a.GetCustomRuleGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiGetManagedRuleSetRequest { + return ApiGetManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// GetManagedRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetManagedRuleSetExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetManagedRuleSetExecute(r ApiGetManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + if a.GetManagedRuleSetExecuteMock == nil { + var localVarReturnValue *GetManagedRuleSetResponse + return localVarReturnValue, nil + } + + return (*a.GetManagedRuleSetExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetQuota(ctx context.Context, projectId string, region string) ApiGetQuotaRequest { + return ApiGetQuotaRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// GetQuotaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetQuotaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResponse, error) { + if a.GetQuotaExecuteMock == nil { + var localVarReturnValue *GetQuotaResponse + return localVarReturnValue, nil + } + + return (*a.GetQuotaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetWAF(ctx context.Context, projectId string, region string, name string) ApiGetWAFRequest { + return ApiGetWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// GetWAFExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetWAFExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetWAFExecute(r ApiGetWAFRequest) (*GetWAFResponse, error) { + if a.GetWAFExecuteMock == nil { + var localVarReturnValue *GetWAFResponse + return localVarReturnValue, nil + } + + return (*a.GetWAFExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCustomRuleGroup(ctx context.Context, projectId string, region string) ApiListCustomRuleGroupRequest { + return ApiListCustomRuleGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListCustomRuleGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCustomRuleGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCustomRuleGroupExecute(r ApiListCustomRuleGroupRequest) (*ListCustomRuleGroupResponse, error) { + if a.ListCustomRuleGroupExecuteMock == nil { + var localVarReturnValue *ListCustomRuleGroupResponse + return localVarReturnValue, nil + } + + return (*a.ListCustomRuleGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListManagedRuleSets(ctx context.Context, projectId string, region string) ApiListManagedRuleSetsRequest { + return ApiListManagedRuleSetsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListManagedRuleSetsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListManagedRuleSetsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListManagedRuleSetsExecute(r ApiListManagedRuleSetsRequest) (*ListManagedRuleSetResponse, error) { + if a.ListManagedRuleSetsExecuteMock == nil { + var localVarReturnValue *ListManagedRuleSetResponse + return localVarReturnValue, nil + } + + return (*a.ListManagedRuleSetsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListWAF(ctx context.Context, projectId string, region string) ApiListWAFRequest { + return ApiListWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListWAFExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWAFExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListWAFExecute(r ApiListWAFRequest) (*ListWAFResponse, error) { + if a.ListWAFExecuteMock == nil { + var localVarReturnValue *ListWAFResponse + return localVarReturnValue, nil + } + + return (*a.ListWAFExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchManagedRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchManagedRuleSetRequest { + return ApiPatchManagedRuleSetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// PatchManagedRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchManagedRuleSetExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchManagedRuleSetExecute(r ApiPatchManagedRuleSetRequest) (*GetManagedRuleSetResponse, error) { + if a.PatchManagedRuleSetExecuteMock == nil { + var localVarReturnValue *GetManagedRuleSetResponse + return localVarReturnValue, nil + } + + return (*a.PatchManagedRuleSetExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateWAF(ctx context.Context, projectId string, region string, name string) ApiUpdateWAFRequest { + return ApiUpdateWAFRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + name: name, + } +} + +// UpdateWAFExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateWAFExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateWAFExecute(r ApiUpdateWAFRequest) (*GetWAFResponse, error) { + if a.UpdateWAFExecuteMock == nil { + var localVarReturnValue *GetWAFResponse + return localVarReturnValue, nil + } + + return (*a.UpdateWAFExecuteMock)(r) +} diff --git a/services/albwaf/v1betaapi/client.go b/services/albwaf/v1betaapi/client.go new file mode 100644 index 000000000..5137e915e --- /dev/null +++ b/services/albwaf/v1betaapi/client.go @@ -0,0 +1,658 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Application Load Balancer Web Application Firewall API API v1beta.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/albwaf/v1betaapi/configuration.go b/services/albwaf/v1betaapi/configuration.go new file mode 100644 index 000000000..8d7b39305 --- /dev/null +++ b/services/albwaf/v1betaapi/configuration.go @@ -0,0 +1,37 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/albwaf", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://alb-waf.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/albwaf/v1betaapi/model_behaviour.go b/services/albwaf/v1betaapi/model_behaviour.go new file mode 100644 index 000000000..dce0208ca --- /dev/null +++ b/services/albwaf/v1betaapi/model_behaviour.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the Behaviour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Behaviour{} + +// Behaviour struct for Behaviour +type Behaviour struct { + Action *BehaviourAction `json:"action,omitempty"` + // Determines whether an entry should be generated in the security ledger upon a rule hit. + Log *bool `json:"log,omitempty"` + // Custom notification message string mapped to underlying logdata contexts. Required if log is true. + LogMsg *string `json:"logMsg,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Behaviour Behaviour + +// NewBehaviour instantiates a new Behaviour 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 NewBehaviour() *Behaviour { + this := Behaviour{} + return &this +} + +// NewBehaviourWithDefaults instantiates a new Behaviour 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 NewBehaviourWithDefaults() *Behaviour { + this := Behaviour{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *Behaviour) GetAction() BehaviourAction { + if o == nil || IsNil(o.Action) { + var ret BehaviourAction + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Behaviour) GetActionOk() (*BehaviourAction, bool) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *Behaviour) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given BehaviourAction and assigns it to the Action field. +func (o *Behaviour) SetAction(v BehaviourAction) { + o.Action = &v +} + +// GetLog returns the Log field value if set, zero value otherwise. +func (o *Behaviour) GetLog() bool { + if o == nil || IsNil(o.Log) { + var ret bool + return ret + } + return *o.Log +} + +// GetLogOk returns a tuple with the Log field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Behaviour) GetLogOk() (*bool, bool) { + if o == nil || IsNil(o.Log) { + return nil, false + } + return o.Log, true +} + +// HasLog returns a boolean if a field has been set. +func (o *Behaviour) HasLog() bool { + if o != nil && !IsNil(o.Log) { + return true + } + + return false +} + +// SetLog gets a reference to the given bool and assigns it to the Log field. +func (o *Behaviour) SetLog(v bool) { + o.Log = &v +} + +// GetLogMsg returns the LogMsg field value if set, zero value otherwise. +func (o *Behaviour) GetLogMsg() string { + if o == nil || IsNil(o.LogMsg) { + var ret string + return ret + } + return *o.LogMsg +} + +// GetLogMsgOk returns a tuple with the LogMsg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Behaviour) GetLogMsgOk() (*string, bool) { + if o == nil || IsNil(o.LogMsg) { + return nil, false + } + return o.LogMsg, true +} + +// HasLogMsg returns a boolean if a field has been set. +func (o *Behaviour) HasLogMsg() bool { + if o != nil && !IsNil(o.LogMsg) { + return true + } + + return false +} + +// SetLogMsg gets a reference to the given string and assigns it to the LogMsg field. +func (o *Behaviour) SetLogMsg(v string) { + o.LogMsg = &v +} + +func (o Behaviour) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Behaviour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.Log) { + toSerialize["log"] = o.Log + } + if !IsNil(o.LogMsg) { + toSerialize["logMsg"] = o.LogMsg + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Behaviour) UnmarshalJSON(data []byte) (err error) { + varBehaviour := _Behaviour{} + + err = json.Unmarshal(data, &varBehaviour) + + if err != nil { + return err + } + + *o = Behaviour(varBehaviour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "action") + delete(additionalProperties, "log") + delete(additionalProperties, "logMsg") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBehaviour struct { + value *Behaviour + isSet bool +} + +func (v NullableBehaviour) Get() *Behaviour { + return v.value +} + +func (v *NullableBehaviour) Set(val *Behaviour) { + v.value = val + v.isSet = true +} + +func (v NullableBehaviour) IsSet() bool { + return v.isSet +} + +func (v *NullableBehaviour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBehaviour(val *Behaviour) *NullableBehaviour { + return &NullableBehaviour{value: val, isSet: true} +} + +func (v NullableBehaviour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBehaviour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_behaviour_action.go b/services/albwaf/v1betaapi/model_behaviour_action.go new file mode 100644 index 000000000..303327989 --- /dev/null +++ b/services/albwaf/v1betaapi/model_behaviour_action.go @@ -0,0 +1,117 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// BehaviourAction The protective stance action. ACTION_DENY forces a 403 status response code. +type BehaviourAction string + +// List of Behaviour_action +const ( + BEHAVIOURACTION_ACTION_UNSPECIFIED BehaviourAction = "ACTION_UNSPECIFIED" + BEHAVIOURACTION_ACTION_DENY BehaviourAction = "ACTION_DENY" + BEHAVIOURACTION_ACTION_PASS BehaviourAction = "ACTION_PASS" + BEHAVIOURACTION_ACTION_ALLOW BehaviourAction = "ACTION_ALLOW" + BEHAVIOURACTION_UNKNOWN_DEFAULT_OPEN_API BehaviourAction = "unknown_default_open_api" +) + +// All allowed values of BehaviourAction enum +var AllowedBehaviourActionEnumValues = []BehaviourAction{ + "ACTION_UNSPECIFIED", + "ACTION_DENY", + "ACTION_PASS", + "ACTION_ALLOW", + "unknown_default_open_api", +} + +func (v *BehaviourAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BehaviourAction(value) + for _, existing := range AllowedBehaviourActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BEHAVIOURACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBehaviourActionFromValue returns a pointer to a valid BehaviourAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBehaviourActionFromValue(v string) (*BehaviourAction, error) { + ev := BehaviourAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BehaviourAction: valid values are %v", v, AllowedBehaviourActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BehaviourAction) IsValid() bool { + for _, existing := range AllowedBehaviourActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Behaviour_action value +func (v BehaviourAction) Ptr() *BehaviourAction { + return &v +} + +type NullableBehaviourAction struct { + value *BehaviourAction + isSet bool +} + +func (v NullableBehaviourAction) Get() *BehaviourAction { + return v.value +} + +func (v *NullableBehaviourAction) Set(val *BehaviourAction) { + v.value = val + v.isSet = true +} + +func (v NullableBehaviourAction) IsSet() bool { + return v.isSet +} + +func (v *NullableBehaviourAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBehaviourAction(val *BehaviourAction) *NullableBehaviourAction { + return &NullableBehaviourAction{value: val, isSet: true} +} + +func (v NullableBehaviourAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBehaviourAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition.go b/services/albwaf/v1betaapi/model_condition.go new file mode 100644 index 000000000..3681f1d46 --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition.go @@ -0,0 +1,228 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the Condition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Condition{} + +// Condition struct for Condition +type Condition struct { + Operator *ConditionOperator `json:"operator,omitempty"` + // [HINT] Ordered processing adjustments applied to clean inputs before match checking. + Transformations []ConditionTransformationsInner `json:"transformations,omitempty"` + Variable *ConditionVariable `json:"variable,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Condition Condition + +// NewCondition instantiates a new Condition 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 NewCondition() *Condition { + this := Condition{} + return &this +} + +// NewConditionWithDefaults instantiates a new Condition 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 NewConditionWithDefaults() *Condition { + this := Condition{} + return &this +} + +// GetOperator returns the Operator field value if set, zero value otherwise. +func (o *Condition) GetOperator() ConditionOperator { + if o == nil || IsNil(o.Operator) { + var ret ConditionOperator + return ret + } + return *o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Condition) GetOperatorOk() (*ConditionOperator, bool) { + if o == nil || IsNil(o.Operator) { + return nil, false + } + return o.Operator, true +} + +// HasOperator returns a boolean if a field has been set. +func (o *Condition) HasOperator() bool { + if o != nil && !IsNil(o.Operator) { + return true + } + + return false +} + +// SetOperator gets a reference to the given ConditionOperator and assigns it to the Operator field. +func (o *Condition) SetOperator(v ConditionOperator) { + o.Operator = &v +} + +// GetTransformations returns the Transformations field value if set, zero value otherwise. +func (o *Condition) GetTransformations() []ConditionTransformationsInner { + if o == nil || IsNil(o.Transformations) { + var ret []ConditionTransformationsInner + return ret + } + return o.Transformations +} + +// GetTransformationsOk returns a tuple with the Transformations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Condition) GetTransformationsOk() ([]ConditionTransformationsInner, bool) { + if o == nil || IsNil(o.Transformations) { + return nil, false + } + return o.Transformations, true +} + +// HasTransformations returns a boolean if a field has been set. +func (o *Condition) HasTransformations() bool { + if o != nil && !IsNil(o.Transformations) { + return true + } + + return false +} + +// SetTransformations gets a reference to the given []ConditionTransformationsInner and assigns it to the Transformations field. +func (o *Condition) SetTransformations(v []ConditionTransformationsInner) { + o.Transformations = v +} + +// GetVariable returns the Variable field value if set, zero value otherwise. +func (o *Condition) GetVariable() ConditionVariable { + if o == nil || IsNil(o.Variable) { + var ret ConditionVariable + return ret + } + return *o.Variable +} + +// GetVariableOk returns a tuple with the Variable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Condition) GetVariableOk() (*ConditionVariable, bool) { + if o == nil || IsNil(o.Variable) { + return nil, false + } + return o.Variable, true +} + +// HasVariable returns a boolean if a field has been set. +func (o *Condition) HasVariable() bool { + if o != nil && !IsNil(o.Variable) { + return true + } + + return false +} + +// SetVariable gets a reference to the given ConditionVariable and assigns it to the Variable field. +func (o *Condition) SetVariable(v ConditionVariable) { + o.Variable = &v +} + +func (o Condition) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Condition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Operator) { + toSerialize["operator"] = o.Operator + } + if !IsNil(o.Transformations) { + toSerialize["transformations"] = o.Transformations + } + if !IsNil(o.Variable) { + toSerialize["variable"] = o.Variable + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Condition) UnmarshalJSON(data []byte) (err error) { + varCondition := _Condition{} + + err = json.Unmarshal(data, &varCondition) + + if err != nil { + return err + } + + *o = Condition(varCondition) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "operator") + delete(additionalProperties, "transformations") + delete(additionalProperties, "variable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCondition struct { + value *Condition + isSet bool +} + +func (v NullableCondition) Get() *Condition { + return v.value +} + +func (v *NullableCondition) Set(val *Condition) { + v.value = val + v.isSet = true +} + +func (v NullableCondition) IsSet() bool { + return v.isSet +} + +func (v *NullableCondition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCondition(val *Condition) *NullableCondition { + return &NullableCondition{value: val, isSet: true} +} + +func (v NullableCondition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCondition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition_operator.go b/services/albwaf/v1betaapi/model_condition_operator.go new file mode 100644 index 000000000..b7aa8f70e --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition_operator.go @@ -0,0 +1,191 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ConditionOperator type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConditionOperator{} + +// ConditionOperator struct for ConditionOperator +type ConditionOperator struct { + Type *ConditionOperatorType `json:"type,omitempty"` + // The text or rule regex pattern arguments applied inside the operator execution loop. + Value *string `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConditionOperator ConditionOperator + +// NewConditionOperator instantiates a new ConditionOperator 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 NewConditionOperator() *ConditionOperator { + this := ConditionOperator{} + return &this +} + +// NewConditionOperatorWithDefaults instantiates a new ConditionOperator 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 NewConditionOperatorWithDefaults() *ConditionOperator { + this := ConditionOperator{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConditionOperator) GetType() ConditionOperatorType { + if o == nil || IsNil(o.Type) { + var ret ConditionOperatorType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConditionOperator) GetTypeOk() (*ConditionOperatorType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConditionOperator) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConditionOperatorType and assigns it to the Type field. +func (o *ConditionOperator) SetType(v ConditionOperatorType) { + o.Type = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ConditionOperator) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConditionOperator) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ConditionOperator) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *ConditionOperator) SetValue(v string) { + o.Value = &v +} + +func (o ConditionOperator) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConditionOperator) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConditionOperator) UnmarshalJSON(data []byte) (err error) { + varConditionOperator := _ConditionOperator{} + + err = json.Unmarshal(data, &varConditionOperator) + + if err != nil { + return err + } + + *o = ConditionOperator(varConditionOperator) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConditionOperator struct { + value *ConditionOperator + isSet bool +} + +func (v NullableConditionOperator) Get() *ConditionOperator { + return v.value +} + +func (v *NullableConditionOperator) Set(val *ConditionOperator) { + v.value = val + v.isSet = true +} + +func (v NullableConditionOperator) IsSet() bool { + return v.isSet +} + +func (v *NullableConditionOperator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConditionOperator(val *ConditionOperator) *NullableConditionOperator { + return &NullableConditionOperator{value: val, isSet: true} +} + +func (v NullableConditionOperator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConditionOperator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition_operator_type.go b/services/albwaf/v1betaapi/model_condition_operator_type.go new file mode 100644 index 000000000..40d499a44 --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition_operator_type.go @@ -0,0 +1,143 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ConditionOperatorType The operational evaluation type definition macro. +type ConditionOperatorType string + +// List of ConditionOperator_type +const ( + CONDITIONOPERATORTYPE_OPERATOR_UNSPECIFIED ConditionOperatorType = "OPERATOR_UNSPECIFIED" + CONDITIONOPERATORTYPE_OPERATOR_BEGINS_WITH ConditionOperatorType = "OPERATOR_BEGINS_WITH" + CONDITIONOPERATORTYPE_OPERATOR_CONTAINS ConditionOperatorType = "OPERATOR_CONTAINS" + CONDITIONOPERATORTYPE_OPERATOR_ENDS_WITH ConditionOperatorType = "OPERATOR_ENDS_WITH" + CONDITIONOPERATORTYPE_OPERATOR_EQ ConditionOperatorType = "OPERATOR_EQ" + CONDITIONOPERATORTYPE_OPERATOR_GE ConditionOperatorType = "OPERATOR_GE" + CONDITIONOPERATORTYPE_OPERATOR_GT ConditionOperatorType = "OPERATOR_GT" + CONDITIONOPERATORTYPE_OPERATOR_IP_MATCH ConditionOperatorType = "OPERATOR_IP_MATCH" + CONDITIONOPERATORTYPE_OPERATOR_LE ConditionOperatorType = "OPERATOR_LE" + CONDITIONOPERATORTYPE_OPERATOR_LT ConditionOperatorType = "OPERATOR_LT" + CONDITIONOPERATORTYPE_OPERATOR_RX ConditionOperatorType = "OPERATOR_RX" + CONDITIONOPERATORTYPE_OPERATOR_STREQ ConditionOperatorType = "OPERATOR_STREQ" + CONDITIONOPERATORTYPE_OPERATOR_STRMATCH ConditionOperatorType = "OPERATOR_STRMATCH" + CONDITIONOPERATORTYPE_OPERATOR_VALIDATE_SCHEMA ConditionOperatorType = "OPERATOR_VALIDATE_SCHEMA" + CONDITIONOPERATORTYPE_OPERATOR_VALIDATE_URL_ENCODING ConditionOperatorType = "OPERATOR_VALIDATE_URL_ENCODING" + CONDITIONOPERATORTYPE_OPERATOR_VALIDATE_UTF8_ENCODING ConditionOperatorType = "OPERATOR_VALIDATE_UTF8_ENCODING" + CONDITIONOPERATORTYPE_OPERATOR_WITHIN ConditionOperatorType = "OPERATOR_WITHIN" + CONDITIONOPERATORTYPE_UNKNOWN_DEFAULT_OPEN_API ConditionOperatorType = "unknown_default_open_api" +) + +// All allowed values of ConditionOperatorType enum +var AllowedConditionOperatorTypeEnumValues = []ConditionOperatorType{ + "OPERATOR_UNSPECIFIED", + "OPERATOR_BEGINS_WITH", + "OPERATOR_CONTAINS", + "OPERATOR_ENDS_WITH", + "OPERATOR_EQ", + "OPERATOR_GE", + "OPERATOR_GT", + "OPERATOR_IP_MATCH", + "OPERATOR_LE", + "OPERATOR_LT", + "OPERATOR_RX", + "OPERATOR_STREQ", + "OPERATOR_STRMATCH", + "OPERATOR_VALIDATE_SCHEMA", + "OPERATOR_VALIDATE_URL_ENCODING", + "OPERATOR_VALIDATE_UTF8_ENCODING", + "OPERATOR_WITHIN", + "unknown_default_open_api", +} + +func (v *ConditionOperatorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConditionOperatorType(value) + for _, existing := range AllowedConditionOperatorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CONDITIONOPERATORTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewConditionOperatorTypeFromValue returns a pointer to a valid ConditionOperatorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConditionOperatorTypeFromValue(v string) (*ConditionOperatorType, error) { + ev := ConditionOperatorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConditionOperatorType: valid values are %v", v, AllowedConditionOperatorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConditionOperatorType) IsValid() bool { + for _, existing := range AllowedConditionOperatorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConditionOperator_type value +func (v ConditionOperatorType) Ptr() *ConditionOperatorType { + return &v +} + +type NullableConditionOperatorType struct { + value *ConditionOperatorType + isSet bool +} + +func (v NullableConditionOperatorType) Get() *ConditionOperatorType { + return v.value +} + +func (v *NullableConditionOperatorType) Set(val *ConditionOperatorType) { + v.value = val + v.isSet = true +} + +func (v NullableConditionOperatorType) IsSet() bool { + return v.isSet +} + +func (v *NullableConditionOperatorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConditionOperatorType(val *ConditionOperatorType) *NullableConditionOperatorType { + return &NullableConditionOperatorType{value: val, isSet: true} +} + +func (v NullableConditionOperatorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConditionOperatorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition_transformations_inner.go b/services/albwaf/v1betaapi/model_condition_transformations_inner.go new file mode 100644 index 000000000..a7e4d954e --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition_transformations_inner.go @@ -0,0 +1,123 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ConditionTransformationsInner the model 'ConditionTransformationsInner' +type ConditionTransformationsInner string + +// List of Condition_transformations_inner +const ( + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_UNSPECIFIED ConditionTransformationsInner = "TRANSFORMATION_UNSPECIFIED" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_LENGTH ConditionTransformationsInner = "TRANSFORMATION_LENGTH" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_LOWERCASE ConditionTransformationsInner = "TRANSFORMATION_LOWERCASE" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_NONE ConditionTransformationsInner = "TRANSFORMATION_NONE" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_TRIM ConditionTransformationsInner = "TRANSFORMATION_TRIM" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_UPPERCASE ConditionTransformationsInner = "TRANSFORMATION_UPPERCASE" + CONDITIONTRANSFORMATIONSINNER_TRANSFORMATION_UTF8_TO_UNICODE ConditionTransformationsInner = "TRANSFORMATION_UTF8_TO_UNICODE" + CONDITIONTRANSFORMATIONSINNER_UNKNOWN_DEFAULT_OPEN_API ConditionTransformationsInner = "unknown_default_open_api" +) + +// All allowed values of ConditionTransformationsInner enum +var AllowedConditionTransformationsInnerEnumValues = []ConditionTransformationsInner{ + "TRANSFORMATION_UNSPECIFIED", + "TRANSFORMATION_LENGTH", + "TRANSFORMATION_LOWERCASE", + "TRANSFORMATION_NONE", + "TRANSFORMATION_TRIM", + "TRANSFORMATION_UPPERCASE", + "TRANSFORMATION_UTF8_TO_UNICODE", + "unknown_default_open_api", +} + +func (v *ConditionTransformationsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConditionTransformationsInner(value) + for _, existing := range AllowedConditionTransformationsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CONDITIONTRANSFORMATIONSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewConditionTransformationsInnerFromValue returns a pointer to a valid ConditionTransformationsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConditionTransformationsInnerFromValue(v string) (*ConditionTransformationsInner, error) { + ev := ConditionTransformationsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConditionTransformationsInner: valid values are %v", v, AllowedConditionTransformationsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConditionTransformationsInner) IsValid() bool { + for _, existing := range AllowedConditionTransformationsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Condition_transformations_inner value +func (v ConditionTransformationsInner) Ptr() *ConditionTransformationsInner { + return &v +} + +type NullableConditionTransformationsInner struct { + value *ConditionTransformationsInner + isSet bool +} + +func (v NullableConditionTransformationsInner) Get() *ConditionTransformationsInner { + return v.value +} + +func (v *NullableConditionTransformationsInner) Set(val *ConditionTransformationsInner) { + v.value = val + v.isSet = true +} + +func (v NullableConditionTransformationsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableConditionTransformationsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConditionTransformationsInner(val *ConditionTransformationsInner) *NullableConditionTransformationsInner { + return &NullableConditionTransformationsInner{value: val, isSet: true} +} + +func (v NullableConditionTransformationsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConditionTransformationsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition_variable.go b/services/albwaf/v1betaapi/model_condition_variable.go new file mode 100644 index 000000000..10aa179c1 --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition_variable.go @@ -0,0 +1,191 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ConditionVariable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConditionVariable{} + +// ConditionVariable struct for ConditionVariable +type ConditionVariable struct { + Type *ConditionVariableType `json:"type,omitempty"` + // Optional key element context for map variables (e.g., matching a 'Host' header key). + Value *string `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConditionVariable ConditionVariable + +// NewConditionVariable instantiates a new ConditionVariable 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 NewConditionVariable() *ConditionVariable { + this := ConditionVariable{} + return &this +} + +// NewConditionVariableWithDefaults instantiates a new ConditionVariable 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 NewConditionVariableWithDefaults() *ConditionVariable { + this := ConditionVariable{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConditionVariable) GetType() ConditionVariableType { + if o == nil || IsNil(o.Type) { + var ret ConditionVariableType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConditionVariable) GetTypeOk() (*ConditionVariableType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConditionVariable) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConditionVariableType and assigns it to the Type field. +func (o *ConditionVariable) SetType(v ConditionVariableType) { + o.Type = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ConditionVariable) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConditionVariable) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ConditionVariable) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *ConditionVariable) SetValue(v string) { + o.Value = &v +} + +func (o ConditionVariable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConditionVariable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConditionVariable) UnmarshalJSON(data []byte) (err error) { + varConditionVariable := _ConditionVariable{} + + err = json.Unmarshal(data, &varConditionVariable) + + if err != nil { + return err + } + + *o = ConditionVariable(varConditionVariable) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConditionVariable struct { + value *ConditionVariable + isSet bool +} + +func (v NullableConditionVariable) Get() *ConditionVariable { + return v.value +} + +func (v *NullableConditionVariable) Set(val *ConditionVariable) { + v.value = val + v.isSet = true +} + +func (v NullableConditionVariable) IsSet() bool { + return v.isSet +} + +func (v *NullableConditionVariable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConditionVariable(val *ConditionVariable) *NullableConditionVariable { + return &NullableConditionVariable{value: val, isSet: true} +} + +func (v NullableConditionVariable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConditionVariable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_condition_variable_type.go b/services/albwaf/v1betaapi/model_condition_variable_type.go new file mode 100644 index 000000000..77e1169c3 --- /dev/null +++ b/services/albwaf/v1betaapi/model_condition_variable_type.go @@ -0,0 +1,155 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ConditionVariableType The targeted validation engine variable macro. +type ConditionVariableType string + +// List of ConditionVariable_type +const ( + CONDITIONVARIABLETYPE_VARIABLE_UNSPECIFIED ConditionVariableType = "VARIABLE_UNSPECIFIED" + CONDITIONVARIABLETYPE_VARIABLE_ARGS_GET ConditionVariableType = "VARIABLE_ARGS_GET" + CONDITIONVARIABLETYPE_VARIABLE_ARGS_POST ConditionVariableType = "VARIABLE_ARGS_POST" + CONDITIONVARIABLETYPE_VARIABLE_FULL_REQUEST_LENGTH ConditionVariableType = "VARIABLE_FULL_REQUEST_LENGTH" + CONDITIONVARIABLETYPE_VARIABLE_MATCHED_VAR ConditionVariableType = "VARIABLE_MATCHED_VAR" + CONDITIONVARIABLETYPE_VARIABLE_QUERY_STRING ConditionVariableType = "VARIABLE_QUERY_STRING" + CONDITIONVARIABLETYPE_VARIABLE_REMOTE_ADDR ConditionVariableType = "VARIABLE_REMOTE_ADDR" + CONDITIONVARIABLETYPE_VARIABLE_REMOTE_PORT ConditionVariableType = "VARIABLE_REMOTE_PORT" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_BASENAME ConditionVariableType = "VARIABLE_REQUEST_BASENAME" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_BODY ConditionVariableType = "VARIABLE_REQUEST_BODY" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_BODY_LENGTH ConditionVariableType = "VARIABLE_REQUEST_BODY_LENGTH" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_COOKIES ConditionVariableType = "VARIABLE_REQUEST_COOKIES" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_HEADERS ConditionVariableType = "VARIABLE_REQUEST_HEADERS" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_HEADERS_NAMES ConditionVariableType = "VARIABLE_REQUEST_HEADERS_NAMES" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_METHOD ConditionVariableType = "VARIABLE_REQUEST_METHOD" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_PROTOCOL ConditionVariableType = "VARIABLE_REQUEST_PROTOCOL" + CONDITIONVARIABLETYPE_VARIABLE_REQUEST_URI_RAW ConditionVariableType = "VARIABLE_REQUEST_URI_RAW" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_BODY ConditionVariableType = "VARIABLE_RESPONSE_BODY" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_CONTENT_LENGTH ConditionVariableType = "VARIABLE_RESPONSE_CONTENT_LENGTH" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_HEADERS ConditionVariableType = "VARIABLE_RESPONSE_HEADERS" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_HEADERS_NAMES ConditionVariableType = "VARIABLE_RESPONSE_HEADERS_NAMES" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_PROTOCOL ConditionVariableType = "VARIABLE_RESPONSE_PROTOCOL" + CONDITIONVARIABLETYPE_VARIABLE_RESPONSE_STATUS ConditionVariableType = "VARIABLE_RESPONSE_STATUS" + CONDITIONVARIABLETYPE_UNKNOWN_DEFAULT_OPEN_API ConditionVariableType = "unknown_default_open_api" +) + +// All allowed values of ConditionVariableType enum +var AllowedConditionVariableTypeEnumValues = []ConditionVariableType{ + "VARIABLE_UNSPECIFIED", + "VARIABLE_ARGS_GET", + "VARIABLE_ARGS_POST", + "VARIABLE_FULL_REQUEST_LENGTH", + "VARIABLE_MATCHED_VAR", + "VARIABLE_QUERY_STRING", + "VARIABLE_REMOTE_ADDR", + "VARIABLE_REMOTE_PORT", + "VARIABLE_REQUEST_BASENAME", + "VARIABLE_REQUEST_BODY", + "VARIABLE_REQUEST_BODY_LENGTH", + "VARIABLE_REQUEST_COOKIES", + "VARIABLE_REQUEST_HEADERS", + "VARIABLE_REQUEST_HEADERS_NAMES", + "VARIABLE_REQUEST_METHOD", + "VARIABLE_REQUEST_PROTOCOL", + "VARIABLE_REQUEST_URI_RAW", + "VARIABLE_RESPONSE_BODY", + "VARIABLE_RESPONSE_CONTENT_LENGTH", + "VARIABLE_RESPONSE_HEADERS", + "VARIABLE_RESPONSE_HEADERS_NAMES", + "VARIABLE_RESPONSE_PROTOCOL", + "VARIABLE_RESPONSE_STATUS", + "unknown_default_open_api", +} + +func (v *ConditionVariableType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConditionVariableType(value) + for _, existing := range AllowedConditionVariableTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CONDITIONVARIABLETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewConditionVariableTypeFromValue returns a pointer to a valid ConditionVariableType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConditionVariableTypeFromValue(v string) (*ConditionVariableType, error) { + ev := ConditionVariableType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConditionVariableType: valid values are %v", v, AllowedConditionVariableTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConditionVariableType) IsValid() bool { + for _, existing := range AllowedConditionVariableTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConditionVariable_type value +func (v ConditionVariableType) Ptr() *ConditionVariableType { + return &v +} + +type NullableConditionVariableType struct { + value *ConditionVariableType + isSet bool +} + +func (v NullableConditionVariableType) Get() *ConditionVariableType { + return v.value +} + +func (v *NullableConditionVariableType) Set(val *ConditionVariableType) { + v.value = val + v.isSet = true +} + +func (v NullableConditionVariableType) IsSet() bool { + return v.isSet +} + +func (v *NullableConditionVariableType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConditionVariableType(val *ConditionVariableType) *NullableConditionVariableType { + return &NullableConditionVariableType{value: val, isSet: true} +} + +func (v NullableConditionVariableType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConditionVariableType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_create_custom_rule.go b/services/albwaf/v1betaapi/model_create_custom_rule.go new file mode 100644 index 000000000..fabe2168b --- /dev/null +++ b/services/albwaf/v1betaapi/model_create_custom_rule.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CreateCustomRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCustomRule{} + +// CreateCustomRule struct for CreateCustomRule +type CreateCustomRule struct { + Behaviour *Behaviour `json:"behaviour,omitempty"` + // [HINT] Order matters! First condition match triggers execution. + Conditions []Condition `json:"conditions,omitempty"` + // A clear description explaining the threat vector or criteria addressed by this rule. + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCustomRule CreateCustomRule + +// NewCreateCustomRule instantiates a new CreateCustomRule 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 NewCreateCustomRule() *CreateCustomRule { + this := CreateCustomRule{} + return &this +} + +// NewCreateCustomRuleWithDefaults instantiates a new CreateCustomRule 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 NewCreateCustomRuleWithDefaults() *CreateCustomRule { + this := CreateCustomRule{} + return &this +} + +// GetBehaviour returns the Behaviour field value if set, zero value otherwise. +func (o *CreateCustomRule) GetBehaviour() Behaviour { + if o == nil || IsNil(o.Behaviour) { + var ret Behaviour + return ret + } + return *o.Behaviour +} + +// GetBehaviourOk returns a tuple with the Behaviour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCustomRule) GetBehaviourOk() (*Behaviour, bool) { + if o == nil || IsNil(o.Behaviour) { + return nil, false + } + return o.Behaviour, true +} + +// HasBehaviour returns a boolean if a field has been set. +func (o *CreateCustomRule) HasBehaviour() bool { + if o != nil && !IsNil(o.Behaviour) { + return true + } + + return false +} + +// SetBehaviour gets a reference to the given Behaviour and assigns it to the Behaviour field. +func (o *CreateCustomRule) SetBehaviour(v Behaviour) { + o.Behaviour = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise. +func (o *CreateCustomRule) GetConditions() []Condition { + if o == nil || IsNil(o.Conditions) { + var ret []Condition + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCustomRule) GetConditionsOk() ([]Condition, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *CreateCustomRule) HasConditions() bool { + if o != nil && !IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given []Condition and assigns it to the Conditions field. +func (o *CreateCustomRule) SetConditions(v []Condition) { + o.Conditions = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateCustomRule) 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 *CreateCustomRule) 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 *CreateCustomRule) 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 *CreateCustomRule) SetDescription(v string) { + o.Description = &v +} + +func (o CreateCustomRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCustomRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Behaviour) { + toSerialize["behaviour"] = o.Behaviour + } + if !IsNil(o.Conditions) { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCustomRule) UnmarshalJSON(data []byte) (err error) { + varCreateCustomRule := _CreateCustomRule{} + + err = json.Unmarshal(data, &varCreateCustomRule) + + if err != nil { + return err + } + + *o = CreateCustomRule(varCreateCustomRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "behaviour") + delete(additionalProperties, "conditions") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCustomRule struct { + value *CreateCustomRule + isSet bool +} + +func (v NullableCreateCustomRule) Get() *CreateCustomRule { + return v.value +} + +func (v *NullableCreateCustomRule) Set(val *CreateCustomRule) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCustomRule) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCustomRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCustomRule(val *CreateCustomRule) *NullableCreateCustomRule { + return &NullableCreateCustomRule{value: val, isSet: true} +} + +func (v NullableCreateCustomRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCustomRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go b/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go new file mode 100644 index 000000000..f808d341f --- /dev/null +++ b/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go @@ -0,0 +1,268 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CreateCustomRuleGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCustomRuleGroupPayload{} + +// CreateCustomRuleGroupPayload Request payload for creating a CRG. +type CreateCustomRuleGroupPayload struct { + // Custom rule group name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + // The collection of custom rule group SecLang parameters forming this execution group. + Rules []CreateCustomRule `json:"rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCustomRuleGroupPayload CreateCustomRuleGroupPayload + +// NewCreateCustomRuleGroupPayload instantiates a new CreateCustomRuleGroupPayload 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 NewCreateCustomRuleGroupPayload() *CreateCustomRuleGroupPayload { + this := CreateCustomRuleGroupPayload{} + return &this +} + +// NewCreateCustomRuleGroupPayloadWithDefaults instantiates a new CreateCustomRuleGroupPayload 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 NewCreateCustomRuleGroupPayloadWithDefaults() *CreateCustomRuleGroupPayload { + this := CreateCustomRuleGroupPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *CreateCustomRuleGroupPayload) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCustomRuleGroupPayload) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *CreateCustomRuleGroupPayload) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *CreateCustomRuleGroupPayload) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) 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 *CreateCustomRuleGroupPayload) SetRegion(v string) { + o.Region = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateCustomRuleGroupPayload) GetRules() []CreateCustomRule { + if o == nil || IsNil(o.Rules) { + var ret []CreateCustomRule + 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 *CreateCustomRuleGroupPayload) GetRulesOk() ([]CreateCustomRule, 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 *CreateCustomRuleGroupPayload) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []CreateCustomRule and assigns it to the Rules field. +func (o *CreateCustomRuleGroupPayload) SetRules(v []CreateCustomRule) { + o.Rules = v +} + +func (o CreateCustomRuleGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCustomRuleGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCustomRuleGroupPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCustomRuleGroupPayload := _CreateCustomRuleGroupPayload{} + + err = json.Unmarshal(data, &varCreateCustomRuleGroupPayload) + + if err != nil { + return err + } + + *o = CreateCustomRuleGroupPayload(varCreateCustomRuleGroupPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "projectId") + delete(additionalProperties, "region") + delete(additionalProperties, "rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCustomRuleGroupPayload struct { + value *CreateCustomRuleGroupPayload + isSet bool +} + +func (v NullableCreateCustomRuleGroupPayload) Get() *CreateCustomRuleGroupPayload { + return v.value +} + +func (v *NullableCreateCustomRuleGroupPayload) Set(val *CreateCustomRuleGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCustomRuleGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCustomRuleGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCustomRuleGroupPayload(val *CreateCustomRuleGroupPayload) *NullableCreateCustomRuleGroupPayload { + return &NullableCreateCustomRuleGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateCustomRuleGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCustomRuleGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go b/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go new file mode 100644 index 000000000..825addfd0 --- /dev/null +++ b/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go @@ -0,0 +1,267 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CreateManagedRuleSetPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateManagedRuleSetPayload{} + +// CreateManagedRuleSetPayload CreateManagedRuleSetRequest creates a rule configuration. +type CreateManagedRuleSetPayload struct { + // Managed rule set configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + Type *MRSType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateManagedRuleSetPayload CreateManagedRuleSetPayload + +// NewCreateManagedRuleSetPayload instantiates a new CreateManagedRuleSetPayload 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 NewCreateManagedRuleSetPayload() *CreateManagedRuleSetPayload { + this := CreateManagedRuleSetPayload{} + return &this +} + +// NewCreateManagedRuleSetPayloadWithDefaults instantiates a new CreateManagedRuleSetPayload 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 NewCreateManagedRuleSetPayloadWithDefaults() *CreateManagedRuleSetPayload { + this := CreateManagedRuleSetPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *CreateManagedRuleSetPayload) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateManagedRuleSetPayload) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *CreateManagedRuleSetPayload) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *CreateManagedRuleSetPayload) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) 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 *CreateManagedRuleSetPayload) SetRegion(v string) { + o.Region = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateManagedRuleSetPayload) GetType() MRSType { + if o == nil || IsNil(o.Type) { + var ret MRSType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateManagedRuleSetPayload) GetTypeOk() (*MRSType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreateManagedRuleSetPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given MRSType and assigns it to the Type field. +func (o *CreateManagedRuleSetPayload) SetType(v MRSType) { + o.Type = &v +} + +func (o CreateManagedRuleSetPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateManagedRuleSetPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateManagedRuleSetPayload) UnmarshalJSON(data []byte) (err error) { + varCreateManagedRuleSetPayload := _CreateManagedRuleSetPayload{} + + err = json.Unmarshal(data, &varCreateManagedRuleSetPayload) + + if err != nil { + return err + } + + *o = CreateManagedRuleSetPayload(varCreateManagedRuleSetPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "projectId") + delete(additionalProperties, "region") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateManagedRuleSetPayload struct { + value *CreateManagedRuleSetPayload + isSet bool +} + +func (v NullableCreateManagedRuleSetPayload) Get() *CreateManagedRuleSetPayload { + return v.value +} + +func (v *NullableCreateManagedRuleSetPayload) Set(val *CreateManagedRuleSetPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateManagedRuleSetPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateManagedRuleSetPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateManagedRuleSetPayload(val *CreateManagedRuleSetPayload) *NullableCreateManagedRuleSetPayload { + return &NullableCreateManagedRuleSetPayload{value: val, isSet: true} +} + +func (v NullableCreateManagedRuleSetPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateManagedRuleSetPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_create_waf_payload.go b/services/albwaf/v1betaapi/model_create_waf_payload.go new file mode 100644 index 000000000..baa033bdc --- /dev/null +++ b/services/albwaf/v1betaapi/model_create_waf_payload.go @@ -0,0 +1,344 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CreateWAFPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateWAFPayload{} + +// CreateWAFPayload CreateWAFRequest creates a WAF with rules. +type CreateWAFPayload struct { + // Name of the CRG configuration for that WAF. + CustomRuleGroupName *string `json:"customRuleGroupName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Labels represent user-defined metadata as key-value pairs. Label count should not exceed 64 per WAF. **Key Formatting Rules:** Length: 1-63 characters. Characters: Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. Keys starting with 'stackit-' are system-reserved; users MUST NOT manage them. **Value Formatting Rules:** Length: 0-63 characters (empty string explicitly allowed). Characters (for non-empty values): Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. + Labels *map[string]string `json:"labels,omitempty"` + // Name of the managed rule set configuration for that WAF. + ManagedRuleSetName *string `json:"managedRuleSetName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // WAF name + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + AdditionalProperties map[string]interface{} +} + +type _CreateWAFPayload CreateWAFPayload + +// NewCreateWAFPayload instantiates a new CreateWAFPayload 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 NewCreateWAFPayload() *CreateWAFPayload { + this := CreateWAFPayload{} + return &this +} + +// NewCreateWAFPayloadWithDefaults instantiates a new CreateWAFPayload 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 NewCreateWAFPayloadWithDefaults() *CreateWAFPayload { + this := CreateWAFPayload{} + return &this +} + +// GetCustomRuleGroupName returns the CustomRuleGroupName field value if set, zero value otherwise. +func (o *CreateWAFPayload) GetCustomRuleGroupName() string { + if o == nil || IsNil(o.CustomRuleGroupName) { + var ret string + return ret + } + return *o.CustomRuleGroupName +} + +// GetCustomRuleGroupNameOk returns a tuple with the CustomRuleGroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateWAFPayload) GetCustomRuleGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.CustomRuleGroupName) { + return nil, false + } + return o.CustomRuleGroupName, true +} + +// HasCustomRuleGroupName returns a boolean if a field has been set. +func (o *CreateWAFPayload) HasCustomRuleGroupName() bool { + if o != nil && !IsNil(o.CustomRuleGroupName) { + return true + } + + return false +} + +// SetCustomRuleGroupName gets a reference to the given string and assigns it to the CustomRuleGroupName field. +func (o *CreateWAFPayload) SetCustomRuleGroupName(v string) { + o.CustomRuleGroupName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateWAFPayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// 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 *CreateWAFPayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateWAFPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateWAFPayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetManagedRuleSetName returns the ManagedRuleSetName field value if set, zero value otherwise. +func (o *CreateWAFPayload) GetManagedRuleSetName() string { + if o == nil || IsNil(o.ManagedRuleSetName) { + var ret string + return ret + } + return *o.ManagedRuleSetName +} + +// GetManagedRuleSetNameOk returns a tuple with the ManagedRuleSetName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateWAFPayload) GetManagedRuleSetNameOk() (*string, bool) { + if o == nil || IsNil(o.ManagedRuleSetName) { + return nil, false + } + return o.ManagedRuleSetName, true +} + +// HasManagedRuleSetName returns a boolean if a field has been set. +func (o *CreateWAFPayload) HasManagedRuleSetName() bool { + if o != nil && !IsNil(o.ManagedRuleSetName) { + return true + } + + return false +} + +// SetManagedRuleSetName gets a reference to the given string and assigns it to the ManagedRuleSetName field. +func (o *CreateWAFPayload) SetManagedRuleSetName(v string) { + o.ManagedRuleSetName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateWAFPayload) 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 *CreateWAFPayload) 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 *CreateWAFPayload) 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 *CreateWAFPayload) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *CreateWAFPayload) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateWAFPayload) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *CreateWAFPayload) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *CreateWAFPayload) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CreateWAFPayload) 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 *CreateWAFPayload) 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 *CreateWAFPayload) 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 *CreateWAFPayload) SetRegion(v string) { + o.Region = &v +} + +func (o CreateWAFPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateWAFPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomRuleGroupName) { + toSerialize["customRuleGroupName"] = o.CustomRuleGroupName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.ManagedRuleSetName) { + toSerialize["managedRuleSetName"] = o.ManagedRuleSetName + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateWAFPayload) UnmarshalJSON(data []byte) (err error) { + varCreateWAFPayload := _CreateWAFPayload{} + + err = json.Unmarshal(data, &varCreateWAFPayload) + + if err != nil { + return err + } + + *o = CreateWAFPayload(varCreateWAFPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "customRuleGroupName") + delete(additionalProperties, "labels") + delete(additionalProperties, "managedRuleSetName") + delete(additionalProperties, "name") + delete(additionalProperties, "projectId") + delete(additionalProperties, "region") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateWAFPayload struct { + value *CreateWAFPayload + isSet bool +} + +func (v NullableCreateWAFPayload) Get() *CreateWAFPayload { + return v.value +} + +func (v *NullableCreateWAFPayload) Set(val *CreateWAFPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateWAFPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateWAFPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateWAFPayload(val *CreateWAFPayload) *NullableCreateWAFPayload { + return &NullableCreateWAFPayload{value: val, isSet: true} +} + +func (v NullableCreateWAFPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateWAFPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_crg_config_quota.go b/services/albwaf/v1betaapi/model_crg_config_quota.go new file mode 100644 index 000000000..0b1056c92 --- /dev/null +++ b/services/albwaf/v1betaapi/model_crg_config_quota.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CRGConfigQuota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CRGConfigQuota{} + +// CRGConfigQuota CRG quotas holds the limit and usage for CRG resources +type CRGConfigQuota struct { + // The maximum number of custom rule groups in this project. + Limit *int32 `json:"limit,omitempty"` + // The number of custom rule groups that are currently existing in this project. + Usage *int32 `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CRGConfigQuota CRGConfigQuota + +// NewCRGConfigQuota instantiates a new CRGConfigQuota 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 NewCRGConfigQuota() *CRGConfigQuota { + this := CRGConfigQuota{} + return &this +} + +// NewCRGConfigQuotaWithDefaults instantiates a new CRGConfigQuota 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 NewCRGConfigQuotaWithDefaults() *CRGConfigQuota { + this := CRGConfigQuota{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *CRGConfigQuota) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CRGConfigQuota) GetLimitOk() (*int32, bool) { + if o == nil || IsNil(o.Limit) { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *CRGConfigQuota) HasLimit() bool { + if o != nil && !IsNil(o.Limit) { + return true + } + + return false +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *CRGConfigQuota) SetLimit(v int32) { + o.Limit = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *CRGConfigQuota) GetUsage() int32 { + if o == nil || IsNil(o.Usage) { + var ret int32 + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CRGConfigQuota) GetUsageOk() (*int32, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *CRGConfigQuota) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given int32 and assigns it to the Usage field. +func (o *CRGConfigQuota) SetUsage(v int32) { + o.Usage = &v +} + +func (o CRGConfigQuota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CRGConfigQuota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Limit) { + toSerialize["limit"] = o.Limit + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CRGConfigQuota) UnmarshalJSON(data []byte) (err error) { + varCRGConfigQuota := _CRGConfigQuota{} + + err = json.Unmarshal(data, &varCRGConfigQuota) + + if err != nil { + return err + } + + *o = CRGConfigQuota(varCRGConfigQuota) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "limit") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCRGConfigQuota struct { + value *CRGConfigQuota + isSet bool +} + +func (v NullableCRGConfigQuota) Get() *CRGConfigQuota { + return v.value +} + +func (v *NullableCRGConfigQuota) Set(val *CRGConfigQuota) { + v.value = val + v.isSet = true +} + +func (v NullableCRGConfigQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableCRGConfigQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCRGConfigQuota(val *CRGConfigQuota) *NullableCRGConfigQuota { + return &NullableCRGConfigQuota{value: val, isSet: true} +} + +func (v NullableCRGConfigQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCRGConfigQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_crg_usage.go b/services/albwaf/v1betaapi/model_crg_usage.go new file mode 100644 index 000000000..ead94740b --- /dev/null +++ b/services/albwaf/v1betaapi/model_crg_usage.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the CRGUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CRGUsage{} + +// CRGUsage Tracking metrics for CRG resource utilization +type CRGUsage struct { + // Number of WAF configurations actively using this rule group. + Count *int32 `json:"count,omitempty"` + // List of individual WAF configuration names that bind this rule group. + Items []string `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CRGUsage CRGUsage + +// NewCRGUsage instantiates a new CRGUsage 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 NewCRGUsage() *CRGUsage { + this := CRGUsage{} + return &this +} + +// NewCRGUsageWithDefaults instantiates a new CRGUsage 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 NewCRGUsageWithDefaults() *CRGUsage { + this := CRGUsage{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *CRGUsage) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CRGUsage) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *CRGUsage) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *CRGUsage) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *CRGUsage) GetItems() []string { + if o == nil || IsNil(o.Items) { + var ret []string + return ret + } + return o.Items +} + +// 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 *CRGUsage) GetItemsOk() ([]string, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *CRGUsage) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []string and assigns it to the Items field. +func (o *CRGUsage) SetItems(v []string) { + o.Items = v +} + +func (o CRGUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CRGUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CRGUsage) UnmarshalJSON(data []byte) (err error) { + varCRGUsage := _CRGUsage{} + + err = json.Unmarshal(data, &varCRGUsage) + + if err != nil { + return err + } + + *o = CRGUsage(varCRGUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCRGUsage struct { + value *CRGUsage + isSet bool +} + +func (v NullableCRGUsage) Get() *CRGUsage { + return v.value +} + +func (v *NullableCRGUsage) Set(val *CRGUsage) { + v.value = val + v.isSet = true +} + +func (v NullableCRGUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableCRGUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCRGUsage(val *CRGUsage) *NullableCRGUsage { + return &NullableCRGUsage{value: val, isSet: true} +} + +func (v NullableCRGUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCRGUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_behaviour.go b/services/albwaf/v1betaapi/model_get_behaviour.go new file mode 100644 index 000000000..8543a7933 --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_behaviour.go @@ -0,0 +1,266 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetBehaviour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBehaviour{} + +// GetBehaviour struct for GetBehaviour +type GetBehaviour struct { + Action *GetBehaviourAction `json:"action,omitempty"` + // Determines whether an entry should be generated in the security ledger upon a rule hit. + Log *bool `json:"log,omitempty"` + // Custom notification message string mapped to underlying logdata contexts. Required if log is true. + LogMsg *string `json:"logMsg,omitempty"` + Severity *GetBehaviourSeverity `json:"severity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBehaviour GetBehaviour + +// NewGetBehaviour instantiates a new GetBehaviour 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 NewGetBehaviour() *GetBehaviour { + this := GetBehaviour{} + return &this +} + +// NewGetBehaviourWithDefaults instantiates a new GetBehaviour 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 NewGetBehaviourWithDefaults() *GetBehaviour { + this := GetBehaviour{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *GetBehaviour) GetAction() GetBehaviourAction { + if o == nil || IsNil(o.Action) { + var ret GetBehaviourAction + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBehaviour) GetActionOk() (*GetBehaviourAction, bool) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *GetBehaviour) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given GetBehaviourAction and assigns it to the Action field. +func (o *GetBehaviour) SetAction(v GetBehaviourAction) { + o.Action = &v +} + +// GetLog returns the Log field value if set, zero value otherwise. +func (o *GetBehaviour) GetLog() bool { + if o == nil || IsNil(o.Log) { + var ret bool + return ret + } + return *o.Log +} + +// GetLogOk returns a tuple with the Log field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBehaviour) GetLogOk() (*bool, bool) { + if o == nil || IsNil(o.Log) { + return nil, false + } + return o.Log, true +} + +// HasLog returns a boolean if a field has been set. +func (o *GetBehaviour) HasLog() bool { + if o != nil && !IsNil(o.Log) { + return true + } + + return false +} + +// SetLog gets a reference to the given bool and assigns it to the Log field. +func (o *GetBehaviour) SetLog(v bool) { + o.Log = &v +} + +// GetLogMsg returns the LogMsg field value if set, zero value otherwise. +func (o *GetBehaviour) GetLogMsg() string { + if o == nil || IsNil(o.LogMsg) { + var ret string + return ret + } + return *o.LogMsg +} + +// GetLogMsgOk returns a tuple with the LogMsg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBehaviour) GetLogMsgOk() (*string, bool) { + if o == nil || IsNil(o.LogMsg) { + return nil, false + } + return o.LogMsg, true +} + +// HasLogMsg returns a boolean if a field has been set. +func (o *GetBehaviour) HasLogMsg() bool { + if o != nil && !IsNil(o.LogMsg) { + return true + } + + return false +} + +// SetLogMsg gets a reference to the given string and assigns it to the LogMsg field. +func (o *GetBehaviour) SetLogMsg(v string) { + o.LogMsg = &v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *GetBehaviour) GetSeverity() GetBehaviourSeverity { + if o == nil || IsNil(o.Severity) { + var ret GetBehaviourSeverity + 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 *GetBehaviour) GetSeverityOk() (*GetBehaviourSeverity, 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 *GetBehaviour) HasSeverity() bool { + if o != nil && !IsNil(o.Severity) { + return true + } + + return false +} + +// SetSeverity gets a reference to the given GetBehaviourSeverity and assigns it to the Severity field. +func (o *GetBehaviour) SetSeverity(v GetBehaviourSeverity) { + o.Severity = &v +} + +func (o GetBehaviour) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBehaviour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.Log) { + toSerialize["log"] = o.Log + } + if !IsNil(o.LogMsg) { + toSerialize["logMsg"] = o.LogMsg + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetBehaviour) UnmarshalJSON(data []byte) (err error) { + varGetBehaviour := _GetBehaviour{} + + err = json.Unmarshal(data, &varGetBehaviour) + + if err != nil { + return err + } + + *o = GetBehaviour(varGetBehaviour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "action") + delete(additionalProperties, "log") + delete(additionalProperties, "logMsg") + delete(additionalProperties, "severity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBehaviour struct { + value *GetBehaviour + isSet bool +} + +func (v NullableGetBehaviour) Get() *GetBehaviour { + return v.value +} + +func (v *NullableGetBehaviour) Set(val *GetBehaviour) { + v.value = val + v.isSet = true +} + +func (v NullableGetBehaviour) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBehaviour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBehaviour(val *GetBehaviour) *NullableGetBehaviour { + return &NullableGetBehaviour{value: val, isSet: true} +} + +func (v NullableGetBehaviour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBehaviour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_behaviour_action.go b/services/albwaf/v1betaapi/model_get_behaviour_action.go new file mode 100644 index 000000000..8a30abc8f --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_behaviour_action.go @@ -0,0 +1,117 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetBehaviourAction The protective stance action. ACTION_DENY forces a 403 status response code. +type GetBehaviourAction string + +// List of GetBehaviour_action +const ( + GETBEHAVIOURACTION_ACTION_UNSPECIFIED GetBehaviourAction = "ACTION_UNSPECIFIED" + GETBEHAVIOURACTION_ACTION_DENY GetBehaviourAction = "ACTION_DENY" + GETBEHAVIOURACTION_ACTION_PASS GetBehaviourAction = "ACTION_PASS" + GETBEHAVIOURACTION_ACTION_ALLOW GetBehaviourAction = "ACTION_ALLOW" + GETBEHAVIOURACTION_UNKNOWN_DEFAULT_OPEN_API GetBehaviourAction = "unknown_default_open_api" +) + +// All allowed values of GetBehaviourAction enum +var AllowedGetBehaviourActionEnumValues = []GetBehaviourAction{ + "ACTION_UNSPECIFIED", + "ACTION_DENY", + "ACTION_PASS", + "ACTION_ALLOW", + "unknown_default_open_api", +} + +func (v *GetBehaviourAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBehaviourAction(value) + for _, existing := range AllowedGetBehaviourActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETBEHAVIOURACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetBehaviourActionFromValue returns a pointer to a valid GetBehaviourAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBehaviourActionFromValue(v string) (*GetBehaviourAction, error) { + ev := GetBehaviourAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBehaviourAction: valid values are %v", v, AllowedGetBehaviourActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBehaviourAction) IsValid() bool { + for _, existing := range AllowedGetBehaviourActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBehaviour_action value +func (v GetBehaviourAction) Ptr() *GetBehaviourAction { + return &v +} + +type NullableGetBehaviourAction struct { + value *GetBehaviourAction + isSet bool +} + +func (v NullableGetBehaviourAction) Get() *GetBehaviourAction { + return v.value +} + +func (v *NullableGetBehaviourAction) Set(val *GetBehaviourAction) { + v.value = val + v.isSet = true +} + +func (v NullableGetBehaviourAction) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBehaviourAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBehaviourAction(val *GetBehaviourAction) *NullableGetBehaviourAction { + return &NullableGetBehaviourAction{value: val, isSet: true} +} + +func (v NullableGetBehaviourAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBehaviourAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_behaviour_severity.go b/services/albwaf/v1betaapi/model_get_behaviour_severity.go new file mode 100644 index 000000000..2aa8a7219 --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_behaviour_severity.go @@ -0,0 +1,127 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetBehaviourSeverity Severity classification metric used by internal analytics graphs. +type GetBehaviourSeverity string + +// List of GetBehaviour_severity +const ( + GETBEHAVIOURSEVERITY_SEVERITY_UNSPECIFIED GetBehaviourSeverity = "SEVERITY_UNSPECIFIED" + GETBEHAVIOURSEVERITY_SEVERITY_EMERGENCY GetBehaviourSeverity = "SEVERITY_EMERGENCY" + GETBEHAVIOURSEVERITY_SEVERITY_ALERT GetBehaviourSeverity = "SEVERITY_ALERT" + GETBEHAVIOURSEVERITY_SEVERITY_CRITICAL GetBehaviourSeverity = "SEVERITY_CRITICAL" + GETBEHAVIOURSEVERITY_SEVERITY_ERROR GetBehaviourSeverity = "SEVERITY_ERROR" + GETBEHAVIOURSEVERITY_SEVERITY_WARNING GetBehaviourSeverity = "SEVERITY_WARNING" + GETBEHAVIOURSEVERITY_SEVERITY_NOTICE GetBehaviourSeverity = "SEVERITY_NOTICE" + GETBEHAVIOURSEVERITY_SEVERITY_INFO GetBehaviourSeverity = "SEVERITY_INFO" + GETBEHAVIOURSEVERITY_SEVERITY_DEBUG GetBehaviourSeverity = "SEVERITY_DEBUG" + GETBEHAVIOURSEVERITY_UNKNOWN_DEFAULT_OPEN_API GetBehaviourSeverity = "unknown_default_open_api" +) + +// All allowed values of GetBehaviourSeverity enum +var AllowedGetBehaviourSeverityEnumValues = []GetBehaviourSeverity{ + "SEVERITY_UNSPECIFIED", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG", + "unknown_default_open_api", +} + +func (v *GetBehaviourSeverity) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBehaviourSeverity(value) + for _, existing := range AllowedGetBehaviourSeverityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETBEHAVIOURSEVERITY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetBehaviourSeverityFromValue returns a pointer to a valid GetBehaviourSeverity +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBehaviourSeverityFromValue(v string) (*GetBehaviourSeverity, error) { + ev := GetBehaviourSeverity(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBehaviourSeverity: valid values are %v", v, AllowedGetBehaviourSeverityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBehaviourSeverity) IsValid() bool { + for _, existing := range AllowedGetBehaviourSeverityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBehaviour_severity value +func (v GetBehaviourSeverity) Ptr() *GetBehaviourSeverity { + return &v +} + +type NullableGetBehaviourSeverity struct { + value *GetBehaviourSeverity + isSet bool +} + +func (v NullableGetBehaviourSeverity) Get() *GetBehaviourSeverity { + return v.value +} + +func (v *NullableGetBehaviourSeverity) Set(val *GetBehaviourSeverity) { + v.value = val + v.isSet = true +} + +func (v NullableGetBehaviourSeverity) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBehaviourSeverity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBehaviourSeverity(val *GetBehaviourSeverity) *NullableGetBehaviourSeverity { + return &NullableGetBehaviourSeverity{value: val, isSet: true} +} + +func (v NullableGetBehaviourSeverity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBehaviourSeverity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_custom_rule.go b/services/albwaf/v1betaapi/model_get_custom_rule.go new file mode 100644 index 000000000..1f02ab133 --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_custom_rule.go @@ -0,0 +1,267 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetCustomRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomRule{} + +// GetCustomRule struct for GetCustomRule +type GetCustomRule struct { + Behaviour *GetBehaviour `json:"behaviour,omitempty"` + // [HINT] Order matters! First condition match triggers execution. + Conditions []Condition `json:"conditions,omitempty"` + // A clear description explaining the threat vector or criteria addressed by this rule. + Description *string `json:"description,omitempty"` + // Backend auto-allocated unique rule ID within the valid 1-99999 threshold. + Id *int32 `json:"id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetCustomRule GetCustomRule + +// NewGetCustomRule instantiates a new GetCustomRule 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 NewGetCustomRule() *GetCustomRule { + this := GetCustomRule{} + return &this +} + +// NewGetCustomRuleWithDefaults instantiates a new GetCustomRule 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 NewGetCustomRuleWithDefaults() *GetCustomRule { + this := GetCustomRule{} + return &this +} + +// GetBehaviour returns the Behaviour field value if set, zero value otherwise. +func (o *GetCustomRule) GetBehaviour() GetBehaviour { + if o == nil || IsNil(o.Behaviour) { + var ret GetBehaviour + return ret + } + return *o.Behaviour +} + +// GetBehaviourOk returns a tuple with the Behaviour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCustomRule) GetBehaviourOk() (*GetBehaviour, bool) { + if o == nil || IsNil(o.Behaviour) { + return nil, false + } + return o.Behaviour, true +} + +// HasBehaviour returns a boolean if a field has been set. +func (o *GetCustomRule) HasBehaviour() bool { + if o != nil && !IsNil(o.Behaviour) { + return true + } + + return false +} + +// SetBehaviour gets a reference to the given GetBehaviour and assigns it to the Behaviour field. +func (o *GetCustomRule) SetBehaviour(v GetBehaviour) { + o.Behaviour = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise. +func (o *GetCustomRule) GetConditions() []Condition { + if o == nil || IsNil(o.Conditions) { + var ret []Condition + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCustomRule) GetConditionsOk() ([]Condition, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *GetCustomRule) HasConditions() bool { + if o != nil && !IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given []Condition and assigns it to the Conditions field. +func (o *GetCustomRule) SetConditions(v []Condition) { + o.Conditions = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GetCustomRule) 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 *GetCustomRule) 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 *GetCustomRule) 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 *GetCustomRule) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GetCustomRule) 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 *GetCustomRule) 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 *GetCustomRule) 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 *GetCustomRule) SetId(v int32) { + o.Id = &v +} + +func (o GetCustomRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Behaviour) { + toSerialize["behaviour"] = o.Behaviour + } + if !IsNil(o.Conditions) { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetCustomRule) UnmarshalJSON(data []byte) (err error) { + varGetCustomRule := _GetCustomRule{} + + err = json.Unmarshal(data, &varGetCustomRule) + + if err != nil { + return err + } + + *o = GetCustomRule(varGetCustomRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "behaviour") + delete(additionalProperties, "conditions") + delete(additionalProperties, "description") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetCustomRule struct { + value *GetCustomRule + isSet bool +} + +func (v NullableGetCustomRule) Get() *GetCustomRule { + return v.value +} + +func (v *NullableGetCustomRule) Set(val *GetCustomRule) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomRule) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomRule(val *GetCustomRule) *NullableGetCustomRule { + return &NullableGetCustomRule{value: val, isSet: true} +} + +func (v NullableGetCustomRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_custom_rule_group_response.go b/services/albwaf/v1betaapi/model_get_custom_rule_group_response.go new file mode 100644 index 000000000..4bcf467de --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_custom_rule_group_response.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetCustomRuleGroupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomRuleGroupResponse{} + +// GetCustomRuleGroupResponse Response payload delivering the detailed CRG configuration name and it's rule content. +type GetCustomRuleGroupResponse struct { + // Custom rule group configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Enriched rules containing auto-generated IDs and computed severity values. + Rules []GetCustomRule `json:"rules,omitempty"` + Usage *CRGUsage `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetCustomRuleGroupResponse GetCustomRuleGroupResponse + +// NewGetCustomRuleGroupResponse instantiates a new GetCustomRuleGroupResponse 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 NewGetCustomRuleGroupResponse() *GetCustomRuleGroupResponse { + this := GetCustomRuleGroupResponse{} + return &this +} + +// NewGetCustomRuleGroupResponseWithDefaults instantiates a new GetCustomRuleGroupResponse 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 NewGetCustomRuleGroupResponseWithDefaults() *GetCustomRuleGroupResponse { + this := GetCustomRuleGroupResponse{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetCustomRuleGroupResponse) 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 *GetCustomRuleGroupResponse) 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 *GetCustomRuleGroupResponse) 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 *GetCustomRuleGroupResponse) SetName(v string) { + o.Name = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *GetCustomRuleGroupResponse) GetRules() []GetCustomRule { + if o == nil || IsNil(o.Rules) { + var ret []GetCustomRule + 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 *GetCustomRuleGroupResponse) GetRulesOk() ([]GetCustomRule, 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 *GetCustomRuleGroupResponse) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []GetCustomRule and assigns it to the Rules field. +func (o *GetCustomRuleGroupResponse) SetRules(v []GetCustomRule) { + o.Rules = v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *GetCustomRuleGroupResponse) GetUsage() CRGUsage { + if o == nil || IsNil(o.Usage) { + var ret CRGUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetCustomRuleGroupResponse) GetUsageOk() (*CRGUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *GetCustomRuleGroupResponse) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given CRGUsage and assigns it to the Usage field. +func (o *GetCustomRuleGroupResponse) SetUsage(v CRGUsage) { + o.Usage = &v +} + +func (o GetCustomRuleGroupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomRuleGroupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetCustomRuleGroupResponse) UnmarshalJSON(data []byte) (err error) { + varGetCustomRuleGroupResponse := _GetCustomRuleGroupResponse{} + + err = json.Unmarshal(data, &varGetCustomRuleGroupResponse) + + if err != nil { + return err + } + + *o = GetCustomRuleGroupResponse(varGetCustomRuleGroupResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "rules") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetCustomRuleGroupResponse struct { + value *GetCustomRuleGroupResponse + isSet bool +} + +func (v NullableGetCustomRuleGroupResponse) Get() *GetCustomRuleGroupResponse { + return v.value +} + +func (v *NullableGetCustomRuleGroupResponse) Set(val *GetCustomRuleGroupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomRuleGroupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomRuleGroupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomRuleGroupResponse(val *GetCustomRuleGroupResponse) *NullableGetCustomRuleGroupResponse { + return &NullableGetCustomRuleGroupResponse{value: val, isSet: true} +} + +func (v NullableGetCustomRuleGroupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomRuleGroupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_limited_managed_rule_set_response.go b/services/albwaf/v1betaapi/model_get_limited_managed_rule_set_response.go new file mode 100644 index 000000000..f1b526276 --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_limited_managed_rule_set_response.go @@ -0,0 +1,266 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetLimitedManagedRuleSetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLimitedManagedRuleSetResponse{} + +// GetLimitedManagedRuleSetResponse struct for GetLimitedManagedRuleSetResponse +type GetLimitedManagedRuleSetResponse struct { + // Managed rule set configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + Type *MRSType1 `json:"type,omitempty"` + Usage *MRSUsage `json:"usage,omitempty"` + // Managed rule set version. + Version *string `json:"version,omitempty" validate:"regexp=^v\\\\d+\\\\.\\\\d+\\\\.\\\\d+$"` + AdditionalProperties map[string]interface{} +} + +type _GetLimitedManagedRuleSetResponse GetLimitedManagedRuleSetResponse + +// NewGetLimitedManagedRuleSetResponse instantiates a new GetLimitedManagedRuleSetResponse 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 NewGetLimitedManagedRuleSetResponse() *GetLimitedManagedRuleSetResponse { + this := GetLimitedManagedRuleSetResponse{} + return &this +} + +// NewGetLimitedManagedRuleSetResponseWithDefaults instantiates a new GetLimitedManagedRuleSetResponse 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 NewGetLimitedManagedRuleSetResponseWithDefaults() *GetLimitedManagedRuleSetResponse { + this := GetLimitedManagedRuleSetResponse{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GetLimitedManagedRuleSetResponse) GetType() MRSType1 { + if o == nil || IsNil(o.Type) { + var ret MRSType1 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLimitedManagedRuleSetResponse) GetTypeOk() (*MRSType1, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GetLimitedManagedRuleSetResponse) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given MRSType1 and assigns it to the Type field. +func (o *GetLimitedManagedRuleSetResponse) SetType(v MRSType1) { + o.Type = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *GetLimitedManagedRuleSetResponse) GetUsage() MRSUsage { + if o == nil || IsNil(o.Usage) { + var ret MRSUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLimitedManagedRuleSetResponse) GetUsageOk() (*MRSUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *GetLimitedManagedRuleSetResponse) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given MRSUsage and assigns it to the Usage field. +func (o *GetLimitedManagedRuleSetResponse) SetUsage(v MRSUsage) { + o.Usage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) 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 *GetLimitedManagedRuleSetResponse) SetVersion(v string) { + o.Version = &v +} + +func (o GetLimitedManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLimitedManagedRuleSetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetLimitedManagedRuleSetResponse) UnmarshalJSON(data []byte) (err error) { + varGetLimitedManagedRuleSetResponse := _GetLimitedManagedRuleSetResponse{} + + err = json.Unmarshal(data, &varGetLimitedManagedRuleSetResponse) + + if err != nil { + return err + } + + *o = GetLimitedManagedRuleSetResponse(varGetLimitedManagedRuleSetResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "usage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetLimitedManagedRuleSetResponse struct { + value *GetLimitedManagedRuleSetResponse + isSet bool +} + +func (v NullableGetLimitedManagedRuleSetResponse) Get() *GetLimitedManagedRuleSetResponse { + return v.value +} + +func (v *NullableGetLimitedManagedRuleSetResponse) Set(val *GetLimitedManagedRuleSetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLimitedManagedRuleSetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLimitedManagedRuleSetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLimitedManagedRuleSetResponse(val *GetLimitedManagedRuleSetResponse) *NullableGetLimitedManagedRuleSetResponse { + return &NullableGetLimitedManagedRuleSetResponse{value: val, isSet: true} +} + +func (v NullableGetLimitedManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLimitedManagedRuleSetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_managed_rule_set_response.go b/services/albwaf/v1betaapi/model_get_managed_rule_set_response.go new file mode 100644 index 000000000..c12efef7c --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_managed_rule_set_response.go @@ -0,0 +1,304 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetManagedRuleSetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetManagedRuleSetResponse{} + +// GetManagedRuleSetResponse GetManagedRuleSetResponse returns rule configuration name and it's rules. +type GetManagedRuleSetResponse struct { + // Inventory of all available Managed Rule Set groups and their current configuration. The key is the unique Group ID. + Groups *map[string]MRSRuleGroup `json:"groups,omitempty"` + // Managed rule set configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + Type *MRSType2 `json:"type,omitempty"` + Usage *MRSUsage `json:"usage,omitempty"` + // Managed rule set version. + Version *string `json:"version,omitempty" validate:"regexp=^v\\\\d+\\\\.\\\\d+\\\\.\\\\d+$"` + AdditionalProperties map[string]interface{} +} + +type _GetManagedRuleSetResponse GetManagedRuleSetResponse + +// NewGetManagedRuleSetResponse instantiates a new GetManagedRuleSetResponse 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 NewGetManagedRuleSetResponse() *GetManagedRuleSetResponse { + this := GetManagedRuleSetResponse{} + return &this +} + +// NewGetManagedRuleSetResponseWithDefaults instantiates a new GetManagedRuleSetResponse 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 NewGetManagedRuleSetResponseWithDefaults() *GetManagedRuleSetResponse { + this := GetManagedRuleSetResponse{} + return &this +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *GetManagedRuleSetResponse) GetGroups() map[string]MRSRuleGroup { + if o == nil || IsNil(o.Groups) { + var ret map[string]MRSRuleGroup + 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 *GetManagedRuleSetResponse) GetGroupsOk() (*map[string]MRSRuleGroup, 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 *GetManagedRuleSetResponse) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given map[string]MRSRuleGroup and assigns it to the Groups field. +func (o *GetManagedRuleSetResponse) SetGroups(v map[string]MRSRuleGroup) { + o.Groups = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GetManagedRuleSetResponse) GetType() MRSType2 { + if o == nil || IsNil(o.Type) { + var ret MRSType2 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetManagedRuleSetResponse) GetTypeOk() (*MRSType2, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GetManagedRuleSetResponse) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given MRSType2 and assigns it to the Type field. +func (o *GetManagedRuleSetResponse) SetType(v MRSType2) { + o.Type = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *GetManagedRuleSetResponse) GetUsage() MRSUsage { + if o == nil || IsNil(o.Usage) { + var ret MRSUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetManagedRuleSetResponse) GetUsageOk() (*MRSUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *GetManagedRuleSetResponse) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given MRSUsage and assigns it to the Usage field. +func (o *GetManagedRuleSetResponse) SetUsage(v MRSUsage) { + o.Usage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) 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 *GetManagedRuleSetResponse) SetVersion(v string) { + o.Version = &v +} + +func (o GetManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetManagedRuleSetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetManagedRuleSetResponse) UnmarshalJSON(data []byte) (err error) { + varGetManagedRuleSetResponse := _GetManagedRuleSetResponse{} + + err = json.Unmarshal(data, &varGetManagedRuleSetResponse) + + if err != nil { + return err + } + + *o = GetManagedRuleSetResponse(varGetManagedRuleSetResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "groups") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "usage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetManagedRuleSetResponse struct { + value *GetManagedRuleSetResponse + isSet bool +} + +func (v NullableGetManagedRuleSetResponse) Get() *GetManagedRuleSetResponse { + return v.value +} + +func (v *NullableGetManagedRuleSetResponse) Set(val *GetManagedRuleSetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetManagedRuleSetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetManagedRuleSetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetManagedRuleSetResponse(val *GetManagedRuleSetResponse) *NullableGetManagedRuleSetResponse { + return &NullableGetManagedRuleSetResponse{value: val, isSet: true} +} + +func (v NullableGetManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetManagedRuleSetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_quota_response.go b/services/albwaf/v1betaapi/model_get_quota_response.go new file mode 100644 index 000000000..80d5005ca --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_quota_response.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetQuotaResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetQuotaResponse{} + +// GetQuotaResponse struct for GetQuotaResponse +type GetQuotaResponse struct { + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + Quotas *Quotas `json:"quotas,omitempty"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + AdditionalProperties map[string]interface{} +} + +type _GetQuotaResponse GetQuotaResponse + +// NewGetQuotaResponse instantiates a new GetQuotaResponse 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 NewGetQuotaResponse() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// NewGetQuotaResponseWithDefaults instantiates a new GetQuotaResponse 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 NewGetQuotaResponseWithDefaults() *GetQuotaResponse { + this := GetQuotaResponse{} + return &this +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GetQuotaResponse) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetQuotaResponse) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GetQuotaResponse) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GetQuotaResponse) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetQuotas returns the Quotas field value if set, zero value otherwise. +func (o *GetQuotaResponse) GetQuotas() Quotas { + if o == nil || IsNil(o.Quotas) { + var ret Quotas + return ret + } + return *o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetQuotaResponse) GetQuotasOk() (*Quotas, bool) { + if o == nil || IsNil(o.Quotas) { + return nil, false + } + return o.Quotas, true +} + +// HasQuotas returns a boolean if a field has been set. +func (o *GetQuotaResponse) HasQuotas() bool { + if o != nil && !IsNil(o.Quotas) { + return true + } + + return false +} + +// SetQuotas gets a reference to the given Quotas and assigns it to the Quotas field. +func (o *GetQuotaResponse) SetQuotas(v Quotas) { + o.Quotas = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *GetQuotaResponse) 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 *GetQuotaResponse) 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 *GetQuotaResponse) 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 *GetQuotaResponse) SetRegion(v string) { + o.Region = &v +} + +func (o GetQuotaResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetQuotaResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Quotas) { + toSerialize["quotas"] = o.Quotas + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetQuotaResponse) UnmarshalJSON(data []byte) (err error) { + varGetQuotaResponse := _GetQuotaResponse{} + + err = json.Unmarshal(data, &varGetQuotaResponse) + + if err != nil { + return err + } + + *o = GetQuotaResponse(varGetQuotaResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "projectId") + delete(additionalProperties, "quotas") + delete(additionalProperties, "region") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetQuotaResponse struct { + value *GetQuotaResponse + isSet bool +} + +func (v NullableGetQuotaResponse) Get() *GetQuotaResponse { + return v.value +} + +func (v *NullableGetQuotaResponse) Set(val *GetQuotaResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetQuotaResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetQuotaResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetQuotaResponse(val *GetQuotaResponse) *NullableGetQuotaResponse { + return &NullableGetQuotaResponse{value: val, isSet: true} +} + +func (v NullableGetQuotaResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetQuotaResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_get_waf_response.go b/services/albwaf/v1betaapi/model_get_waf_response.go new file mode 100644 index 000000000..360854464 --- /dev/null +++ b/services/albwaf/v1betaapi/model_get_waf_response.go @@ -0,0 +1,305 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetWAFResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetWAFResponse{} + +// GetWAFResponse GetWAFResponse returns detailed information about the WAF, which includes the identifying name, references to MRS/CRG and usage. +type GetWAFResponse struct { + // Name of the CRG configuration for that WAF. + CustomRuleGroupName *string `json:"customRuleGroupName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Labels represent user-defined metadata as key-value pairs. Label count should not exceed 64 per WAF. **Key Formatting Rules:** Length: 1-63 characters. Characters: Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. Keys starting with 'stackit-' are system-reserved; users MUST NOT manage them. **Value Formatting Rules:** Length: 0-63 characters (empty string explicitly allowed). Characters (for non-empty values): Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. + Labels *map[string]string `json:"labels,omitempty"` + // Name of the managed rule set configuration for that WAF. + ManagedRuleSetName *string `json:"managedRuleSetName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // WAF name + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + Usage *WAFUsage `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetWAFResponse GetWAFResponse + +// NewGetWAFResponse instantiates a new GetWAFResponse 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 NewGetWAFResponse() *GetWAFResponse { + this := GetWAFResponse{} + return &this +} + +// NewGetWAFResponseWithDefaults instantiates a new GetWAFResponse 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 NewGetWAFResponseWithDefaults() *GetWAFResponse { + this := GetWAFResponse{} + return &this +} + +// GetCustomRuleGroupName returns the CustomRuleGroupName field value if set, zero value otherwise. +func (o *GetWAFResponse) GetCustomRuleGroupName() string { + if o == nil || IsNil(o.CustomRuleGroupName) { + var ret string + return ret + } + return *o.CustomRuleGroupName +} + +// GetCustomRuleGroupNameOk returns a tuple with the CustomRuleGroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetWAFResponse) GetCustomRuleGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.CustomRuleGroupName) { + return nil, false + } + return o.CustomRuleGroupName, true +} + +// HasCustomRuleGroupName returns a boolean if a field has been set. +func (o *GetWAFResponse) HasCustomRuleGroupName() bool { + if o != nil && !IsNil(o.CustomRuleGroupName) { + return true + } + + return false +} + +// SetCustomRuleGroupName gets a reference to the given string and assigns it to the CustomRuleGroupName field. +func (o *GetWAFResponse) SetCustomRuleGroupName(v string) { + o.CustomRuleGroupName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetWAFResponse) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// 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 *GetWAFResponse) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *GetWAFResponse) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *GetWAFResponse) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetManagedRuleSetName returns the ManagedRuleSetName field value if set, zero value otherwise. +func (o *GetWAFResponse) GetManagedRuleSetName() string { + if o == nil || IsNil(o.ManagedRuleSetName) { + var ret string + return ret + } + return *o.ManagedRuleSetName +} + +// GetManagedRuleSetNameOk returns a tuple with the ManagedRuleSetName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetWAFResponse) GetManagedRuleSetNameOk() (*string, bool) { + if o == nil || IsNil(o.ManagedRuleSetName) { + return nil, false + } + return o.ManagedRuleSetName, true +} + +// HasManagedRuleSetName returns a boolean if a field has been set. +func (o *GetWAFResponse) HasManagedRuleSetName() bool { + if o != nil && !IsNil(o.ManagedRuleSetName) { + return true + } + + return false +} + +// SetManagedRuleSetName gets a reference to the given string and assigns it to the ManagedRuleSetName field. +func (o *GetWAFResponse) SetManagedRuleSetName(v string) { + o.ManagedRuleSetName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetWAFResponse) 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 *GetWAFResponse) 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 *GetWAFResponse) 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 *GetWAFResponse) SetName(v string) { + o.Name = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *GetWAFResponse) GetUsage() WAFUsage { + if o == nil || IsNil(o.Usage) { + var ret WAFUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetWAFResponse) GetUsageOk() (*WAFUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *GetWAFResponse) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given WAFUsage and assigns it to the Usage field. +func (o *GetWAFResponse) SetUsage(v WAFUsage) { + o.Usage = &v +} + +func (o GetWAFResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetWAFResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomRuleGroupName) { + toSerialize["customRuleGroupName"] = o.CustomRuleGroupName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.ManagedRuleSetName) { + toSerialize["managedRuleSetName"] = o.ManagedRuleSetName + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetWAFResponse) UnmarshalJSON(data []byte) (err error) { + varGetWAFResponse := _GetWAFResponse{} + + err = json.Unmarshal(data, &varGetWAFResponse) + + if err != nil { + return err + } + + *o = GetWAFResponse(varGetWAFResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "customRuleGroupName") + delete(additionalProperties, "labels") + delete(additionalProperties, "managedRuleSetName") + delete(additionalProperties, "name") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetWAFResponse struct { + value *GetWAFResponse + isSet bool +} + +func (v NullableGetWAFResponse) Get() *GetWAFResponse { + return v.value +} + +func (v *NullableGetWAFResponse) Set(val *GetWAFResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetWAFResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetWAFResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetWAFResponse(val *GetWAFResponse) *NullableGetWAFResponse { + return &NullableGetWAFResponse{value: val, isSet: true} +} + +func (v NullableGetWAFResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetWAFResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_google_protobuf_any.go b/services/albwaf/v1betaapi/model_google_protobuf_any.go new file mode 100644 index 000000000..4bee32e6b --- /dev/null +++ b/services/albwaf/v1betaapi/model_google_protobuf_any.go @@ -0,0 +1,154 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleProtobufAny{} + +// GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. +type GoogleProtobufAny struct { + // The type of the serialized message. + Type *string `json:"@type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleProtobufAny GoogleProtobufAny + +// NewGoogleProtobufAny instantiates a new GoogleProtobufAny 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 NewGoogleProtobufAny() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// NewGoogleProtobufAnyWithDefaults instantiates a new GoogleProtobufAny 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 NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { + this := GoogleProtobufAny{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GoogleProtobufAny) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleProtobufAny) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GoogleProtobufAny) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GoogleProtobufAny) SetType(v string) { + o.Type = &v +} + +func (o GoogleProtobufAny) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["@type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleProtobufAny) UnmarshalJSON(data []byte) (err error) { + varGoogleProtobufAny := _GoogleProtobufAny{} + + err = json.Unmarshal(data, &varGoogleProtobufAny) + + if err != nil { + return err + } + + *o = GoogleProtobufAny(varGoogleProtobufAny) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "@type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleProtobufAny struct { + value *GoogleProtobufAny + isSet bool +} + +func (v NullableGoogleProtobufAny) Get() *GoogleProtobufAny { + return v.value +} + +func (v *NullableGoogleProtobufAny) Set(val *GoogleProtobufAny) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleProtobufAny) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleProtobufAny) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleProtobufAny(val *GoogleProtobufAny) *NullableGoogleProtobufAny { + return &NullableGoogleProtobufAny{value: val, isSet: true} +} + +func (v NullableGoogleProtobufAny) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleProtobufAny) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_list_custom_rule_group_response.go b/services/albwaf/v1betaapi/model_list_custom_rule_group_response.go new file mode 100644 index 000000000..fae419850 --- /dev/null +++ b/services/albwaf/v1betaapi/model_list_custom_rule_group_response.go @@ -0,0 +1,191 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ListCustomRuleGroupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCustomRuleGroupResponse{} + +// ListCustomRuleGroupResponse ListCustomRuleGroupResponse returns a list of Custom Rule Group responses. +type ListCustomRuleGroupResponse struct { + Items []GetCustomRuleGroupResponse `json:"items,omitempty"` + // Continue token from the ListCustomRuleGroupResponse 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{} +} + +type _ListCustomRuleGroupResponse ListCustomRuleGroupResponse + +// NewListCustomRuleGroupResponse instantiates a new ListCustomRuleGroupResponse 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 NewListCustomRuleGroupResponse() *ListCustomRuleGroupResponse { + this := ListCustomRuleGroupResponse{} + return &this +} + +// NewListCustomRuleGroupResponseWithDefaults instantiates a new ListCustomRuleGroupResponse 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 NewListCustomRuleGroupResponseWithDefaults() *ListCustomRuleGroupResponse { + this := ListCustomRuleGroupResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListCustomRuleGroupResponse) GetItems() []GetCustomRuleGroupResponse { + if o == nil || IsNil(o.Items) { + var ret []GetCustomRuleGroupResponse + return ret + } + return o.Items +} + +// 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 *ListCustomRuleGroupResponse) GetItemsOk() ([]GetCustomRuleGroupResponse, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListCustomRuleGroupResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []GetCustomRuleGroupResponse and assigns it to the Items field. +func (o *ListCustomRuleGroupResponse) SetItems(v []GetCustomRuleGroupResponse) { + o.Items = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListCustomRuleGroupResponse) GetNextPageId() string { + if o == nil || IsNil(o.NextPageId) { + var ret string + return ret + } + return *o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCustomRuleGroupResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListCustomRuleGroupResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListCustomRuleGroupResponse) SetNextPageId(v string) { + o.NextPageId = &v +} + +func (o ListCustomRuleGroupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCustomRuleGroupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCustomRuleGroupResponse) UnmarshalJSON(data []byte) (err error) { + varListCustomRuleGroupResponse := _ListCustomRuleGroupResponse{} + + err = json.Unmarshal(data, &varListCustomRuleGroupResponse) + + if err != nil { + return err + } + + *o = ListCustomRuleGroupResponse(varListCustomRuleGroupResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + delete(additionalProperties, "nextPageId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCustomRuleGroupResponse struct { + value *ListCustomRuleGroupResponse + isSet bool +} + +func (v NullableListCustomRuleGroupResponse) Get() *ListCustomRuleGroupResponse { + return v.value +} + +func (v *NullableListCustomRuleGroupResponse) Set(val *ListCustomRuleGroupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCustomRuleGroupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCustomRuleGroupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCustomRuleGroupResponse(val *ListCustomRuleGroupResponse) *NullableListCustomRuleGroupResponse { + return &NullableListCustomRuleGroupResponse{value: val, isSet: true} +} + +func (v NullableListCustomRuleGroupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCustomRuleGroupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_list_managed_rule_set_response.go b/services/albwaf/v1betaapi/model_list_managed_rule_set_response.go new file mode 100644 index 000000000..74cad823a --- /dev/null +++ b/services/albwaf/v1betaapi/model_list_managed_rule_set_response.go @@ -0,0 +1,191 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ListManagedRuleSetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListManagedRuleSetResponse{} + +// ListManagedRuleSetResponse ListManagedRuleSetResponse returns a list of rule configuration responses. +type ListManagedRuleSetResponse struct { + Items []GetLimitedManagedRuleSetResponse `json:"items,omitempty"` + // Continue token from the ListManagedRuleSetResponse 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{} +} + +type _ListManagedRuleSetResponse ListManagedRuleSetResponse + +// NewListManagedRuleSetResponse instantiates a new ListManagedRuleSetResponse 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 NewListManagedRuleSetResponse() *ListManagedRuleSetResponse { + this := ListManagedRuleSetResponse{} + return &this +} + +// NewListManagedRuleSetResponseWithDefaults instantiates a new ListManagedRuleSetResponse 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 NewListManagedRuleSetResponseWithDefaults() *ListManagedRuleSetResponse { + this := ListManagedRuleSetResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListManagedRuleSetResponse) GetItems() []GetLimitedManagedRuleSetResponse { + if o == nil || IsNil(o.Items) { + var ret []GetLimitedManagedRuleSetResponse + return ret + } + return o.Items +} + +// 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 *ListManagedRuleSetResponse) GetItemsOk() ([]GetLimitedManagedRuleSetResponse, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListManagedRuleSetResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []GetLimitedManagedRuleSetResponse and assigns it to the Items field. +func (o *ListManagedRuleSetResponse) SetItems(v []GetLimitedManagedRuleSetResponse) { + o.Items = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListManagedRuleSetResponse) GetNextPageId() string { + if o == nil || IsNil(o.NextPageId) { + var ret string + return ret + } + return *o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListManagedRuleSetResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListManagedRuleSetResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListManagedRuleSetResponse) SetNextPageId(v string) { + o.NextPageId = &v +} + +func (o ListManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListManagedRuleSetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListManagedRuleSetResponse) UnmarshalJSON(data []byte) (err error) { + varListManagedRuleSetResponse := _ListManagedRuleSetResponse{} + + err = json.Unmarshal(data, &varListManagedRuleSetResponse) + + if err != nil { + return err + } + + *o = ListManagedRuleSetResponse(varListManagedRuleSetResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + delete(additionalProperties, "nextPageId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListManagedRuleSetResponse struct { + value *ListManagedRuleSetResponse + isSet bool +} + +func (v NullableListManagedRuleSetResponse) Get() *ListManagedRuleSetResponse { + return v.value +} + +func (v *NullableListManagedRuleSetResponse) Set(val *ListManagedRuleSetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListManagedRuleSetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListManagedRuleSetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListManagedRuleSetResponse(val *ListManagedRuleSetResponse) *NullableListManagedRuleSetResponse { + return &NullableListManagedRuleSetResponse{value: val, isSet: true} +} + +func (v NullableListManagedRuleSetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListManagedRuleSetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_list_waf_response.go b/services/albwaf/v1betaapi/model_list_waf_response.go new file mode 100644 index 000000000..97be26059 --- /dev/null +++ b/services/albwaf/v1betaapi/model_list_waf_response.go @@ -0,0 +1,191 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ListWAFResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListWAFResponse{} + +// ListWAFResponse ListWAFResponse returns a list of WAF responses. +type ListWAFResponse struct { + Items []GetWAFResponse `json:"items,omitempty"` + // Continue token from the ListWAFResponse 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{} +} + +type _ListWAFResponse ListWAFResponse + +// NewListWAFResponse instantiates a new ListWAFResponse 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 NewListWAFResponse() *ListWAFResponse { + this := ListWAFResponse{} + return &this +} + +// NewListWAFResponseWithDefaults instantiates a new ListWAFResponse 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 NewListWAFResponseWithDefaults() *ListWAFResponse { + this := ListWAFResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListWAFResponse) GetItems() []GetWAFResponse { + if o == nil || IsNil(o.Items) { + var ret []GetWAFResponse + return ret + } + return o.Items +} + +// 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 *ListWAFResponse) GetItemsOk() ([]GetWAFResponse, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListWAFResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []GetWAFResponse and assigns it to the Items field. +func (o *ListWAFResponse) SetItems(v []GetWAFResponse) { + o.Items = v +} + +// GetNextPageId returns the NextPageId field value if set, zero value otherwise. +func (o *ListWAFResponse) GetNextPageId() string { + if o == nil || IsNil(o.NextPageId) { + var ret string + return ret + } + return *o.NextPageId +} + +// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListWAFResponse) GetNextPageIdOk() (*string, bool) { + if o == nil || IsNil(o.NextPageId) { + return nil, false + } + return o.NextPageId, true +} + +// HasNextPageId returns a boolean if a field has been set. +func (o *ListWAFResponse) HasNextPageId() bool { + if o != nil && !IsNil(o.NextPageId) { + return true + } + + return false +} + +// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. +func (o *ListWAFResponse) SetNextPageId(v string) { + o.NextPageId = &v +} + +func (o ListWAFResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListWAFResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextPageId) { + toSerialize["nextPageId"] = o.NextPageId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListWAFResponse) UnmarshalJSON(data []byte) (err error) { + varListWAFResponse := _ListWAFResponse{} + + err = json.Unmarshal(data, &varListWAFResponse) + + if err != nil { + return err + } + + *o = ListWAFResponse(varListWAFResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + delete(additionalProperties, "nextPageId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListWAFResponse struct { + value *ListWAFResponse + isSet bool +} + +func (v NullableListWAFResponse) Get() *ListWAFResponse { + return v.value +} + +func (v *NullableListWAFResponse) Set(val *ListWAFResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListWAFResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListWAFResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListWAFResponse(val *ListWAFResponse) *NullableListWAFResponse { + return &NullableListWAFResponse{value: val, isSet: true} +} + +func (v NullableListWAFResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListWAFResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mode.go b/services/albwaf/v1betaapi/model_mode.go new file mode 100644 index 000000000..6b639850d --- /dev/null +++ b/services/albwaf/v1betaapi/model_mode.go @@ -0,0 +1,117 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// Mode The current mode of the rule. +type Mode string + +// List of Mode +const ( + MODE_MODE_UNSPECIFIED Mode = "MODE_UNSPECIFIED" + MODE_MODE_ENABLED Mode = "MODE_ENABLED" + MODE_MODE_DISABLED Mode = "MODE_DISABLED" + MODE_MODE_LOG_ONLY Mode = "MODE_LOG_ONLY" + MODE_UNKNOWN_DEFAULT_OPEN_API Mode = "unknown_default_open_api" +) + +// All allowed values of Mode enum +var AllowedModeEnumValues = []Mode{ + "MODE_UNSPECIFIED", + "MODE_ENABLED", + "MODE_DISABLED", + "MODE_LOG_ONLY", + "unknown_default_open_api", +} + +func (v *Mode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Mode(value) + for _, existing := range AllowedModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MODE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewModeFromValue returns a pointer to a valid Mode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModeFromValue(v string) (*Mode, error) { + ev := Mode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Mode: valid values are %v", v, AllowedModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Mode) IsValid() bool { + for _, existing := range AllowedModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Mode value +func (v Mode) Ptr() *Mode { + return &v +} + +type NullableMode struct { + value *Mode + isSet bool +} + +func (v NullableMode) Get() *Mode { + return v.value +} + +func (v *NullableMode) Set(val *Mode) { + v.value = val + v.isSet = true +} + +func (v NullableMode) IsSet() bool { + return v.isSet +} + +func (v *NullableMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMode(val *Mode) *NullableMode { + return &NullableMode{value: val, isSet: true} +} + +func (v NullableMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mode_1.go b/services/albwaf/v1betaapi/model_mode_1.go new file mode 100644 index 000000000..a55a9c336 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mode_1.go @@ -0,0 +1,117 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// Mode1 The current mode of the rule. +type Mode1 string + +// List of Mode_1 +const ( + MODE1_MODE_UNSPECIFIED Mode1 = "MODE_UNSPECIFIED" + MODE1_MODE_ENABLED Mode1 = "MODE_ENABLED" + MODE1_MODE_DISABLED Mode1 = "MODE_DISABLED" + MODE1_MODE_LOG_ONLY Mode1 = "MODE_LOG_ONLY" + MODE1_UNKNOWN_DEFAULT_OPEN_API Mode1 = "unknown_default_open_api" +) + +// All allowed values of Mode1 enum +var AllowedMode1EnumValues = []Mode1{ + "MODE_UNSPECIFIED", + "MODE_ENABLED", + "MODE_DISABLED", + "MODE_LOG_ONLY", + "unknown_default_open_api", +} + +func (v *Mode1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Mode1(value) + for _, existing := range AllowedMode1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MODE1_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewMode1FromValue returns a pointer to a valid Mode1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMode1FromValue(v string) (*Mode1, error) { + ev := Mode1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Mode1: valid values are %v", v, AllowedMode1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Mode1) IsValid() bool { + for _, existing := range AllowedMode1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Mode_1 value +func (v Mode1) Ptr() *Mode1 { + return &v +} + +type NullableMode1 struct { + value *Mode1 + isSet bool +} + +func (v NullableMode1) Get() *Mode1 { + return v.value +} + +func (v *NullableMode1) Set(val *Mode1) { + v.value = val + v.isSet = true +} + +func (v NullableMode1) IsSet() bool { + return v.isSet +} + +func (v *NullableMode1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMode1(val *Mode1) *NullableMode1 { + return &NullableMode1{value: val, isSet: true} +} + +func (v NullableMode1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMode1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_config_quota.go b/services/albwaf/v1betaapi/model_mrs_config_quota.go new file mode 100644 index 000000000..f814e2b77 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_config_quota.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the MRSConfigQuota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MRSConfigQuota{} + +// MRSConfigQuota MRS Config quota holds the limit and usage for Managed Rule Set configuration resources +type MRSConfigQuota struct { + // The maximum number of Managed Rule Set configurations in this project. + Limit *int32 `json:"limit,omitempty"` + // The number of Managed Rule Set configurations that are currently existing in this project. + Usage *int32 `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MRSConfigQuota MRSConfigQuota + +// NewMRSConfigQuota instantiates a new MRSConfigQuota 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 NewMRSConfigQuota() *MRSConfigQuota { + this := MRSConfigQuota{} + return &this +} + +// NewMRSConfigQuotaWithDefaults instantiates a new MRSConfigQuota 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 NewMRSConfigQuotaWithDefaults() *MRSConfigQuota { + this := MRSConfigQuota{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *MRSConfigQuota) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MRSConfigQuota) GetLimitOk() (*int32, bool) { + if o == nil || IsNil(o.Limit) { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *MRSConfigQuota) HasLimit() bool { + if o != nil && !IsNil(o.Limit) { + return true + } + + return false +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *MRSConfigQuota) SetLimit(v int32) { + o.Limit = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *MRSConfigQuota) GetUsage() int32 { + if o == nil || IsNil(o.Usage) { + var ret int32 + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MRSConfigQuota) GetUsageOk() (*int32, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *MRSConfigQuota) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given int32 and assigns it to the Usage field. +func (o *MRSConfigQuota) SetUsage(v int32) { + o.Usage = &v +} + +func (o MRSConfigQuota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MRSConfigQuota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Limit) { + toSerialize["limit"] = o.Limit + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MRSConfigQuota) UnmarshalJSON(data []byte) (err error) { + varMRSConfigQuota := _MRSConfigQuota{} + + err = json.Unmarshal(data, &varMRSConfigQuota) + + if err != nil { + return err + } + + *o = MRSConfigQuota(varMRSConfigQuota) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "limit") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMRSConfigQuota struct { + value *MRSConfigQuota + isSet bool +} + +func (v NullableMRSConfigQuota) Get() *MRSConfigQuota { + return v.value +} + +func (v *NullableMRSConfigQuota) Set(val *MRSConfigQuota) { + v.value = val + v.isSet = true +} + +func (v NullableMRSConfigQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSConfigQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSConfigQuota(val *MRSConfigQuota) *NullableMRSConfigQuota { + return &NullableMRSConfigQuota{value: val, isSet: true} +} + +func (v NullableMRSConfigQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSConfigQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_rule.go b/services/albwaf/v1betaapi/model_mrs_rule.go new file mode 100644 index 000000000..11d5bca62 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_rule.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the MRSRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MRSRule{} + +// MRSRule Rule represents an individual security or validation rule. +type MRSRule struct { + // SQL Injection Attack Detected via libinjection + Description *string `json:"description,omitempty"` + Mode *Mode `json:"mode,omitempty"` + // Impact level. + Severity *string `json:"severity,omitempty" validate:"regexp=^(CRITICAL|ERROR|WARNING|INFO)$"` + AdditionalProperties map[string]interface{} +} + +type _MRSRule MRSRule + +// NewMRSRule instantiates a new MRSRule 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 NewMRSRule() *MRSRule { + this := MRSRule{} + return &this +} + +// NewMRSRuleWithDefaults instantiates a new MRSRule 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 NewMRSRuleWithDefaults() *MRSRule { + this := MRSRule{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MRSRule) 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 *MRSRule) 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 *MRSRule) 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 *MRSRule) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *MRSRule) GetMode() Mode { + if o == nil || IsNil(o.Mode) { + var ret Mode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MRSRule) GetModeOk() (*Mode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *MRSRule) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given Mode and assigns it to the Mode field. +func (o *MRSRule) SetMode(v Mode) { + o.Mode = &v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *MRSRule) 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 *MRSRule) 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 *MRSRule) 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 *MRSRule) SetSeverity(v string) { + o.Severity = &v +} + +func (o MRSRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MRSRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MRSRule) UnmarshalJSON(data []byte) (err error) { + varMRSRule := _MRSRule{} + + err = json.Unmarshal(data, &varMRSRule) + + if err != nil { + return err + } + + *o = MRSRule(varMRSRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "severity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMRSRule struct { + value *MRSRule + isSet bool +} + +func (v NullableMRSRule) Get() *MRSRule { + return v.value +} + +func (v *NullableMRSRule) Set(val *MRSRule) { + v.value = val + v.isSet = true +} + +func (v NullableMRSRule) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSRule(val *MRSRule) *NullableMRSRule { + return &NullableMRSRule{value: val, isSet: true} +} + +func (v NullableMRSRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_rule_group.go b/services/albwaf/v1betaapi/model_mrs_rule_group.go new file mode 100644 index 000000000..da09f4e41 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_rule_group.go @@ -0,0 +1,229 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the MRSRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MRSRuleGroup{} + +// MRSRuleGroup RuleGroup represents a collection of rules associated with a specific group. +type MRSRuleGroup 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\\\\(\\\\) ]+$"` + Rules *map[string]MRSRule `json:"rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MRSRuleGroup MRSRuleGroup + +// NewMRSRuleGroup instantiates a new MRSRuleGroup 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 NewMRSRuleGroup() *MRSRuleGroup { + this := MRSRuleGroup{} + return &this +} + +// NewMRSRuleGroupWithDefaults instantiates a new MRSRuleGroup 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 NewMRSRuleGroupWithDefaults() *MRSRuleGroup { + this := MRSRuleGroup{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MRSRuleGroup) 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 *MRSRuleGroup) 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 *MRSRuleGroup) 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 *MRSRuleGroup) SetDescription(v string) { + o.Description = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *MRSRuleGroup) 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 *MRSRuleGroup) 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 *MRSRuleGroup) 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 *MRSRuleGroup) SetGroupName(v string) { + o.GroupName = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *MRSRuleGroup) GetRules() map[string]MRSRule { + if o == nil || IsNil(o.Rules) { + var ret map[string]MRSRule + 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 *MRSRuleGroup) GetRulesOk() (*map[string]MRSRule, 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 *MRSRuleGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given map[string]MRSRule and assigns it to the Rules field. +func (o *MRSRuleGroup) SetRules(v map[string]MRSRule) { + o.Rules = &v +} + +func (o MRSRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MRSRuleGroup) 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 *MRSRuleGroup) UnmarshalJSON(data []byte) (err error) { + varMRSRuleGroup := _MRSRuleGroup{} + + err = json.Unmarshal(data, &varMRSRuleGroup) + + if err != nil { + return err + } + + *o = MRSRuleGroup(varMRSRuleGroup) + + 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 NullableMRSRuleGroup struct { + value *MRSRuleGroup + isSet bool +} + +func (v NullableMRSRuleGroup) Get() *MRSRuleGroup { + return v.value +} + +func (v *NullableMRSRuleGroup) Set(val *MRSRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullableMRSRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSRuleGroup(val *MRSRuleGroup) *NullableMRSRuleGroup { + return &NullableMRSRuleGroup{value: val, isSet: true} +} + +func (v NullableMRSRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_type.go b/services/albwaf/v1betaapi/model_mrs_type.go new file mode 100644 index 000000000..df14e8952 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_type.go @@ -0,0 +1,113 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// MRSType Set the managed rule set type. +type MRSType string + +// List of MRS_Type +const ( + MRSTYPE_TYPE_UNSPECIFIED MRSType = "TYPE_UNSPECIFIED" + MRSTYPE_TYPE_OWASP_CRS MRSType = "TYPE_OWASP_CRS" + MRSTYPE_UNKNOWN_DEFAULT_OPEN_API MRSType = "unknown_default_open_api" +) + +// All allowed values of MRSType enum +var AllowedMRSTypeEnumValues = []MRSType{ + "TYPE_UNSPECIFIED", + "TYPE_OWASP_CRS", + "unknown_default_open_api", +} + +func (v *MRSType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MRSType(value) + for _, existing := range AllowedMRSTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MRSTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewMRSTypeFromValue returns a pointer to a valid MRSType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMRSTypeFromValue(v string) (*MRSType, error) { + ev := MRSType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MRSType: valid values are %v", v, AllowedMRSTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MRSType) IsValid() bool { + for _, existing := range AllowedMRSTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MRS_Type value +func (v MRSType) Ptr() *MRSType { + return &v +} + +type NullableMRSType struct { + value *MRSType + isSet bool +} + +func (v NullableMRSType) Get() *MRSType { + return v.value +} + +func (v *NullableMRSType) Set(val *MRSType) { + v.value = val + v.isSet = true +} + +func (v NullableMRSType) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSType(val *MRSType) *NullableMRSType { + return &NullableMRSType{value: val, isSet: true} +} + +func (v NullableMRSType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_type_1.go b/services/albwaf/v1betaapi/model_mrs_type_1.go new file mode 100644 index 000000000..419a5b1ea --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_type_1.go @@ -0,0 +1,113 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// MRSType1 Get the managed rule set type. +type MRSType1 string + +// List of MRS_Type_1 +const ( + MRSTYPE1_TYPE_UNSPECIFIED MRSType1 = "TYPE_UNSPECIFIED" + MRSTYPE1_TYPE_OWASP_CRS MRSType1 = "TYPE_OWASP_CRS" + MRSTYPE1_UNKNOWN_DEFAULT_OPEN_API MRSType1 = "unknown_default_open_api" +) + +// All allowed values of MRSType1 enum +var AllowedMRSType1EnumValues = []MRSType1{ + "TYPE_UNSPECIFIED", + "TYPE_OWASP_CRS", + "unknown_default_open_api", +} + +func (v *MRSType1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MRSType1(value) + for _, existing := range AllowedMRSType1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MRSTYPE1_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewMRSType1FromValue returns a pointer to a valid MRSType1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMRSType1FromValue(v string) (*MRSType1, error) { + ev := MRSType1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MRSType1: valid values are %v", v, AllowedMRSType1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MRSType1) IsValid() bool { + for _, existing := range AllowedMRSType1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MRS_Type_1 value +func (v MRSType1) Ptr() *MRSType1 { + return &v +} + +type NullableMRSType1 struct { + value *MRSType1 + isSet bool +} + +func (v NullableMRSType1) Get() *MRSType1 { + return v.value +} + +func (v *NullableMRSType1) Set(val *MRSType1) { + v.value = val + v.isSet = true +} + +func (v NullableMRSType1) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSType1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSType1(val *MRSType1) *NullableMRSType1 { + return &NullableMRSType1{value: val, isSet: true} +} + +func (v NullableMRSType1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSType1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_type_2.go b/services/albwaf/v1betaapi/model_mrs_type_2.go new file mode 100644 index 000000000..a628ceca8 --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_type_2.go @@ -0,0 +1,113 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// MRSType2 Get the managed rule set type. +type MRSType2 string + +// List of MRS_Type_2 +const ( + MRSTYPE2_TYPE_UNSPECIFIED MRSType2 = "TYPE_UNSPECIFIED" + MRSTYPE2_TYPE_OWASP_CRS MRSType2 = "TYPE_OWASP_CRS" + MRSTYPE2_UNKNOWN_DEFAULT_OPEN_API MRSType2 = "unknown_default_open_api" +) + +// All allowed values of MRSType2 enum +var AllowedMRSType2EnumValues = []MRSType2{ + "TYPE_UNSPECIFIED", + "TYPE_OWASP_CRS", + "unknown_default_open_api", +} + +func (v *MRSType2) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MRSType2(value) + for _, existing := range AllowedMRSType2EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MRSTYPE2_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewMRSType2FromValue returns a pointer to a valid MRSType2 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMRSType2FromValue(v string) (*MRSType2, error) { + ev := MRSType2(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MRSType2: valid values are %v", v, AllowedMRSType2EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MRSType2) IsValid() bool { + for _, existing := range AllowedMRSType2EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MRS_Type_2 value +func (v MRSType2) Ptr() *MRSType2 { + return &v +} + +type NullableMRSType2 struct { + value *MRSType2 + isSet bool +} + +func (v NullableMRSType2) Get() *MRSType2 { + return v.value +} + +func (v *NullableMRSType2) Set(val *MRSType2) { + v.value = val + v.isSet = true +} + +func (v NullableMRSType2) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSType2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSType2(val *MRSType2) *NullableMRSType2 { + return &NullableMRSType2{value: val, isSet: true} +} + +func (v NullableMRSType2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSType2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_mrs_usage.go b/services/albwaf/v1betaapi/model_mrs_usage.go new file mode 100644 index 000000000..7609db0fc --- /dev/null +++ b/services/albwaf/v1betaapi/model_mrs_usage.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the MRSUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MRSUsage{} + +// MRSUsage struct for MRSUsage +type MRSUsage struct { + // Number of WAFs using this Managed Rule Set. + Count *int32 `json:"count,omitempty"` + // List of WAFs that use this Managed Rule Set. + Items []string `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MRSUsage MRSUsage + +// NewMRSUsage instantiates a new MRSUsage 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 NewMRSUsage() *MRSUsage { + this := MRSUsage{} + return &this +} + +// NewMRSUsageWithDefaults instantiates a new MRSUsage 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 NewMRSUsageWithDefaults() *MRSUsage { + this := MRSUsage{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *MRSUsage) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MRSUsage) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *MRSUsage) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *MRSUsage) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *MRSUsage) GetItems() []string { + if o == nil || IsNil(o.Items) { + var ret []string + return ret + } + return o.Items +} + +// 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 *MRSUsage) GetItemsOk() ([]string, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *MRSUsage) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []string and assigns it to the Items field. +func (o *MRSUsage) SetItems(v []string) { + o.Items = v +} + +func (o MRSUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MRSUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MRSUsage) UnmarshalJSON(data []byte) (err error) { + varMRSUsage := _MRSUsage{} + + err = json.Unmarshal(data, &varMRSUsage) + + if err != nil { + return err + } + + *o = MRSUsage(varMRSUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMRSUsage struct { + value *MRSUsage + isSet bool +} + +func (v NullableMRSUsage) Get() *MRSUsage { + return v.value +} + +func (v *NullableMRSUsage) Set(val *MRSUsage) { + v.value = val + v.isSet = true +} + +func (v NullableMRSUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableMRSUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMRSUsage(val *MRSUsage) *NullableMRSUsage { + return &NullableMRSUsage{value: val, isSet: true} +} + +func (v NullableMRSUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMRSUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_patch_managed_rule_set_payload.go b/services/albwaf/v1betaapi/model_patch_managed_rule_set_payload.go new file mode 100644 index 000000000..d43cdce5e --- /dev/null +++ b/services/albwaf/v1betaapi/model_patch_managed_rule_set_payload.go @@ -0,0 +1,268 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchManagedRuleSetPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchManagedRuleSetPayload{} + +// PatchManagedRuleSetPayload PatchManagedRuleSetRequest updates a rules configuration. +type PatchManagedRuleSetPayload struct { + // Map of Managed Rule Set groups to be patched. The key is the Group ID (e.g., 942 for SQL Injection). Only provided rules within the group will be updated; others remain unchanged. + Groups *map[string]PatchMRSRuleGroup `json:"groups,omitempty"` + // Managed rule set configuration name. + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + AdditionalProperties map[string]interface{} +} + +type _PatchManagedRuleSetPayload PatchManagedRuleSetPayload + +// NewPatchManagedRuleSetPayload instantiates a new PatchManagedRuleSetPayload 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 NewPatchManagedRuleSetPayload() *PatchManagedRuleSetPayload { + this := PatchManagedRuleSetPayload{} + return &this +} + +// NewPatchManagedRuleSetPayloadWithDefaults instantiates a new PatchManagedRuleSetPayload 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 NewPatchManagedRuleSetPayloadWithDefaults() *PatchManagedRuleSetPayload { + this := PatchManagedRuleSetPayload{} + return &this +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *PatchManagedRuleSetPayload) GetGroups() map[string]PatchMRSRuleGroup { + if o == nil || IsNil(o.Groups) { + var ret map[string]PatchMRSRuleGroup + 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 *PatchManagedRuleSetPayload) GetGroupsOk() (*map[string]PatchMRSRuleGroup, 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 *PatchManagedRuleSetPayload) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given map[string]PatchMRSRuleGroup and assigns it to the Groups field. +func (o *PatchManagedRuleSetPayload) SetGroups(v map[string]PatchMRSRuleGroup) { + o.Groups = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *PatchManagedRuleSetPayload) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchManagedRuleSetPayload) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *PatchManagedRuleSetPayload) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *PatchManagedRuleSetPayload) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) 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 *PatchManagedRuleSetPayload) SetRegion(v string) { + o.Region = &v +} + +func (o PatchManagedRuleSetPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchManagedRuleSetPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchManagedRuleSetPayload) UnmarshalJSON(data []byte) (err error) { + varPatchManagedRuleSetPayload := _PatchManagedRuleSetPayload{} + + err = json.Unmarshal(data, &varPatchManagedRuleSetPayload) + + if err != nil { + return err + } + + *o = PatchManagedRuleSetPayload(varPatchManagedRuleSetPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "groups") + delete(additionalProperties, "name") + delete(additionalProperties, "projectId") + delete(additionalProperties, "region") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchManagedRuleSetPayload struct { + value *PatchManagedRuleSetPayload + isSet bool +} + +func (v NullablePatchManagedRuleSetPayload) Get() *PatchManagedRuleSetPayload { + return v.value +} + +func (v *NullablePatchManagedRuleSetPayload) Set(val *PatchManagedRuleSetPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchManagedRuleSetPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchManagedRuleSetPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchManagedRuleSetPayload(val *PatchManagedRuleSetPayload) *NullablePatchManagedRuleSetPayload { + return &NullablePatchManagedRuleSetPayload{value: val, isSet: true} +} + +func (v NullablePatchManagedRuleSetPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchManagedRuleSetPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_patch_mrs_rule.go b/services/albwaf/v1betaapi/model_patch_mrs_rule.go new file mode 100644 index 000000000..66509bbb2 --- /dev/null +++ b/services/albwaf/v1betaapi/model_patch_mrs_rule.go @@ -0,0 +1,153 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchMRSRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchMRSRule{} + +// PatchMRSRule struct for PatchMRSRule +type PatchMRSRule struct { + Mode *Mode1 `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchMRSRule PatchMRSRule + +// NewPatchMRSRule instantiates a new PatchMRSRule 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 NewPatchMRSRule() *PatchMRSRule { + this := PatchMRSRule{} + return &this +} + +// NewPatchMRSRuleWithDefaults instantiates a new PatchMRSRule 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 NewPatchMRSRuleWithDefaults() *PatchMRSRule { + this := PatchMRSRule{} + return &this +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchMRSRule) GetMode() Mode1 { + if o == nil || IsNil(o.Mode) { + var ret Mode1 + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchMRSRule) GetModeOk() (*Mode1, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchMRSRule) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given Mode1 and assigns it to the Mode field. +func (o *PatchMRSRule) SetMode(v Mode1) { + o.Mode = &v +} + +func (o PatchMRSRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchMRSRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchMRSRule) UnmarshalJSON(data []byte) (err error) { + varPatchMRSRule := _PatchMRSRule{} + + err = json.Unmarshal(data, &varPatchMRSRule) + + if err != nil { + return err + } + + *o = PatchMRSRule(varPatchMRSRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchMRSRule struct { + value *PatchMRSRule + isSet bool +} + +func (v NullablePatchMRSRule) Get() *PatchMRSRule { + return v.value +} + +func (v *NullablePatchMRSRule) Set(val *PatchMRSRule) { + v.value = val + v.isSet = true +} + +func (v NullablePatchMRSRule) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchMRSRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchMRSRule(val *PatchMRSRule) *NullablePatchMRSRule { + return &NullablePatchMRSRule{value: val, isSet: true} +} + +func (v NullablePatchMRSRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchMRSRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_patch_mrs_rule_group.go b/services/albwaf/v1betaapi/model_patch_mrs_rule_group.go new file mode 100644 index 000000000..05fc95785 --- /dev/null +++ b/services/albwaf/v1betaapi/model_patch_mrs_rule_group.go @@ -0,0 +1,153 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchMRSRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchMRSRuleGroup{} + +// PatchMRSRuleGroup struct for PatchMRSRuleGroup +type PatchMRSRuleGroup struct { + Rules *map[string]PatchMRSRule `json:"rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchMRSRuleGroup PatchMRSRuleGroup + +// NewPatchMRSRuleGroup instantiates a new PatchMRSRuleGroup 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 NewPatchMRSRuleGroup() *PatchMRSRuleGroup { + this := PatchMRSRuleGroup{} + return &this +} + +// NewPatchMRSRuleGroupWithDefaults instantiates a new PatchMRSRuleGroup 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 NewPatchMRSRuleGroupWithDefaults() *PatchMRSRuleGroup { + this := PatchMRSRuleGroup{} + return &this +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *PatchMRSRuleGroup) GetRules() map[string]PatchMRSRule { + if o == nil || IsNil(o.Rules) { + var ret map[string]PatchMRSRule + 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 *PatchMRSRuleGroup) GetRulesOk() (*map[string]PatchMRSRule, 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 *PatchMRSRuleGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given map[string]PatchMRSRule and assigns it to the Rules field. +func (o *PatchMRSRuleGroup) SetRules(v map[string]PatchMRSRule) { + o.Rules = &v +} + +func (o PatchMRSRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchMRSRuleGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchMRSRuleGroup) UnmarshalJSON(data []byte) (err error) { + varPatchMRSRuleGroup := _PatchMRSRuleGroup{} + + err = json.Unmarshal(data, &varPatchMRSRuleGroup) + + if err != nil { + return err + } + + *o = PatchMRSRuleGroup(varPatchMRSRuleGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchMRSRuleGroup struct { + value *PatchMRSRuleGroup + isSet bool +} + +func (v NullablePatchMRSRuleGroup) Get() *PatchMRSRuleGroup { + return v.value +} + +func (v *NullablePatchMRSRuleGroup) Set(val *PatchMRSRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullablePatchMRSRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchMRSRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchMRSRuleGroup(val *PatchMRSRuleGroup) *NullablePatchMRSRuleGroup { + return &NullablePatchMRSRuleGroup{value: val, isSet: true} +} + +func (v NullablePatchMRSRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchMRSRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_quotas.go b/services/albwaf/v1betaapi/model_quotas.go new file mode 100644 index 000000000..df1f2a8c2 --- /dev/null +++ b/services/albwaf/v1betaapi/model_quotas.go @@ -0,0 +1,227 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the Quotas type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Quotas{} + +// Quotas Quotas holds the specific quota elements for different resources +type Quotas struct { + CustomRuleGroup *CRGConfigQuota `json:"customRuleGroup,omitempty"` + ManagedRuleSet *MRSConfigQuota `json:"managedRuleSet,omitempty"` + WebApplicationFirewall *WAFConfigQuota `json:"webApplicationFirewall,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Quotas Quotas + +// NewQuotas instantiates a new Quotas 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 NewQuotas() *Quotas { + this := Quotas{} + return &this +} + +// NewQuotasWithDefaults instantiates a new Quotas 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 NewQuotasWithDefaults() *Quotas { + this := Quotas{} + return &this +} + +// GetCustomRuleGroup returns the CustomRuleGroup field value if set, zero value otherwise. +func (o *Quotas) GetCustomRuleGroup() CRGConfigQuota { + if o == nil || IsNil(o.CustomRuleGroup) { + var ret CRGConfigQuota + return ret + } + return *o.CustomRuleGroup +} + +// GetCustomRuleGroupOk returns a tuple with the CustomRuleGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Quotas) GetCustomRuleGroupOk() (*CRGConfigQuota, bool) { + if o == nil || IsNil(o.CustomRuleGroup) { + return nil, false + } + return o.CustomRuleGroup, true +} + +// HasCustomRuleGroup returns a boolean if a field has been set. +func (o *Quotas) HasCustomRuleGroup() bool { + if o != nil && !IsNil(o.CustomRuleGroup) { + return true + } + + return false +} + +// SetCustomRuleGroup gets a reference to the given CRGConfigQuota and assigns it to the CustomRuleGroup field. +func (o *Quotas) SetCustomRuleGroup(v CRGConfigQuota) { + o.CustomRuleGroup = &v +} + +// GetManagedRuleSet returns the ManagedRuleSet field value if set, zero value otherwise. +func (o *Quotas) GetManagedRuleSet() MRSConfigQuota { + if o == nil || IsNil(o.ManagedRuleSet) { + var ret MRSConfigQuota + return ret + } + return *o.ManagedRuleSet +} + +// GetManagedRuleSetOk returns a tuple with the ManagedRuleSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Quotas) GetManagedRuleSetOk() (*MRSConfigQuota, bool) { + if o == nil || IsNil(o.ManagedRuleSet) { + return nil, false + } + return o.ManagedRuleSet, true +} + +// HasManagedRuleSet returns a boolean if a field has been set. +func (o *Quotas) HasManagedRuleSet() bool { + if o != nil && !IsNil(o.ManagedRuleSet) { + return true + } + + return false +} + +// SetManagedRuleSet gets a reference to the given MRSConfigQuota and assigns it to the ManagedRuleSet field. +func (o *Quotas) SetManagedRuleSet(v MRSConfigQuota) { + o.ManagedRuleSet = &v +} + +// GetWebApplicationFirewall returns the WebApplicationFirewall field value if set, zero value otherwise. +func (o *Quotas) GetWebApplicationFirewall() WAFConfigQuota { + if o == nil || IsNil(o.WebApplicationFirewall) { + var ret WAFConfigQuota + return ret + } + return *o.WebApplicationFirewall +} + +// GetWebApplicationFirewallOk returns a tuple with the WebApplicationFirewall field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Quotas) GetWebApplicationFirewallOk() (*WAFConfigQuota, bool) { + if o == nil || IsNil(o.WebApplicationFirewall) { + return nil, false + } + return o.WebApplicationFirewall, true +} + +// HasWebApplicationFirewall returns a boolean if a field has been set. +func (o *Quotas) HasWebApplicationFirewall() bool { + if o != nil && !IsNil(o.WebApplicationFirewall) { + return true + } + + return false +} + +// SetWebApplicationFirewall gets a reference to the given WAFConfigQuota and assigns it to the WebApplicationFirewall field. +func (o *Quotas) SetWebApplicationFirewall(v WAFConfigQuota) { + o.WebApplicationFirewall = &v +} + +func (o Quotas) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Quotas) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomRuleGroup) { + toSerialize["customRuleGroup"] = o.CustomRuleGroup + } + if !IsNil(o.ManagedRuleSet) { + toSerialize["managedRuleSet"] = o.ManagedRuleSet + } + if !IsNil(o.WebApplicationFirewall) { + toSerialize["webApplicationFirewall"] = o.WebApplicationFirewall + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Quotas) UnmarshalJSON(data []byte) (err error) { + varQuotas := _Quotas{} + + err = json.Unmarshal(data, &varQuotas) + + if err != nil { + return err + } + + *o = Quotas(varQuotas) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "customRuleGroup") + delete(additionalProperties, "managedRuleSet") + delete(additionalProperties, "webApplicationFirewall") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableQuotas struct { + value *Quotas + isSet bool +} + +func (v NullableQuotas) Get() *Quotas { + return v.value +} + +func (v *NullableQuotas) Set(val *Quotas) { + v.value = val + v.isSet = true +} + +func (v NullableQuotas) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotas(val *Quotas) *NullableQuotas { + return &NullableQuotas{value: val, isSet: true} +} + +func (v NullableQuotas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_status.go b/services/albwaf/v1betaapi/model_status.go new file mode 100644 index 000000000..7dfdb20fc --- /dev/null +++ b/services/albwaf/v1betaapi/model_status.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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the Status type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Status{} + +// Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). +type Status struct { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + Code *int32 `json:"code,omitempty"` + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + Details []GoogleProtobufAny `json:"details,omitempty"` + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Status Status + +// NewStatus instantiates a new Status 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 NewStatus() *Status { + this := Status{} + return &this +} + +// NewStatusWithDefaults instantiates a new Status 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 NewStatusWithDefaults() *Status { + this := Status{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Status) GetCode() int32 { + if o == nil || IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Status) GetCodeOk() (*int32, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Status) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *Status) SetCode(v int32) { + o.Code = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Status) GetDetails() []GoogleProtobufAny { + if o == nil || IsNil(o.Details) { + var ret []GoogleProtobufAny + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Status) GetDetailsOk() ([]GoogleProtobufAny, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Status) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. +func (o *Status) SetDetails(v []GoogleProtobufAny) { + o.Details = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Status) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Status) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *Status) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Status) SetMessage(v string) { + o.Message = &v +} + +func (o Status) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Status) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Status) UnmarshalJSON(data []byte) (err error) { + varStatus := _Status{} + + err = json.Unmarshal(data, &varStatus) + + if err != nil { + return err + } + + *o = Status(varStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "details") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_update_waf_payload.go b/services/albwaf/v1betaapi/model_update_waf_payload.go new file mode 100644 index 000000000..bcb083f29 --- /dev/null +++ b/services/albwaf/v1betaapi/model_update_waf_payload.go @@ -0,0 +1,344 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the UpdateWAFPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateWAFPayload{} + +// UpdateWAFPayload UpdateWAFRequest updates a WAF if rules changed. +type UpdateWAFPayload struct { + // Name of the CRG configuration for that WAF. + CustomRuleGroupName *string `json:"customRuleGroupName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Labels represent user-defined metadata as key-value pairs. Label count should not exceed 64 per WAF. **Key Formatting Rules:** Length: 1-63 characters. Characters: Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. Keys starting with 'stackit-' are system-reserved; users MUST NOT manage them. **Value Formatting Rules:** Length: 0-63 characters (empty string explicitly allowed). Characters (for non-empty values): Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. + Labels *map[string]string `json:"labels,omitempty"` + // Name of the managed rule set configuration for that WAF. + ManagedRuleSetName *string `json:"managedRuleSetName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // WAF name + Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` + // Project identifier + ProjectId *string `json:"projectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + // Region + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + AdditionalProperties map[string]interface{} +} + +type _UpdateWAFPayload UpdateWAFPayload + +// NewUpdateWAFPayload instantiates a new UpdateWAFPayload 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 NewUpdateWAFPayload() *UpdateWAFPayload { + this := UpdateWAFPayload{} + return &this +} + +// NewUpdateWAFPayloadWithDefaults instantiates a new UpdateWAFPayload 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 NewUpdateWAFPayloadWithDefaults() *UpdateWAFPayload { + this := UpdateWAFPayload{} + return &this +} + +// GetCustomRuleGroupName returns the CustomRuleGroupName field value if set, zero value otherwise. +func (o *UpdateWAFPayload) GetCustomRuleGroupName() string { + if o == nil || IsNil(o.CustomRuleGroupName) { + var ret string + return ret + } + return *o.CustomRuleGroupName +} + +// GetCustomRuleGroupNameOk returns a tuple with the CustomRuleGroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateWAFPayload) GetCustomRuleGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.CustomRuleGroupName) { + return nil, false + } + return o.CustomRuleGroupName, true +} + +// HasCustomRuleGroupName returns a boolean if a field has been set. +func (o *UpdateWAFPayload) HasCustomRuleGroupName() bool { + if o != nil && !IsNil(o.CustomRuleGroupName) { + return true + } + + return false +} + +// SetCustomRuleGroupName gets a reference to the given string and assigns it to the CustomRuleGroupName field. +func (o *UpdateWAFPayload) SetCustomRuleGroupName(v string) { + o.CustomRuleGroupName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateWAFPayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// 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 *UpdateWAFPayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateWAFPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateWAFPayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetManagedRuleSetName returns the ManagedRuleSetName field value if set, zero value otherwise. +func (o *UpdateWAFPayload) GetManagedRuleSetName() string { + if o == nil || IsNil(o.ManagedRuleSetName) { + var ret string + return ret + } + return *o.ManagedRuleSetName +} + +// GetManagedRuleSetNameOk returns a tuple with the ManagedRuleSetName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateWAFPayload) GetManagedRuleSetNameOk() (*string, bool) { + if o == nil || IsNil(o.ManagedRuleSetName) { + return nil, false + } + return o.ManagedRuleSetName, true +} + +// HasManagedRuleSetName returns a boolean if a field has been set. +func (o *UpdateWAFPayload) HasManagedRuleSetName() bool { + if o != nil && !IsNil(o.ManagedRuleSetName) { + return true + } + + return false +} + +// SetManagedRuleSetName gets a reference to the given string and assigns it to the ManagedRuleSetName field. +func (o *UpdateWAFPayload) SetManagedRuleSetName(v string) { + o.ManagedRuleSetName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateWAFPayload) 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 *UpdateWAFPayload) 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 *UpdateWAFPayload) 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 *UpdateWAFPayload) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *UpdateWAFPayload) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateWAFPayload) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *UpdateWAFPayload) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *UpdateWAFPayload) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *UpdateWAFPayload) 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 *UpdateWAFPayload) 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 *UpdateWAFPayload) 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 *UpdateWAFPayload) SetRegion(v string) { + o.Region = &v +} + +func (o UpdateWAFPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateWAFPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomRuleGroupName) { + toSerialize["customRuleGroupName"] = o.CustomRuleGroupName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.ManagedRuleSetName) { + toSerialize["managedRuleSetName"] = o.ManagedRuleSetName + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["projectId"] = o.ProjectId + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateWAFPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateWAFPayload := _UpdateWAFPayload{} + + err = json.Unmarshal(data, &varUpdateWAFPayload) + + if err != nil { + return err + } + + *o = UpdateWAFPayload(varUpdateWAFPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "customRuleGroupName") + delete(additionalProperties, "labels") + delete(additionalProperties, "managedRuleSetName") + delete(additionalProperties, "name") + delete(additionalProperties, "projectId") + delete(additionalProperties, "region") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateWAFPayload struct { + value *UpdateWAFPayload + isSet bool +} + +func (v NullableUpdateWAFPayload) Get() *UpdateWAFPayload { + return v.value +} + +func (v *NullableUpdateWAFPayload) Set(val *UpdateWAFPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateWAFPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateWAFPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateWAFPayload(val *UpdateWAFPayload) *NullableUpdateWAFPayload { + return &NullableUpdateWAFPayload{value: val, isSet: true} +} + +func (v NullableUpdateWAFPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateWAFPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_waf_config_quota.go b/services/albwaf/v1betaapi/model_waf_config_quota.go new file mode 100644 index 000000000..ad19904c2 --- /dev/null +++ b/services/albwaf/v1betaapi/model_waf_config_quota.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the WAFConfigQuota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFConfigQuota{} + +// WAFConfigQuota WAF Config quota holds the limit and usage for Web Application Firewall configuration resources +type WAFConfigQuota struct { + // The maximum number of Web Application Firewall configurations in this project. + Limit *int32 `json:"limit,omitempty"` + // The number of Web Application Firewall configurations that are currently existing in this project. + Usage *int32 `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WAFConfigQuota WAFConfigQuota + +// NewWAFConfigQuota instantiates a new WAFConfigQuota 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 NewWAFConfigQuota() *WAFConfigQuota { + this := WAFConfigQuota{} + return &this +} + +// NewWAFConfigQuotaWithDefaults instantiates a new WAFConfigQuota 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 NewWAFConfigQuotaWithDefaults() *WAFConfigQuota { + this := WAFConfigQuota{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *WAFConfigQuota) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFConfigQuota) GetLimitOk() (*int32, bool) { + if o == nil || IsNil(o.Limit) { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *WAFConfigQuota) HasLimit() bool { + if o != nil && !IsNil(o.Limit) { + return true + } + + return false +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *WAFConfigQuota) SetLimit(v int32) { + o.Limit = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *WAFConfigQuota) GetUsage() int32 { + if o == nil || IsNil(o.Usage) { + var ret int32 + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFConfigQuota) GetUsageOk() (*int32, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *WAFConfigQuota) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given int32 and assigns it to the Usage field. +func (o *WAFConfigQuota) SetUsage(v int32) { + o.Usage = &v +} + +func (o WAFConfigQuota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFConfigQuota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Limit) { + toSerialize["limit"] = o.Limit + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WAFConfigQuota) UnmarshalJSON(data []byte) (err error) { + varWAFConfigQuota := _WAFConfigQuota{} + + err = json.Unmarshal(data, &varWAFConfigQuota) + + if err != nil { + return err + } + + *o = WAFConfigQuota(varWAFConfigQuota) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "limit") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWAFConfigQuota struct { + value *WAFConfigQuota + isSet bool +} + +func (v NullableWAFConfigQuota) Get() *WAFConfigQuota { + return v.value +} + +func (v *NullableWAFConfigQuota) Set(val *WAFConfigQuota) { + v.value = val + v.isSet = true +} + +func (v NullableWAFConfigQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFConfigQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFConfigQuota(val *WAFConfigQuota) *NullableWAFConfigQuota { + return &NullableWAFConfigQuota{value: val, isSet: true} +} + +func (v NullableWAFConfigQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFConfigQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_waf_usage.go b/services/albwaf/v1betaapi/model_waf_usage.go new file mode 100644 index 000000000..f36a4ccd9 --- /dev/null +++ b/services/albwaf/v1betaapi/model_waf_usage.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the WAFUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFUsage{} + +// WAFUsage struct for WAFUsage +type WAFUsage struct { + // Number of listeners using this WAF configuration. + Count *int32 `json:"count,omitempty"` + // List of Application Load Balancers with their associated listeners that use this WAF configuration. + Items []WAFUsageItem `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WAFUsage WAFUsage + +// NewWAFUsage instantiates a new WAFUsage 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 NewWAFUsage() *WAFUsage { + this := WAFUsage{} + return &this +} + +// NewWAFUsageWithDefaults instantiates a new WAFUsage 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 NewWAFUsageWithDefaults() *WAFUsage { + this := WAFUsage{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *WAFUsage) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFUsage) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *WAFUsage) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *WAFUsage) SetCount(v int32) { + o.Count = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *WAFUsage) GetItems() []WAFUsageItem { + if o == nil || IsNil(o.Items) { + var ret []WAFUsageItem + return ret + } + return o.Items +} + +// 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 *WAFUsage) GetItemsOk() ([]WAFUsageItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *WAFUsage) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []WAFUsageItem and assigns it to the Items field. +func (o *WAFUsage) SetItems(v []WAFUsageItem) { + o.Items = v +} + +func (o WAFUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WAFUsage) UnmarshalJSON(data []byte) (err error) { + varWAFUsage := _WAFUsage{} + + err = json.Unmarshal(data, &varWAFUsage) + + if err != nil { + return err + } + + *o = WAFUsage(varWAFUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWAFUsage struct { + value *WAFUsage + isSet bool +} + +func (v NullableWAFUsage) Get() *WAFUsage { + return v.value +} + +func (v *NullableWAFUsage) Set(val *WAFUsage) { + v.value = val + v.isSet = true +} + +func (v NullableWAFUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFUsage(val *WAFUsage) *NullableWAFUsage { + return &NullableWAFUsage{value: val, isSet: true} +} + +func (v NullableWAFUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/model_waf_usage_item.go b/services/albwaf/v1betaapi/model_waf_usage_item.go new file mode 100644 index 000000000..9f7fee4b4 --- /dev/null +++ b/services/albwaf/v1betaapi/model_waf_usage_item.go @@ -0,0 +1,192 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the WAFUsageItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFUsageItem{} + +// WAFUsageItem struct for WAFUsageItem +type WAFUsageItem struct { + // The list of listener names in this Load Balancer, that are using the WAF. + ListenerNames []string `json:"listenerNames,omitempty"` + // The display name of the Load Balancer. + LoadBalancerName *string `json:"loadBalancerName,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WAFUsageItem WAFUsageItem + +// NewWAFUsageItem instantiates a new WAFUsageItem 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 NewWAFUsageItem() *WAFUsageItem { + this := WAFUsageItem{} + return &this +} + +// NewWAFUsageItemWithDefaults instantiates a new WAFUsageItem 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 NewWAFUsageItemWithDefaults() *WAFUsageItem { + this := WAFUsageItem{} + return &this +} + +// GetListenerNames returns the ListenerNames field value if set, zero value otherwise. +func (o *WAFUsageItem) GetListenerNames() []string { + if o == nil || IsNil(o.ListenerNames) { + var ret []string + return ret + } + return o.ListenerNames +} + +// GetListenerNamesOk returns a tuple with the ListenerNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFUsageItem) GetListenerNamesOk() ([]string, bool) { + if o == nil || IsNil(o.ListenerNames) { + return nil, false + } + return o.ListenerNames, true +} + +// HasListenerNames returns a boolean if a field has been set. +func (o *WAFUsageItem) HasListenerNames() bool { + if o != nil && !IsNil(o.ListenerNames) { + return true + } + + return false +} + +// SetListenerNames gets a reference to the given []string and assigns it to the ListenerNames field. +func (o *WAFUsageItem) SetListenerNames(v []string) { + o.ListenerNames = v +} + +// GetLoadBalancerName returns the LoadBalancerName field value if set, zero value otherwise. +func (o *WAFUsageItem) GetLoadBalancerName() string { + if o == nil || IsNil(o.LoadBalancerName) { + var ret string + return ret + } + return *o.LoadBalancerName +} + +// GetLoadBalancerNameOk returns a tuple with the LoadBalancerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFUsageItem) GetLoadBalancerNameOk() (*string, bool) { + if o == nil || IsNil(o.LoadBalancerName) { + return nil, false + } + return o.LoadBalancerName, true +} + +// HasLoadBalancerName returns a boolean if a field has been set. +func (o *WAFUsageItem) HasLoadBalancerName() bool { + if o != nil && !IsNil(o.LoadBalancerName) { + return true + } + + return false +} + +// SetLoadBalancerName gets a reference to the given string and assigns it to the LoadBalancerName field. +func (o *WAFUsageItem) SetLoadBalancerName(v string) { + o.LoadBalancerName = &v +} + +func (o WAFUsageItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFUsageItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ListenerNames) { + toSerialize["listenerNames"] = o.ListenerNames + } + if !IsNil(o.LoadBalancerName) { + toSerialize["loadBalancerName"] = o.LoadBalancerName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WAFUsageItem) UnmarshalJSON(data []byte) (err error) { + varWAFUsageItem := _WAFUsageItem{} + + err = json.Unmarshal(data, &varWAFUsageItem) + + if err != nil { + return err + } + + *o = WAFUsageItem(varWAFUsageItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "listenerNames") + delete(additionalProperties, "loadBalancerName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWAFUsageItem struct { + value *WAFUsageItem + isSet bool +} + +func (v NullableWAFUsageItem) Get() *WAFUsageItem { + return v.value +} + +func (v *NullableWAFUsageItem) Set(val *WAFUsageItem) { + v.value = val + v.isSet = true +} + +func (v NullableWAFUsageItem) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFUsageItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFUsageItem(val *WAFUsageItem) *NullableWAFUsageItem { + return &NullableWAFUsageItem{value: val, isSet: true} +} + +func (v NullableWAFUsageItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFUsageItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1betaapi/response.go b/services/albwaf/v1betaapi/response.go new file mode 100644 index 000000000..1f444470d --- /dev/null +++ b/services/albwaf/v1betaapi/response.go @@ -0,0 +1,47 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/albwaf/v1betaapi/utils.go b/services/albwaf/v1betaapi/utils.go new file mode 100644 index 000000000..6d7f4b799 --- /dev/null +++ b/services/albwaf/v1betaapi/utils.go @@ -0,0 +1,361 @@ +/* +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 Managed Rule Set (MRS) and in addition can have Custom Rule Group (CRG). 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: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +}