diff --git a/services/albwaf/oas_commit b/services/albwaf/oas_commit index 7432e1eed..0f8ce352b 100644 --- a/services/albwaf/oas_commit +++ b/services/albwaf/oas_commit @@ -1 +1 @@ -d7306ee5d2400a8571c390a29df8ffd02428182f +876a48fb56473c7c844baa697906d461c0675f47 diff --git a/services/albwaf/v1alphaapi/api_default.go b/services/albwaf/v1alphaapi/api_default.go index df82ec110..9bb552d4a 100644 --- a/services/albwaf/v1alphaapi/api_default.go +++ b/services/albwaf/v1alphaapi/api_default.go @@ -23,63 +23,6 @@ import ( type DefaultAPI interface { - /* - CreateCoreRuleSet Create a CRS configuration - - With this endpoint a core rule set (CRS) 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 ApiCreateCoreRuleSetRequest - - Deprecated - */ - CreateCoreRuleSet(ctx context.Context, projectId string, region string) ApiCreateCoreRuleSetRequest - - // CreateCoreRuleSetExecute executes the request - // @return GetCoreRuleSetResponse - // Deprecated - CreateCoreRuleSetExecute(r ApiCreateCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) - - /* - CreateRules Create a rule configuration - - With this endpoint a rule configuration is created and stored in this project. The rules are written in Seclang. 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. There is a limit of 1 MB of data on these rules. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param region - @return ApiCreateRulesRequest - - Deprecated - */ - CreateRules(ctx context.Context, projectId string, region string) ApiCreateRulesRequest - - // CreateRulesExecute executes the request - // @return CreateRulesResponse - // Deprecated - CreateRulesExecute(r ApiCreateRulesRequest) (*CreateRulesResponse, 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 core 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 - - Deprecated - */ - CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest - - // CreateWAFExecute executes the request - // @return CreateWAFResponse - // Deprecated - CreateWAFExecute(r ApiCreateWAFRequest) (*CreateWAFResponse, error) - /* DeleteCoreRuleSet Delete a CRS configuration @@ -275,160 +218,75 @@ type DefaultAPI interface { // @return ListWAFResponse // Deprecated ListWAFExecute(r ApiListWAFRequest) (*ListWAFResponse, error) - - /* - PatchCoreRuleSet Granularly update a CRS 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 ApiPatchCoreRuleSetRequest - - Deprecated - */ - PatchCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchCoreRuleSetRequest - - // PatchCoreRuleSetExecute executes the request - // @return GetCoreRuleSetResponse - // Deprecated - PatchCoreRuleSetExecute(r ApiPatchCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) - - /* - UpdateCoreRuleSet Update a CRS configuration - - DEPRECATED: Use PatchCoreRuleSet - - @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 ApiUpdateCoreRuleSetRequest - - Deprecated - */ - UpdateCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiUpdateCoreRuleSetRequest - - // UpdateCoreRuleSetExecute executes the request - // @return UpdateCoreRuleSetResponse - // Deprecated - UpdateCoreRuleSetExecute(r ApiUpdateCoreRuleSetRequest) (*UpdateCoreRuleSetResponse, error) - - /* - UpdateRules Update a rule configuration - - This endpoint will update an existing rules configuration and also inturn update all WAF configurations that reference it. There is a limit of 1 MB of data on these rules. - - @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 ApiUpdateRulesRequest - - Deprecated - */ - UpdateRules(ctx context.Context, projectId string, region string, name string) ApiUpdateRulesRequest - - // UpdateRulesExecute executes the request - // @return UpdateRulesResponse - // Deprecated - UpdateRulesExecute(r ApiUpdateRulesRequest) (*UpdateRulesResponse, 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 - - Deprecated - */ - UpdateWAF(ctx context.Context, projectId string, region string, name string) ApiUpdateWAFRequest - - // UpdateWAFExecute executes the request - // @return UpdateWAFResponse - // Deprecated - UpdateWAFExecute(r ApiUpdateWAFRequest) (*UpdateWAFResponse, error) } // DefaultAPIService DefaultAPI service type DefaultAPIService service -type ApiCreateCoreRuleSetRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - createCoreRuleSetPayload *CreateCoreRuleSetPayload -} - -func (r ApiCreateCoreRuleSetRequest) CreateCoreRuleSetPayload(createCoreRuleSetPayload CreateCoreRuleSetPayload) ApiCreateCoreRuleSetRequest { - r.createCoreRuleSetPayload = &createCoreRuleSetPayload - return r +type ApiDeleteCoreRuleSetRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string } -func (r ApiCreateCoreRuleSetRequest) Execute() (*GetCoreRuleSetResponse, error) { - return r.ApiService.CreateCoreRuleSetExecute(r) +func (r ApiDeleteCoreRuleSetRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteCoreRuleSetExecute(r) } /* -CreateCoreRuleSet Create a CRS configuration +DeleteCoreRuleSet Delete a CRS configuration -With this endpoint a core rule set (CRS) 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. +To delete a core rule set (CRS) 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 - @return ApiCreateCoreRuleSetRequest + @param name + @return ApiDeleteCoreRuleSetRequest Deprecated */ -func (a *DefaultAPIService) CreateCoreRuleSet(ctx context.Context, projectId string, region string) ApiCreateCoreRuleSetRequest { - return ApiCreateCoreRuleSetRequest{ +func (a *DefaultAPIService) DeleteCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiDeleteCoreRuleSetRequest { + return ApiDeleteCoreRuleSetRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + name: name, } } // Execute executes the request // -// @return GetCoreRuleSetResponse +// @return map[string]interface{} // // Deprecated -func (a *DefaultAPIService) CreateCoreRuleSetExecute(r ApiCreateCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { +func (a *DefaultAPIService) DeleteCoreRuleSetExecute(r ApiDeleteCoreRuleSetRequest) (map[string]interface{}, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCoreRuleSetResponse + localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCoreRuleSet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCoreRuleSet") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-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.createCoreRuleSetPayload == nil { - return localVarReturnValue, reportError("createCoreRuleSetPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -444,8 +302,6 @@ func (a *DefaultAPIService) CreateCoreRuleSetExecute(r ApiCreateCoreRuleSetReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createCoreRuleSetPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -513,75 +369,70 @@ func (a *DefaultAPIService) CreateCoreRuleSetExecute(r ApiCreateCoreRuleSetReque return localVarReturnValue, nil } -type ApiCreateRulesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - createRulesPayload *CreateRulesPayload -} - -func (r ApiCreateRulesRequest) CreateRulesPayload(createRulesPayload CreateRulesPayload) ApiCreateRulesRequest { - r.createRulesPayload = &createRulesPayload - return r +type ApiDeleteRulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string } -func (r ApiCreateRulesRequest) Execute() (*CreateRulesResponse, error) { - return r.ApiService.CreateRulesExecute(r) +func (r ApiDeleteRulesRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteRulesExecute(r) } /* -CreateRules Create a rule configuration +DeleteRules Delete a rule configuration -With this endpoint a rule configuration is created and stored in this project. The rules are written in Seclang. 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. There is a limit of 1 MB of data on these rules. +To delete a rule 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 - @return ApiCreateRulesRequest + @param name + @return ApiDeleteRulesRequest Deprecated */ -func (a *DefaultAPIService) CreateRules(ctx context.Context, projectId string, region string) ApiCreateRulesRequest { - return ApiCreateRulesRequest{ +func (a *DefaultAPIService) DeleteRules(ctx context.Context, projectId string, region string, name string) ApiDeleteRulesRequest { + return ApiDeleteRulesRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + name: name, } } // Execute executes the request // -// @return CreateRulesResponse +// @return map[string]interface{} // // Deprecated -func (a *DefaultAPIService) CreateRulesExecute(r ApiCreateRulesRequest) (*CreateRulesResponse, error) { +func (a *DefaultAPIService) DeleteRulesExecute(r ApiDeleteRulesRequest) (map[string]interface{}, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CreateRulesResponse + localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateRules") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules/{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.createRulesPayload == nil { - return localVarReturnValue, reportError("createRulesPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -597,8 +448,6 @@ func (a *DefaultAPIService) CreateRulesExecute(r ApiCreateRulesRequest) (*Create if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createRulesPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -666,75 +515,70 @@ func (a *DefaultAPIService) CreateRulesExecute(r ApiCreateRulesRequest) (*Create 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 +type ApiDeleteWAFRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + name string } -func (r ApiCreateWAFRequest) Execute() (*CreateWAFResponse, error) { - return r.ApiService.CreateWAFExecute(r) +func (r ApiDeleteWAFRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteWAFExecute(r) } /* -CreateWAF Create a WAF configuration +DeleteWAF Delete 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 core 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. +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 - @return ApiCreateWAFRequest + @param name + @return ApiDeleteWAFRequest Deprecated */ -func (a *DefaultAPIService) CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest { - return ApiCreateWAFRequest{ +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 CreateWAFResponse +// @return map[string]interface{} // // Deprecated -func (a *DefaultAPIService) CreateWAFExecute(r ApiCreateWAFRequest) (*CreateWAFResponse, error) { +func (a *DefaultAPIService) DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string]interface{}, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *CreateWAFResponse + localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateWAF") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteWAF") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/wafs" + localVarPath := localBasePath + "/v1alpha/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.createWAFPayload == nil { - return localVarReturnValue, reportError("createWAFPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -750,8 +594,6 @@ func (a *DefaultAPIService) CreateWAFExecute(r ApiCreateWAFRequest) (*CreateWAFR 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 @@ -819,7 +661,7 @@ func (a *DefaultAPIService) CreateWAFExecute(r ApiCreateWAFRequest) (*CreateWAFR return localVarReturnValue, nil } -type ApiDeleteCoreRuleSetRequest struct { +type ApiGetCoreRuleSetRequest struct { ctx context.Context ApiService DefaultAPI projectId string @@ -827,25 +669,25 @@ type ApiDeleteCoreRuleSetRequest struct { name string } -func (r ApiDeleteCoreRuleSetRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.DeleteCoreRuleSetExecute(r) +func (r ApiGetCoreRuleSetRequest) Execute() (*GetCoreRuleSetResponse, error) { + return r.ApiService.GetCoreRuleSetExecute(r) } /* -DeleteCoreRuleSet Delete a CRS configuration +GetCoreRuleSet Retrieve a CRS configuration -To delete a core rule set (CRS) configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. +To retrieve an existing core rule set (CRS) 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 ApiDeleteCoreRuleSetRequest + @return ApiGetCoreRuleSetRequest Deprecated */ -func (a *DefaultAPIService) DeleteCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiDeleteCoreRuleSetRequest { - return ApiDeleteCoreRuleSetRequest{ +func (a *DefaultAPIService) GetCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiGetCoreRuleSetRequest { + return ApiGetCoreRuleSetRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -856,18 +698,18 @@ func (a *DefaultAPIService) DeleteCoreRuleSet(ctx context.Context, projectId str // Execute executes the request // -// @return map[string]interface{} +// @return GetCoreRuleSetResponse // // Deprecated -func (a *DefaultAPIService) DeleteCoreRuleSetExecute(r ApiDeleteCoreRuleSetRequest) (map[string]interface{}, error) { +func (a *DefaultAPIService) GetCoreRuleSetExecute(r ApiGetCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *GetCoreRuleSetResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCoreRuleSet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCoreRuleSet") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -965,63 +807,59 @@ func (a *DefaultAPIService) DeleteCoreRuleSetExecute(r ApiDeleteCoreRuleSetReque return localVarReturnValue, nil } -type ApiDeleteRulesRequest struct { +type ApiGetQuotaRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - name string } -func (r ApiDeleteRulesRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.DeleteRulesExecute(r) +func (r ApiGetQuotaRequest) Execute() (*GetQuotaResponse, error) { + return r.ApiService.GetQuotaExecute(r) } /* -DeleteRules Delete a rule configuration +GetQuota Get the quota for WAF resources in a project. -To delete a rule configuration this endpoint is used, but it is only possible to delete it if no WAF configuration is referencing it. +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 - @param name - @return ApiDeleteRulesRequest + @return ApiGetQuotaRequest Deprecated */ -func (a *DefaultAPIService) DeleteRules(ctx context.Context, projectId string, region string, name string) ApiDeleteRulesRequest { - return ApiDeleteRulesRequest{ +func (a *DefaultAPIService) GetQuota(ctx context.Context, projectId string, region string) ApiGetQuotaRequest { + return ApiGetQuotaRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - name: name, } } // Execute executes the request // -// @return map[string]interface{} +// @return GetQuotaResponse // // Deprecated -func (a *DefaultAPIService) DeleteRulesExecute(r ApiDeleteRulesRequest) (map[string]interface{}, error) { +func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *GetQuotaResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRules") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetQuota") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules/{name}" + localVarPath := localBasePath + "/v1alpha/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) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(parameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1037,7 +875,7 @@ func (a *DefaultAPIService) DeleteRulesExecute(r ApiDeleteRulesRequest) (map[str } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1077,7 +915,7 @@ func (a *DefaultAPIService) DeleteRulesExecute(r ApiDeleteRulesRequest) (map[str StatusCode: localVarHTTPResponse.StatusCode, } if localVarHTTPResponse.StatusCode == 401 { - var v Status + var v string err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1111,7 +949,7 @@ func (a *DefaultAPIService) DeleteRulesExecute(r ApiDeleteRulesRequest) (map[str return localVarReturnValue, nil } -type ApiDeleteWAFRequest struct { +type ApiGetRulesRequest struct { ctx context.Context ApiService DefaultAPI projectId string @@ -1119,25 +957,25 @@ type ApiDeleteWAFRequest struct { name string } -func (r ApiDeleteWAFRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.DeleteWAFExecute(r) +func (r ApiGetRulesRequest) Execute() (*GetRulesResponse, error) { + return r.ApiService.GetRulesExecute(r) } /* -DeleteWAF Delete a WAF configuration +GetRules Retrieve a rule configuration -This will delete the specified WAF configuration, but only if it is not used by any Application Load Balancer in the project. +To retrieve an existing rule 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 ApiDeleteWAFRequest + @return ApiGetRulesRequest Deprecated */ -func (a *DefaultAPIService) DeleteWAF(ctx context.Context, projectId string, region string, name string) ApiDeleteWAFRequest { - return ApiDeleteWAFRequest{ +func (a *DefaultAPIService) GetRules(ctx context.Context, projectId string, region string, name string) ApiGetRulesRequest { + return ApiGetRulesRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -1148,23 +986,23 @@ func (a *DefaultAPIService) DeleteWAF(ctx context.Context, projectId string, reg // Execute executes the request // -// @return map[string]interface{} +// @return GetRulesResponse // // Deprecated -func (a *DefaultAPIService) DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string]interface{}, error) { +func (a *DefaultAPIService) GetRulesExecute(r ApiGetRulesRequest) (*GetRulesResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *GetRulesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteWAF") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/wafs/{name}" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules/{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) @@ -1257,7 +1095,7 @@ func (a *DefaultAPIService) DeleteWAFExecute(r ApiDeleteWAFRequest) (map[string] return localVarReturnValue, nil } -type ApiGetCoreRuleSetRequest struct { +type ApiGetWAFRequest struct { ctx context.Context ApiService DefaultAPI projectId string @@ -1265,25 +1103,25 @@ type ApiGetCoreRuleSetRequest struct { name string } -func (r ApiGetCoreRuleSetRequest) Execute() (*GetCoreRuleSetResponse, error) { - return r.ApiService.GetCoreRuleSetExecute(r) +func (r ApiGetWAFRequest) Execute() (*GetWAFResponse, error) { + return r.ApiService.GetWAFExecute(r) } /* -GetCoreRuleSet Retrieve a CRS configuration +GetWAF Retrieve a WAF configuration -To retrieve an existing core rule set (CRS) configuration this endpoint can be used. +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 ApiGetCoreRuleSetRequest + @return ApiGetWAFRequest Deprecated */ -func (a *DefaultAPIService) GetCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiGetCoreRuleSetRequest { - return ApiGetCoreRuleSetRequest{ +func (a *DefaultAPIService) GetWAF(ctx context.Context, projectId string, region string, name string) ApiGetWAFRequest { + return ApiGetWAFRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -1294,23 +1132,23 @@ func (a *DefaultAPIService) GetCoreRuleSet(ctx context.Context, projectId string // Execute executes the request // -// @return GetCoreRuleSetResponse +// @return GetWAFResponse // // Deprecated -func (a *DefaultAPIService) GetCoreRuleSetExecute(r ApiGetCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { +func (a *DefaultAPIService) GetWAFExecute(r ApiGetWAFRequest) (*GetWAFResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCoreRuleSetResponse + localVarReturnValue *GetWAFResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCoreRuleSet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetWAF") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets/{name}" + localVarPath := localBasePath + "/v1alpha/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) @@ -1403,31 +1241,45 @@ func (a *DefaultAPIService) GetCoreRuleSetExecute(r ApiGetCoreRuleSetRequest) (* return localVarReturnValue, nil } -type ApiGetQuotaRequest struct { +type ApiListCoreRuleSetsRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string + pageSize *string + pageId *string } -func (r ApiGetQuotaRequest) Execute() (*GetQuotaResponse, error) { - return r.ApiService.GetQuotaExecute(r) +// page_size specifies how many rule configurations should be returned on this page. Must be a positive number <= 1000 +func (r ApiListCoreRuleSetsRequest) PageSize(pageSize string) ApiListCoreRuleSetsRequest { + 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 ApiListCoreRuleSetsRequest) PageId(pageId string) ApiListCoreRuleSetsRequest { + r.pageId = &pageId + return r +} + +func (r ApiListCoreRuleSetsRequest) Execute() (*ListCoreRuleSetResponse, error) { + return r.ApiService.ListCoreRuleSetsExecute(r) } /* -GetQuota Get the quota for WAF resources in a project. +ListCoreRuleSets List of CRS configurations -Retrieves the configured WAF resource quotas for the project. Limit can be changed via service request. +List all existing core rule set (CRS) 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 ApiGetQuotaRequest + @return ApiListCoreRuleSetsRequest Deprecated */ -func (a *DefaultAPIService) GetQuota(ctx context.Context, projectId string, region string) ApiGetQuotaRequest { - return ApiGetQuotaRequest{ +func (a *DefaultAPIService) ListCoreRuleSets(ctx context.Context, projectId string, region string) ApiListCoreRuleSetsRequest { + return ApiListCoreRuleSetsRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -1437,23 +1289,23 @@ func (a *DefaultAPIService) GetQuota(ctx context.Context, projectId string, regi // Execute executes the request // -// @return GetQuotaResponse +// @return ListCoreRuleSetResponse // // Deprecated -func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResponse, error) { +func (a *DefaultAPIService) ListCoreRuleSetsExecute(r ApiListCoreRuleSetsRequest) (*ListCoreRuleSetResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetQuotaResponse + localVarReturnValue *ListCoreRuleSetResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetQuota") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCoreRuleSets") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/quotas" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-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) @@ -1461,6 +1313,12 @@ func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResp 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{} @@ -1471,7 +1329,7 @@ func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResp } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1511,7 +1369,7 @@ func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResp StatusCode: localVarHTTPResponse.StatusCode, } if localVarHTTPResponse.StatusCode == 401 { - var v string + var v Status err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1545,68 +1403,84 @@ func (a *DefaultAPIService) GetQuotaExecute(r ApiGetQuotaRequest) (*GetQuotaResp return localVarReturnValue, nil } -type ApiGetRulesRequest struct { +type ApiListRulesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - name string + pageSize *string + pageId *string } -func (r ApiGetRulesRequest) Execute() (*GetRulesResponse, error) { - return r.ApiService.GetRulesExecute(r) +// page_size specifies how many rule configurations should be returned on this page. Must be a positive number <= 1000 +func (r ApiListRulesRequest) PageSize(pageSize string) ApiListRulesRequest { + 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 ApiListRulesRequest) PageId(pageId string) ApiListRulesRequest { + r.pageId = &pageId + return r +} + +func (r ApiListRulesRequest) Execute() (*ListRulesResponse, error) { + return r.ApiService.ListRulesExecute(r) } /* -GetRules Retrieve a rule configuration +ListRules List of rule configurations -To retrieve an existing rule configuration this endpoint can be used. +List all existing rule 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 - @param name - @return ApiGetRulesRequest + @return ApiListRulesRequest Deprecated */ -func (a *DefaultAPIService) GetRules(ctx context.Context, projectId string, region string, name string) ApiGetRulesRequest { - return ApiGetRulesRequest{ +func (a *DefaultAPIService) ListRules(ctx context.Context, projectId string, region string) ApiListRulesRequest { + return ApiListRulesRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - name: name, } } // Execute executes the request // -// @return GetRulesResponse +// @return ListRulesResponse // // Deprecated -func (a *DefaultAPIService) GetRulesExecute(r ApiGetRulesRequest) (*GetRulesResponse, error) { +func (a *DefaultAPIService) ListRulesExecute(r ApiListRulesRequest) (*ListRulesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetRulesResponse + localVarReturnValue *ListRulesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRules") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules/{name}" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules" 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.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{} @@ -1691,391 +1565,83 @@ func (a *DefaultAPIService) GetRulesExecute(r ApiGetRulesRequest) (*GetRulesResp return localVarReturnValue, nil } -type ApiGetWAFRequest struct { +type ApiListWAFRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - name string + pageSize *string + pageId *string } -func (r ApiGetWAFRequest) Execute() (*GetWAFResponse, error) { - return r.ApiService.GetWAFExecute(r) +// 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) } /* -GetWAF Retrieve a WAF configuration +ListWAF List of WAF configurations -This endpoint will return the specified WAF configuration. +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 - @param name - @return ApiGetWAFRequest + @return ApiListWAFRequest Deprecated */ -func (a *DefaultAPIService) GetWAF(ctx context.Context, projectId string, region string, name string) ApiGetWAFRequest { - return ApiGetWAFRequest{ +func (a *DefaultAPIService) ListWAF(ctx context.Context, projectId string, region string) ApiListWAFRequest { + return ApiListWAFRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - name: name, } } // Execute executes the request // -// @return GetWAFResponse +// @return ListWAFResponse // // Deprecated -func (a *DefaultAPIService) GetWAFExecute(r ApiGetWAFRequest) (*GetWAFResponse, error) { +func (a *DefaultAPIService) ListWAFExecute(r ApiListWAFRequest) (*ListWAFResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetWAFResponse + localVarReturnValue *ListWAFResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetWAF") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWAF") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/wafs/{name}" + localVarPath := localBasePath + "/v1alpha/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) - 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 r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") } - - 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 ApiListCoreRuleSetsRequest 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 ApiListCoreRuleSetsRequest) PageSize(pageSize string) ApiListCoreRuleSetsRequest { - 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 ApiListCoreRuleSetsRequest) PageId(pageId string) ApiListCoreRuleSetsRequest { - r.pageId = &pageId - return r -} - -func (r ApiListCoreRuleSetsRequest) Execute() (*ListCoreRuleSetResponse, error) { - return r.ApiService.ListCoreRuleSetsExecute(r) -} - -/* -ListCoreRuleSets List of CRS configurations - -List all existing core rule set (CRS) 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 ApiListCoreRuleSetsRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListCoreRuleSets(ctx context.Context, projectId string, region string) ApiListCoreRuleSetsRequest { - return ApiListCoreRuleSetsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Execute executes the request -// -// @return ListCoreRuleSetResponse -// -// Deprecated -func (a *DefaultAPIService) ListCoreRuleSetsExecute(r ApiListCoreRuleSetsRequest) (*ListCoreRuleSetResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListCoreRuleSetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCoreRuleSets") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-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 ApiListRulesRequest 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 ApiListRulesRequest) PageSize(pageSize string) ApiListRulesRequest { - 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 ApiListRulesRequest) PageId(pageId string) ApiListRulesRequest { - r.pageId = &pageId - return r -} - -func (r ApiListRulesRequest) Execute() (*ListRulesResponse, error) { - return r.ApiService.ListRulesExecute(r) -} - -/* -ListRules List of rule configurations - -List all existing rule 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 ApiListRulesRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListRules(ctx context.Context, projectId string, region string) ApiListRulesRequest { - return ApiListRulesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Execute executes the request -// -// @return ListRulesResponse -// -// Deprecated -func (a *DefaultAPIService) ListRulesExecute(r ApiListRulesRequest) (*ListRulesResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListRulesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRules") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules" - 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", "") + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2160,793 +1726,3 @@ func (a *DefaultAPIService) ListRulesExecute(r ApiListRulesRequest) (*ListRulesR 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 - -Deprecated -*/ -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 -// -// Deprecated -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 + "/v1alpha/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 ApiPatchCoreRuleSetRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - name string - patchCoreRuleSetPayload *PatchCoreRuleSetPayload -} - -func (r ApiPatchCoreRuleSetRequest) PatchCoreRuleSetPayload(patchCoreRuleSetPayload PatchCoreRuleSetPayload) ApiPatchCoreRuleSetRequest { - r.patchCoreRuleSetPayload = &patchCoreRuleSetPayload - return r -} - -func (r ApiPatchCoreRuleSetRequest) Execute() (*GetCoreRuleSetResponse, error) { - return r.ApiService.PatchCoreRuleSetExecute(r) -} - -/* -PatchCoreRuleSet Granularly update a CRS 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 ApiPatchCoreRuleSetRequest - -Deprecated -*/ -func (a *DefaultAPIService) PatchCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchCoreRuleSetRequest { - return ApiPatchCoreRuleSetRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Execute executes the request -// -// @return GetCoreRuleSetResponse -// -// Deprecated -func (a *DefaultAPIService) PatchCoreRuleSetExecute(r ApiPatchCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetCoreRuleSetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchCoreRuleSet") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-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.patchCoreRuleSetPayload == nil { - return localVarReturnValue, reportError("patchCoreRuleSetPayload 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.patchCoreRuleSetPayload - 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 ApiUpdateCoreRuleSetRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - name string - updateCoreRuleSetPayload *UpdateCoreRuleSetPayload -} - -func (r ApiUpdateCoreRuleSetRequest) UpdateCoreRuleSetPayload(updateCoreRuleSetPayload UpdateCoreRuleSetPayload) ApiUpdateCoreRuleSetRequest { - r.updateCoreRuleSetPayload = &updateCoreRuleSetPayload - return r -} - -func (r ApiUpdateCoreRuleSetRequest) Execute() (*UpdateCoreRuleSetResponse, error) { - return r.ApiService.UpdateCoreRuleSetExecute(r) -} - -/* -UpdateCoreRuleSet Update a CRS configuration - -DEPRECATED: Use PatchCoreRuleSet - - @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 ApiUpdateCoreRuleSetRequest - -Deprecated -*/ -func (a *DefaultAPIService) UpdateCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiUpdateCoreRuleSetRequest { - return ApiUpdateCoreRuleSetRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Execute executes the request -// -// @return UpdateCoreRuleSetResponse -// -// Deprecated -func (a *DefaultAPIService) UpdateCoreRuleSetExecute(r ApiUpdateCoreRuleSetRequest) (*UpdateCoreRuleSetResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateCoreRuleSetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateCoreRuleSet") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/core-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.updateCoreRuleSetPayload == nil { - return localVarReturnValue, reportError("updateCoreRuleSetPayload 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.updateCoreRuleSetPayload - 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 ApiUpdateRulesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - name string - updateRulesPayload *UpdateRulesPayload -} - -func (r ApiUpdateRulesRequest) UpdateRulesPayload(updateRulesPayload UpdateRulesPayload) ApiUpdateRulesRequest { - r.updateRulesPayload = &updateRulesPayload - return r -} - -func (r ApiUpdateRulesRequest) Execute() (*UpdateRulesResponse, error) { - return r.ApiService.UpdateRulesExecute(r) -} - -/* -UpdateRules Update a rule configuration - -This endpoint will update an existing rules configuration and also inturn update all WAF configurations that reference it. There is a limit of 1 MB of data on these rules. - - @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 ApiUpdateRulesRequest - -Deprecated -*/ -func (a *DefaultAPIService) UpdateRules(ctx context.Context, projectId string, region string, name string) ApiUpdateRulesRequest { - return ApiUpdateRulesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Execute executes the request -// -// @return UpdateRulesResponse -// -// Deprecated -func (a *DefaultAPIService) UpdateRulesExecute(r ApiUpdateRulesRequest) (*UpdateRulesResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateRulesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRules") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/regions/{region}/rules/{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.updateRulesPayload == nil { - return localVarReturnValue, reportError("updateRulesPayload 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.updateRulesPayload - 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() (*UpdateWAFResponse, 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 - -Deprecated -*/ -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 UpdateWAFResponse -// -// Deprecated -func (a *DefaultAPIService) UpdateWAFExecute(r ApiUpdateWAFRequest) (*UpdateWAFResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateWAFResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateWAF") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha/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/v1alphaapi/api_default_mock.go b/services/albwaf/v1alphaapi/api_default_mock.go index 23a0651c6..36885a02a 100644 --- a/services/albwaf/v1alphaapi/api_default_mock.go +++ b/services/albwaf/v1alphaapi/api_default_mock.go @@ -20,12 +20,6 @@ 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 { - // Deprecated: CreateCoreRuleSetExecuteMock can be populated to implement the behavior of the CreateCoreRuleSetExecute function of this mock - CreateCoreRuleSetExecuteMock *func(r ApiCreateCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) - // Deprecated: CreateRulesExecuteMock can be populated to implement the behavior of the CreateRulesExecute function of this mock - CreateRulesExecuteMock *func(r ApiCreateRulesRequest) (*CreateRulesResponse, error) - // Deprecated: CreateWAFExecuteMock can be populated to implement the behavior of the CreateWAFExecute function of this mock - CreateWAFExecuteMock *func(r ApiCreateWAFRequest) (*CreateWAFResponse, error) // Deprecated: DeleteCoreRuleSetExecuteMock can be populated to implement the behavior of the DeleteCoreRuleSetExecute function of this mock DeleteCoreRuleSetExecuteMock *func(r ApiDeleteCoreRuleSetRequest) (map[string]interface{}, error) // Deprecated: DeleteRulesExecuteMock can be populated to implement the behavior of the DeleteRulesExecute function of this mock @@ -46,74 +40,6 @@ type DefaultAPIServiceMock struct { ListRulesExecuteMock *func(r ApiListRulesRequest) (*ListRulesResponse, error) // Deprecated: ListWAFExecuteMock can be populated to implement the behavior of the ListWAFExecute function of this mock ListWAFExecuteMock *func(r ApiListWAFRequest) (*ListWAFResponse, error) - // Deprecated: PatchCoreRuleSetExecuteMock can be populated to implement the behavior of the PatchCoreRuleSetExecute function of this mock - PatchCoreRuleSetExecuteMock *func(r ApiPatchCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) - // Deprecated: UpdateCoreRuleSetExecuteMock can be populated to implement the behavior of the UpdateCoreRuleSetExecute function of this mock - UpdateCoreRuleSetExecuteMock *func(r ApiUpdateCoreRuleSetRequest) (*UpdateCoreRuleSetResponse, error) - // Deprecated: UpdateRulesExecuteMock can be populated to implement the behavior of the UpdateRulesExecute function of this mock - UpdateRulesExecuteMock *func(r ApiUpdateRulesRequest) (*UpdateRulesResponse, error) - // Deprecated: UpdateWAFExecuteMock can be populated to implement the behavior of the UpdateWAFExecute function of this mock - UpdateWAFExecuteMock *func(r ApiUpdateWAFRequest) (*UpdateWAFResponse, error) -} - -// Deprecated -func (a DefaultAPIServiceMock) CreateCoreRuleSet(ctx context.Context, projectId string, region string) ApiCreateCoreRuleSetRequest { - return ApiCreateCoreRuleSetRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Deprecated: CreateCoreRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCoreRuleSetExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateCoreRuleSetExecute(r ApiCreateCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { - if a.CreateCoreRuleSetExecuteMock == nil { - var localVarReturnValue *GetCoreRuleSetResponse - return localVarReturnValue, nil - } - - return (*a.CreateCoreRuleSetExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) CreateRules(ctx context.Context, projectId string, region string) ApiCreateRulesRequest { - return ApiCreateRulesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Deprecated: CreateRulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateRulesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateRulesExecute(r ApiCreateRulesRequest) (*CreateRulesResponse, error) { - if a.CreateRulesExecuteMock == nil { - var localVarReturnValue *CreateRulesResponse - return localVarReturnValue, nil - } - - return (*a.CreateRulesExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) CreateWAF(ctx context.Context, projectId string, region string) ApiCreateWAFRequest { - return ApiCreateWAFRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - } -} - -// Deprecated: 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) (*CreateWAFResponse, error) { - if a.CreateWAFExecuteMock == nil { - var localVarReturnValue *CreateWAFResponse - return localVarReturnValue, nil - } - - return (*a.CreateWAFExecuteMock)(r) } // Deprecated @@ -321,87 +247,3 @@ func (a DefaultAPIServiceMock) ListWAFExecute(r ApiListWAFRequest) (*ListWAFResp return (*a.ListWAFExecuteMock)(r) } - -// Deprecated -func (a DefaultAPIServiceMock) PatchCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiPatchCoreRuleSetRequest { - return ApiPatchCoreRuleSetRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Deprecated: PatchCoreRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchCoreRuleSetExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PatchCoreRuleSetExecute(r ApiPatchCoreRuleSetRequest) (*GetCoreRuleSetResponse, error) { - if a.PatchCoreRuleSetExecuteMock == nil { - var localVarReturnValue *GetCoreRuleSetResponse - return localVarReturnValue, nil - } - - return (*a.PatchCoreRuleSetExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) UpdateCoreRuleSet(ctx context.Context, projectId string, region string, name string) ApiUpdateCoreRuleSetRequest { - return ApiUpdateCoreRuleSetRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Deprecated: UpdateCoreRuleSetExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateCoreRuleSetExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateCoreRuleSetExecute(r ApiUpdateCoreRuleSetRequest) (*UpdateCoreRuleSetResponse, error) { - if a.UpdateCoreRuleSetExecuteMock == nil { - var localVarReturnValue *UpdateCoreRuleSetResponse - return localVarReturnValue, nil - } - - return (*a.UpdateCoreRuleSetExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) UpdateRules(ctx context.Context, projectId string, region string, name string) ApiUpdateRulesRequest { - return ApiUpdateRulesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - name: name, - } -} - -// Deprecated: UpdateRulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRulesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateRulesExecute(r ApiUpdateRulesRequest) (*UpdateRulesResponse, error) { - if a.UpdateRulesExecuteMock == nil { - var localVarReturnValue *UpdateRulesResponse - return localVarReturnValue, nil - } - - return (*a.UpdateRulesExecuteMock)(r) -} - -// Deprecated -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, - } -} - -// Deprecated: 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) (*UpdateWAFResponse, error) { - if a.UpdateWAFExecuteMock == nil { - var localVarReturnValue *UpdateWAFResponse - return localVarReturnValue, nil - } - - return (*a.UpdateWAFExecuteMock)(r) -} diff --git a/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go deleted file mode 100644 index 0265cc6bc..000000000 --- a/services/albwaf/v1alphaapi/model_create_core_rule_set_payload.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the CreateCoreRuleSetPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateCoreRuleSetPayload{} - -// CreateCoreRuleSetPayload CreateCoreRuleSetRequest creates a rule configuration. -type CreateCoreRuleSetPayload struct { - // To activate the OWASP core rule set, set this boolean to true. - Active *bool `json:"active,omitempty"` - // Core rule set configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // 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 _CreateCoreRuleSetPayload CreateCoreRuleSetPayload - -// NewCreateCoreRuleSetPayload instantiates a new CreateCoreRuleSetPayload 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 NewCreateCoreRuleSetPayload() *CreateCoreRuleSetPayload { - this := CreateCoreRuleSetPayload{} - return &this -} - -// NewCreateCoreRuleSetPayloadWithDefaults instantiates a new CreateCoreRuleSetPayload 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 NewCreateCoreRuleSetPayloadWithDefaults() *CreateCoreRuleSetPayload { - this := CreateCoreRuleSetPayload{} - return &this -} - -// GetActive returns the Active field value if set, zero value otherwise. -func (o *CreateCoreRuleSetPayload) GetActive() bool { - if o == nil || IsNil(o.Active) { - var ret bool - return ret - } - return *o.Active -} - -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateCoreRuleSetPayload) GetActiveOk() (*bool, bool) { - if o == nil || IsNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *CreateCoreRuleSetPayload) HasActive() bool { - if o != nil && !IsNil(o.Active) { - return true - } - - return false -} - -// SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *CreateCoreRuleSetPayload) SetActive(v bool) { - o.Active = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) SetName(v string) { - o.Name = &v -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) SetProjectId(v string) { - o.ProjectId = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) 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 *CreateCoreRuleSetPayload) SetRegion(v string) { - o.Region = &v -} - -func (o CreateCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateCoreRuleSetPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Active) { - toSerialize["active"] = o.Active - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.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 *CreateCoreRuleSetPayload) UnmarshalJSON(data []byte) (err error) { - varCreateCoreRuleSetPayload := _CreateCoreRuleSetPayload{} - - err = json.Unmarshal(data, &varCreateCoreRuleSetPayload) - - if err != nil { - return err - } - - *o = CreateCoreRuleSetPayload(varCreateCoreRuleSetPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "active") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "region") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateCoreRuleSetPayload struct { - value *CreateCoreRuleSetPayload - isSet bool -} - -func (v NullableCreateCoreRuleSetPayload) Get() *CreateCoreRuleSetPayload { - return v.value -} - -func (v *NullableCreateCoreRuleSetPayload) Set(val *CreateCoreRuleSetPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateCoreRuleSetPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateCoreRuleSetPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateCoreRuleSetPayload(val *CreateCoreRuleSetPayload) *NullableCreateCoreRuleSetPayload { - return &NullableCreateCoreRuleSetPayload{value: val, isSet: true} -} - -func (v NullableCreateCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateCoreRuleSetPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_create_rules_payload.go b/services/albwaf/v1alphaapi/model_create_rules_payload.go deleted file mode 100644 index fd8d3a4f9..000000000 --- a/services/albwaf/v1alphaapi/model_create_rules_payload.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the CreateRulesPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateRulesPayload{} - -// CreateRulesPayload CreateRulesRequest creates a rule configuration. -type CreateRulesPayload struct { - // Rule 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}$"` - // Custom rules for WAF written in Seclang syntax. - Rules *string `json:"rules,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CreateRulesPayload CreateRulesPayload - -// NewCreateRulesPayload instantiates a new CreateRulesPayload 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 NewCreateRulesPayload() *CreateRulesPayload { - this := CreateRulesPayload{} - return &this -} - -// NewCreateRulesPayloadWithDefaults instantiates a new CreateRulesPayload 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 NewCreateRulesPayloadWithDefaults() *CreateRulesPayload { - this := CreateRulesPayload{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) SetName(v string) { - o.Name = &v -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) SetProjectId(v string) { - o.ProjectId = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) 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 *CreateRulesPayload) SetRegion(v string) { - o.Region = &v -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *CreateRulesPayload) GetRules() string { - if o == nil || IsNil(o.Rules) { - var ret string - 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 *CreateRulesPayload) GetRulesOk() (*string, 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 *CreateRulesPayload) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false -} - -// SetRules gets a reference to the given string and assigns it to the Rules field. -func (o *CreateRulesPayload) SetRules(v string) { - o.Rules = &v -} - -func (o CreateRulesPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateRulesPayload) 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 *CreateRulesPayload) UnmarshalJSON(data []byte) (err error) { - varCreateRulesPayload := _CreateRulesPayload{} - - err = json.Unmarshal(data, &varCreateRulesPayload) - - if err != nil { - return err - } - - *o = CreateRulesPayload(varCreateRulesPayload) - - 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 NullableCreateRulesPayload struct { - value *CreateRulesPayload - isSet bool -} - -func (v NullableCreateRulesPayload) Get() *CreateRulesPayload { - return v.value -} - -func (v *NullableCreateRulesPayload) Set(val *CreateRulesPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateRulesPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateRulesPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateRulesPayload(val *CreateRulesPayload) *NullableCreateRulesPayload { - return &NullableCreateRulesPayload{value: val, isSet: true} -} - -func (v NullableCreateRulesPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateRulesPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_create_rules_response.go b/services/albwaf/v1alphaapi/model_create_rules_response.go deleted file mode 100644 index f85361001..000000000 --- a/services/albwaf/v1alphaapi/model_create_rules_response.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the CreateRulesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateRulesResponse{} - -// CreateRulesResponse CreateRulesResponse returns rule configuration name and it's rules. -type CreateRulesResponse struct { - // Rule configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` - // Custom rules written in Seclang syntax. - Rules *string `json:"rules,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CreateRulesResponse CreateRulesResponse - -// NewCreateRulesResponse instantiates a new CreateRulesResponse 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 NewCreateRulesResponse() *CreateRulesResponse { - this := CreateRulesResponse{} - return &this -} - -// NewCreateRulesResponseWithDefaults instantiates a new CreateRulesResponse 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 NewCreateRulesResponseWithDefaults() *CreateRulesResponse { - this := CreateRulesResponse{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateRulesResponse) 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 *CreateRulesResponse) 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 *CreateRulesResponse) 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 *CreateRulesResponse) SetName(v string) { - o.Name = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateRulesResponse) 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 *CreateRulesResponse) 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 *CreateRulesResponse) 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 *CreateRulesResponse) SetRegion(v string) { - o.Region = &v -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *CreateRulesResponse) GetRules() string { - if o == nil || IsNil(o.Rules) { - var ret string - 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 *CreateRulesResponse) GetRulesOk() (*string, 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 *CreateRulesResponse) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false -} - -// SetRules gets a reference to the given string and assigns it to the Rules field. -func (o *CreateRulesResponse) SetRules(v string) { - o.Rules = &v -} - -func (o CreateRulesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateRulesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - 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 *CreateRulesResponse) UnmarshalJSON(data []byte) (err error) { - varCreateRulesResponse := _CreateRulesResponse{} - - err = json.Unmarshal(data, &varCreateRulesResponse) - - if err != nil { - return err - } - - *o = CreateRulesResponse(varCreateRulesResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "region") - delete(additionalProperties, "rules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateRulesResponse struct { - value *CreateRulesResponse - isSet bool -} - -func (v NullableCreateRulesResponse) Get() *CreateRulesResponse { - return v.value -} - -func (v *NullableCreateRulesResponse) Set(val *CreateRulesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCreateRulesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateRulesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateRulesResponse(val *CreateRulesResponse) *NullableCreateRulesResponse { - return &NullableCreateRulesResponse{value: val, isSet: true} -} - -func (v NullableCreateRulesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateRulesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_create_waf_payload.go b/services/albwaf/v1alphaapi/model_create_waf_payload.go deleted file mode 100644 index 0f07f0606..000000000 --- a/services/albwaf/v1alphaapi/model_create_waf_payload.go +++ /dev/null @@ -1,344 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -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 core rule set configuration for that WAF. - CoreRuleSetName *string `json:"coreRuleSetName,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"` - // 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}$"` - // Name of the rule configuration for that WAF. - RulesConfigName *string `json:"rulesConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - 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 -} - -// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise. -func (o *CreateWAFPayload) GetCoreRuleSetName() string { - if o == nil || IsNil(o.CoreRuleSetName) { - var ret string - return ret - } - return *o.CoreRuleSetName -} - -// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateWAFPayload) GetCoreRuleSetNameOk() (*string, bool) { - if o == nil || IsNil(o.CoreRuleSetName) { - return nil, false - } - return o.CoreRuleSetName, true -} - -// HasCoreRuleSetName returns a boolean if a field has been set. -func (o *CreateWAFPayload) HasCoreRuleSetName() bool { - if o != nil && !IsNil(o.CoreRuleSetName) { - return true - } - - return false -} - -// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field. -func (o *CreateWAFPayload) SetCoreRuleSetName(v string) { - o.CoreRuleSetName = &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 -} - -// 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 -} - -// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise. -func (o *CreateWAFPayload) GetRulesConfigName() string { - if o == nil || IsNil(o.RulesConfigName) { - var ret string - return ret - } - return *o.RulesConfigName -} - -// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateWAFPayload) GetRulesConfigNameOk() (*string, bool) { - if o == nil || IsNil(o.RulesConfigName) { - return nil, false - } - return o.RulesConfigName, true -} - -// HasRulesConfigName returns a boolean if a field has been set. -func (o *CreateWAFPayload) HasRulesConfigName() bool { - if o != nil && !IsNil(o.RulesConfigName) { - return true - } - - return false -} - -// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field. -func (o *CreateWAFPayload) SetRulesConfigName(v string) { - o.RulesConfigName = &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.CoreRuleSetName) { - toSerialize["coreRuleSetName"] = o.CoreRuleSetName - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - 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.RulesConfigName) { - toSerialize["rulesConfigName"] = o.RulesConfigName - } - - 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, "coreRuleSetName") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "region") - delete(additionalProperties, "rulesConfigName") - 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/v1alphaapi/model_create_waf_response.go b/services/albwaf/v1alphaapi/model_create_waf_response.go deleted file mode 100644 index 2034ce88e..000000000 --- a/services/albwaf/v1alphaapi/model_create_waf_response.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the CreateWAFResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateWAFResponse{} - -// CreateWAFResponse CreateWAFResponse returns name and custom rules. -type CreateWAFResponse struct { - // Name of the core rule set configuration for that WAF. - CoreRuleSetName *string `json:"coreRuleSetName,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"` - // WAF name - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` - // Name of the rule configuration for that WAF. - RulesConfigName *string `json:"rulesConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - AdditionalProperties map[string]interface{} -} - -type _CreateWAFResponse CreateWAFResponse - -// NewCreateWAFResponse instantiates a new CreateWAFResponse 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 NewCreateWAFResponse() *CreateWAFResponse { - this := CreateWAFResponse{} - return &this -} - -// NewCreateWAFResponseWithDefaults instantiates a new CreateWAFResponse 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 NewCreateWAFResponseWithDefaults() *CreateWAFResponse { - this := CreateWAFResponse{} - return &this -} - -// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise. -func (o *CreateWAFResponse) GetCoreRuleSetName() string { - if o == nil || IsNil(o.CoreRuleSetName) { - var ret string - return ret - } - return *o.CoreRuleSetName -} - -// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateWAFResponse) GetCoreRuleSetNameOk() (*string, bool) { - if o == nil || IsNil(o.CoreRuleSetName) { - return nil, false - } - return o.CoreRuleSetName, true -} - -// HasCoreRuleSetName returns a boolean if a field has been set. -func (o *CreateWAFResponse) HasCoreRuleSetName() bool { - if o != nil && !IsNil(o.CoreRuleSetName) { - return true - } - - return false -} - -// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field. -func (o *CreateWAFResponse) SetCoreRuleSetName(v string) { - o.CoreRuleSetName = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) SetLabels(v map[string]string) { - o.Labels = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) SetName(v string) { - o.Name = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) 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 *CreateWAFResponse) SetRegion(v string) { - o.Region = &v -} - -// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise. -func (o *CreateWAFResponse) GetRulesConfigName() string { - if o == nil || IsNil(o.RulesConfigName) { - var ret string - return ret - } - return *o.RulesConfigName -} - -// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateWAFResponse) GetRulesConfigNameOk() (*string, bool) { - if o == nil || IsNil(o.RulesConfigName) { - return nil, false - } - return o.RulesConfigName, true -} - -// HasRulesConfigName returns a boolean if a field has been set. -func (o *CreateWAFResponse) HasRulesConfigName() bool { - if o != nil && !IsNil(o.RulesConfigName) { - return true - } - - return false -} - -// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field. -func (o *CreateWAFResponse) SetRulesConfigName(v string) { - o.RulesConfigName = &v -} - -func (o CreateWAFResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateWAFResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CoreRuleSetName) { - toSerialize["coreRuleSetName"] = o.CoreRuleSetName - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region - } - if !IsNil(o.RulesConfigName) { - toSerialize["rulesConfigName"] = o.RulesConfigName - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateWAFResponse) UnmarshalJSON(data []byte) (err error) { - varCreateWAFResponse := _CreateWAFResponse{} - - err = json.Unmarshal(data, &varCreateWAFResponse) - - if err != nil { - return err - } - - *o = CreateWAFResponse(varCreateWAFResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "coreRuleSetName") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "region") - delete(additionalProperties, "rulesConfigName") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateWAFResponse struct { - value *CreateWAFResponse - isSet bool -} - -func (v NullableCreateWAFResponse) Get() *CreateWAFResponse { - return v.value -} - -func (v *NullableCreateWAFResponse) Set(val *CreateWAFResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCreateWAFResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateWAFResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateWAFResponse(val *CreateWAFResponse) *NullableCreateWAFResponse { - return &NullableCreateWAFResponse{value: val, isSet: true} -} - -func (v NullableCreateWAFResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateWAFResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go b/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go deleted file mode 100644 index 197e902e6..000000000 --- a/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" - "fmt" -) - -// OWASPCoreRuleSet1 The current mode of the rule. -type OWASPCoreRuleSet1 string - -// List of OWASP_Core_Rule_Set_1 -const ( - OWASPCORERULESET1_MODE_UNSPECIFIED OWASPCoreRuleSet1 = "MODE_UNSPECIFIED" - OWASPCORERULESET1_MODE_ENABLED OWASPCoreRuleSet1 = "MODE_ENABLED" - OWASPCORERULESET1_MODE_DISABLED OWASPCoreRuleSet1 = "MODE_DISABLED" - OWASPCORERULESET1_MODE_LOG_ONLY OWASPCoreRuleSet1 = "MODE_LOG_ONLY" - OWASPCORERULESET1_UNKNOWN_DEFAULT_OPEN_API OWASPCoreRuleSet1 = "unknown_default_open_api" -) - -// All allowed values of OWASPCoreRuleSet1 enum -var AllowedOWASPCoreRuleSet1EnumValues = []OWASPCoreRuleSet1{ - "MODE_UNSPECIFIED", - "MODE_ENABLED", - "MODE_DISABLED", - "MODE_LOG_ONLY", - "unknown_default_open_api", -} - -func (v *OWASPCoreRuleSet1) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OWASPCoreRuleSet1(value) - for _, existing := range AllowedOWASPCoreRuleSet1EnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = OWASPCORERULESET1_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewOWASPCoreRuleSet1FromValue returns a pointer to a valid OWASPCoreRuleSet1 -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewOWASPCoreRuleSet1FromValue(v string) (*OWASPCoreRuleSet1, error) { - ev := OWASPCoreRuleSet1(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for OWASPCoreRuleSet1: valid values are %v", v, AllowedOWASPCoreRuleSet1EnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v OWASPCoreRuleSet1) IsValid() bool { - for _, existing := range AllowedOWASPCoreRuleSet1EnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to OWASP_Core_Rule_Set_1 value -func (v OWASPCoreRuleSet1) Ptr() *OWASPCoreRuleSet1 { - return &v -} - -type NullableOWASPCoreRuleSet1 struct { - value *OWASPCoreRuleSet1 - isSet bool -} - -func (v NullableOWASPCoreRuleSet1) Get() *OWASPCoreRuleSet1 { - return v.value -} - -func (v *NullableOWASPCoreRuleSet1) Set(val *OWASPCoreRuleSet1) { - v.value = val - v.isSet = true -} - -func (v NullableOWASPCoreRuleSet1) IsSet() bool { - return v.isSet -} - -func (v *NullableOWASPCoreRuleSet1) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOWASPCoreRuleSet1(val *OWASPCoreRuleSet1) *NullableOWASPCoreRuleSet1 { - return &NullableOWASPCoreRuleSet1{value: val, isSet: true} -} - -func (v NullableOWASPCoreRuleSet1) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOWASPCoreRuleSet1) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go deleted file mode 100644 index 4451c55c5..000000000 --- a/services/albwaf/v1alphaapi/model_patch_core_rule_set_payload.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the PatchCoreRuleSetPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchCoreRuleSetPayload{} - -// PatchCoreRuleSetPayload PatchCoreRuleSetRequest updates a rules configuration. -type PatchCoreRuleSetPayload struct { - // To activate the OWASP core rule set, set this boolean to true. - Active *bool `json:"active,omitempty"` - // Map of Core 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]PatchCRSRuleGroup `json:"groups,omitempty"` - // Core rule set configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // 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 _PatchCoreRuleSetPayload PatchCoreRuleSetPayload - -// NewPatchCoreRuleSetPayload instantiates a new PatchCoreRuleSetPayload 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 NewPatchCoreRuleSetPayload() *PatchCoreRuleSetPayload { - this := PatchCoreRuleSetPayload{} - return &this -} - -// NewPatchCoreRuleSetPayloadWithDefaults instantiates a new PatchCoreRuleSetPayload 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 NewPatchCoreRuleSetPayloadWithDefaults() *PatchCoreRuleSetPayload { - this := PatchCoreRuleSetPayload{} - return &this -} - -// GetActive returns the Active field value if set, zero value otherwise. -func (o *PatchCoreRuleSetPayload) GetActive() bool { - if o == nil || IsNil(o.Active) { - var ret bool - return ret - } - return *o.Active -} - -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchCoreRuleSetPayload) GetActiveOk() (*bool, bool) { - if o == nil || IsNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *PatchCoreRuleSetPayload) HasActive() bool { - if o != nil && !IsNil(o.Active) { - return true - } - - return false -} - -// SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *PatchCoreRuleSetPayload) SetActive(v bool) { - o.Active = &v -} - -// GetGroups returns the Groups field value if set, zero value otherwise. -func (o *PatchCoreRuleSetPayload) GetGroups() map[string]PatchCRSRuleGroup { - if o == nil || IsNil(o.Groups) { - var ret map[string]PatchCRSRuleGroup - 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 *PatchCoreRuleSetPayload) GetGroupsOk() (*map[string]PatchCRSRuleGroup, 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 *PatchCoreRuleSetPayload) HasGroups() bool { - if o != nil && !IsNil(o.Groups) { - return true - } - - return false -} - -// SetGroups gets a reference to the given map[string]PatchCRSRuleGroup and assigns it to the Groups field. -func (o *PatchCoreRuleSetPayload) SetGroups(v map[string]PatchCRSRuleGroup) { - o.Groups = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) SetName(v string) { - o.Name = &v -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) SetProjectId(v string) { - o.ProjectId = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) 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 *PatchCoreRuleSetPayload) SetRegion(v string) { - o.Region = &v -} - -func (o PatchCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchCoreRuleSetPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Active) { - toSerialize["active"] = o.Active - } - if !IsNil(o.Groups) { - toSerialize["groups"] = o.Groups - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.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 *PatchCoreRuleSetPayload) UnmarshalJSON(data []byte) (err error) { - varPatchCoreRuleSetPayload := _PatchCoreRuleSetPayload{} - - err = json.Unmarshal(data, &varPatchCoreRuleSetPayload) - - if err != nil { - return err - } - - *o = PatchCoreRuleSetPayload(varPatchCoreRuleSetPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "active") - delete(additionalProperties, "groups") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "region") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchCoreRuleSetPayload struct { - value *PatchCoreRuleSetPayload - isSet bool -} - -func (v NullablePatchCoreRuleSetPayload) Get() *PatchCoreRuleSetPayload { - return v.value -} - -func (v *NullablePatchCoreRuleSetPayload) Set(val *PatchCoreRuleSetPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePatchCoreRuleSetPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchCoreRuleSetPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchCoreRuleSetPayload(val *PatchCoreRuleSetPayload) *NullablePatchCoreRuleSetPayload { - return &NullablePatchCoreRuleSetPayload{value: val, isSet: true} -} - -func (v NullablePatchCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchCoreRuleSetPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_patch_crs_rule.go b/services/albwaf/v1alphaapi/model_patch_crs_rule.go deleted file mode 100644 index da3fa3fce..000000000 --- a/services/albwaf/v1alphaapi/model_patch_crs_rule.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the PatchCRSRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchCRSRule{} - -// PatchCRSRule struct for PatchCRSRule -type PatchCRSRule struct { - Mode *OWASPCoreRuleSet1 `json:"mode,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PatchCRSRule PatchCRSRule - -// NewPatchCRSRule instantiates a new PatchCRSRule 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 NewPatchCRSRule() *PatchCRSRule { - this := PatchCRSRule{} - return &this -} - -// NewPatchCRSRuleWithDefaults instantiates a new PatchCRSRule 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 NewPatchCRSRuleWithDefaults() *PatchCRSRule { - this := PatchCRSRule{} - return &this -} - -// GetMode returns the Mode field value if set, zero value otherwise. -func (o *PatchCRSRule) GetMode() OWASPCoreRuleSet1 { - if o == nil || IsNil(o.Mode) { - var ret OWASPCoreRuleSet1 - 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 *PatchCRSRule) GetModeOk() (*OWASPCoreRuleSet1, 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 *PatchCRSRule) HasMode() bool { - if o != nil && !IsNil(o.Mode) { - return true - } - - return false -} - -// SetMode gets a reference to the given OWASPCoreRuleSet1 and assigns it to the Mode field. -func (o *PatchCRSRule) SetMode(v OWASPCoreRuleSet1) { - o.Mode = &v -} - -func (o PatchCRSRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchCRSRule) 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 *PatchCRSRule) UnmarshalJSON(data []byte) (err error) { - varPatchCRSRule := _PatchCRSRule{} - - err = json.Unmarshal(data, &varPatchCRSRule) - - if err != nil { - return err - } - - *o = PatchCRSRule(varPatchCRSRule) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "mode") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchCRSRule struct { - value *PatchCRSRule - isSet bool -} - -func (v NullablePatchCRSRule) Get() *PatchCRSRule { - return v.value -} - -func (v *NullablePatchCRSRule) Set(val *PatchCRSRule) { - v.value = val - v.isSet = true -} - -func (v NullablePatchCRSRule) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchCRSRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchCRSRule(val *PatchCRSRule) *NullablePatchCRSRule { - return &NullablePatchCRSRule{value: val, isSet: true} -} - -func (v NullablePatchCRSRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchCRSRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go b/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go deleted file mode 100644 index 0e2951549..000000000 --- a/services/albwaf/v1alphaapi/model_patch_crs_rule_group.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the PatchCRSRuleGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchCRSRuleGroup{} - -// PatchCRSRuleGroup struct for PatchCRSRuleGroup -type PatchCRSRuleGroup struct { - Rules *map[string]PatchCRSRule `json:"rules,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PatchCRSRuleGroup PatchCRSRuleGroup - -// NewPatchCRSRuleGroup instantiates a new PatchCRSRuleGroup 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 NewPatchCRSRuleGroup() *PatchCRSRuleGroup { - this := PatchCRSRuleGroup{} - return &this -} - -// NewPatchCRSRuleGroupWithDefaults instantiates a new PatchCRSRuleGroup 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 NewPatchCRSRuleGroupWithDefaults() *PatchCRSRuleGroup { - this := PatchCRSRuleGroup{} - return &this -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *PatchCRSRuleGroup) GetRules() map[string]PatchCRSRule { - if o == nil || IsNil(o.Rules) { - var ret map[string]PatchCRSRule - 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 *PatchCRSRuleGroup) GetRulesOk() (*map[string]PatchCRSRule, 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 *PatchCRSRuleGroup) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false -} - -// SetRules gets a reference to the given map[string]PatchCRSRule and assigns it to the Rules field. -func (o *PatchCRSRuleGroup) SetRules(v map[string]PatchCRSRule) { - o.Rules = &v -} - -func (o PatchCRSRuleGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchCRSRuleGroup) 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 *PatchCRSRuleGroup) UnmarshalJSON(data []byte) (err error) { - varPatchCRSRuleGroup := _PatchCRSRuleGroup{} - - err = json.Unmarshal(data, &varPatchCRSRuleGroup) - - if err != nil { - return err - } - - *o = PatchCRSRuleGroup(varPatchCRSRuleGroup) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "rules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchCRSRuleGroup struct { - value *PatchCRSRuleGroup - isSet bool -} - -func (v NullablePatchCRSRuleGroup) Get() *PatchCRSRuleGroup { - return v.value -} - -func (v *NullablePatchCRSRuleGroup) Set(val *PatchCRSRuleGroup) { - v.value = val - v.isSet = true -} - -func (v NullablePatchCRSRuleGroup) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchCRSRuleGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchCRSRuleGroup(val *PatchCRSRuleGroup) *NullablePatchCRSRuleGroup { - return &NullablePatchCRSRuleGroup{value: val, isSet: true} -} - -func (v NullablePatchCRSRuleGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchCRSRuleGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go b/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go deleted file mode 100644 index b62154bfc..000000000 --- a/services/albwaf/v1alphaapi/model_update_core_rule_set_payload.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the UpdateCoreRuleSetPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateCoreRuleSetPayload{} - -// UpdateCoreRuleSetPayload UpdateCoreRuleSetRequest updates a rules configuration, but only if it changed. DEPRECATED use PatchCoreRuleSet -type UpdateCoreRuleSetPayload struct { - // To activate the OWASP core rule set, set this boolean to true. - Active *bool `json:"active,omitempty"` - // Map of Core 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]PatchCRSRuleGroup `json:"groups,omitempty"` - // Core rule set configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // 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 _UpdateCoreRuleSetPayload UpdateCoreRuleSetPayload - -// NewUpdateCoreRuleSetPayload instantiates a new UpdateCoreRuleSetPayload 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 NewUpdateCoreRuleSetPayload() *UpdateCoreRuleSetPayload { - this := UpdateCoreRuleSetPayload{} - return &this -} - -// NewUpdateCoreRuleSetPayloadWithDefaults instantiates a new UpdateCoreRuleSetPayload 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 NewUpdateCoreRuleSetPayloadWithDefaults() *UpdateCoreRuleSetPayload { - this := UpdateCoreRuleSetPayload{} - return &this -} - -// GetActive returns the Active field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetPayload) GetActive() bool { - if o == nil || IsNil(o.Active) { - var ret bool - return ret - } - return *o.Active -} - -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateCoreRuleSetPayload) GetActiveOk() (*bool, bool) { - if o == nil || IsNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *UpdateCoreRuleSetPayload) HasActive() bool { - if o != nil && !IsNil(o.Active) { - return true - } - - return false -} - -// SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *UpdateCoreRuleSetPayload) SetActive(v bool) { - o.Active = &v -} - -// GetGroups returns the Groups field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetPayload) GetGroups() map[string]PatchCRSRuleGroup { - if o == nil || IsNil(o.Groups) { - var ret map[string]PatchCRSRuleGroup - 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 *UpdateCoreRuleSetPayload) GetGroupsOk() (*map[string]PatchCRSRuleGroup, 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 *UpdateCoreRuleSetPayload) HasGroups() bool { - if o != nil && !IsNil(o.Groups) { - return true - } - - return false -} - -// SetGroups gets a reference to the given map[string]PatchCRSRuleGroup and assigns it to the Groups field. -func (o *UpdateCoreRuleSetPayload) SetGroups(v map[string]PatchCRSRuleGroup) { - o.Groups = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) SetName(v string) { - o.Name = &v -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) SetProjectId(v string) { - o.ProjectId = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) 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 *UpdateCoreRuleSetPayload) SetRegion(v string) { - o.Region = &v -} - -func (o UpdateCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateCoreRuleSetPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Active) { - toSerialize["active"] = o.Active - } - if !IsNil(o.Groups) { - toSerialize["groups"] = o.Groups - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.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 *UpdateCoreRuleSetPayload) UnmarshalJSON(data []byte) (err error) { - varUpdateCoreRuleSetPayload := _UpdateCoreRuleSetPayload{} - - err = json.Unmarshal(data, &varUpdateCoreRuleSetPayload) - - if err != nil { - return err - } - - *o = UpdateCoreRuleSetPayload(varUpdateCoreRuleSetPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "active") - delete(additionalProperties, "groups") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "region") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateCoreRuleSetPayload struct { - value *UpdateCoreRuleSetPayload - isSet bool -} - -func (v NullableUpdateCoreRuleSetPayload) Get() *UpdateCoreRuleSetPayload { - return v.value -} - -func (v *NullableUpdateCoreRuleSetPayload) Set(val *UpdateCoreRuleSetPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateCoreRuleSetPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateCoreRuleSetPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateCoreRuleSetPayload(val *UpdateCoreRuleSetPayload) *NullableUpdateCoreRuleSetPayload { - return &NullableUpdateCoreRuleSetPayload{value: val, isSet: true} -} - -func (v NullableUpdateCoreRuleSetPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateCoreRuleSetPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go b/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go deleted file mode 100644 index 6bc26150b..000000000 --- a/services/albwaf/v1alphaapi/model_update_core_rule_set_response.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the UpdateCoreRuleSetResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateCoreRuleSetResponse{} - -// UpdateCoreRuleSetResponse DEPRECATED use PatchCoreRuleSet -type UpdateCoreRuleSetResponse struct { - // Indicates if the OWASP core rule set is active. - Active *bool `json:"active,omitempty"` - // Core rule set configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` - AdditionalProperties map[string]interface{} -} - -type _UpdateCoreRuleSetResponse UpdateCoreRuleSetResponse - -// NewUpdateCoreRuleSetResponse instantiates a new UpdateCoreRuleSetResponse 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 NewUpdateCoreRuleSetResponse() *UpdateCoreRuleSetResponse { - this := UpdateCoreRuleSetResponse{} - return &this -} - -// NewUpdateCoreRuleSetResponseWithDefaults instantiates a new UpdateCoreRuleSetResponse 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 NewUpdateCoreRuleSetResponseWithDefaults() *UpdateCoreRuleSetResponse { - this := UpdateCoreRuleSetResponse{} - return &this -} - -// GetActive returns the Active field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetResponse) GetActive() bool { - if o == nil || IsNil(o.Active) { - var ret bool - return ret - } - return *o.Active -} - -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateCoreRuleSetResponse) GetActiveOk() (*bool, bool) { - if o == nil || IsNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *UpdateCoreRuleSetResponse) HasActive() bool { - if o != nil && !IsNil(o.Active) { - return true - } - - return false -} - -// SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *UpdateCoreRuleSetResponse) SetActive(v bool) { - o.Active = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) SetName(v string) { - o.Name = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) 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 *UpdateCoreRuleSetResponse) SetRegion(v string) { - o.Region = &v -} - -func (o UpdateCoreRuleSetResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateCoreRuleSetResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Active) { - toSerialize["active"] = o.Active - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateCoreRuleSetResponse) UnmarshalJSON(data []byte) (err error) { - varUpdateCoreRuleSetResponse := _UpdateCoreRuleSetResponse{} - - err = json.Unmarshal(data, &varUpdateCoreRuleSetResponse) - - if err != nil { - return err - } - - *o = UpdateCoreRuleSetResponse(varUpdateCoreRuleSetResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "active") - delete(additionalProperties, "name") - delete(additionalProperties, "region") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateCoreRuleSetResponse struct { - value *UpdateCoreRuleSetResponse - isSet bool -} - -func (v NullableUpdateCoreRuleSetResponse) Get() *UpdateCoreRuleSetResponse { - return v.value -} - -func (v *NullableUpdateCoreRuleSetResponse) Set(val *UpdateCoreRuleSetResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateCoreRuleSetResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateCoreRuleSetResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateCoreRuleSetResponse(val *UpdateCoreRuleSetResponse) *NullableUpdateCoreRuleSetResponse { - return &NullableUpdateCoreRuleSetResponse{value: val, isSet: true} -} - -func (v NullableUpdateCoreRuleSetResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateCoreRuleSetResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_update_rules_payload.go b/services/albwaf/v1alphaapi/model_update_rules_payload.go deleted file mode 100644 index c982d6931..000000000 --- a/services/albwaf/v1alphaapi/model_update_rules_payload.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the UpdateRulesPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRulesPayload{} - -// UpdateRulesPayload UpdateRulesRequest updates a rules configuration, but only if it changed. -type UpdateRulesPayload struct { - // Rule 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}$"` - // Custom rules for WAF written in Seclang syntax. - Rules *string `json:"rules,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateRulesPayload UpdateRulesPayload - -// NewUpdateRulesPayload instantiates a new UpdateRulesPayload 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 NewUpdateRulesPayload() *UpdateRulesPayload { - this := UpdateRulesPayload{} - return &this -} - -// NewUpdateRulesPayloadWithDefaults instantiates a new UpdateRulesPayload 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 NewUpdateRulesPayloadWithDefaults() *UpdateRulesPayload { - this := UpdateRulesPayload{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) SetName(v string) { - o.Name = &v -} - -// GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) SetProjectId(v string) { - o.ProjectId = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) 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 *UpdateRulesPayload) SetRegion(v string) { - o.Region = &v -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *UpdateRulesPayload) GetRules() string { - if o == nil || IsNil(o.Rules) { - var ret string - 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 *UpdateRulesPayload) GetRulesOk() (*string, 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 *UpdateRulesPayload) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false -} - -// SetRules gets a reference to the given string and assigns it to the Rules field. -func (o *UpdateRulesPayload) SetRules(v string) { - o.Rules = &v -} - -func (o UpdateRulesPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRulesPayload) 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 *UpdateRulesPayload) UnmarshalJSON(data []byte) (err error) { - varUpdateRulesPayload := _UpdateRulesPayload{} - - err = json.Unmarshal(data, &varUpdateRulesPayload) - - if err != nil { - return err - } - - *o = UpdateRulesPayload(varUpdateRulesPayload) - - 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 NullableUpdateRulesPayload struct { - value *UpdateRulesPayload - isSet bool -} - -func (v NullableUpdateRulesPayload) Get() *UpdateRulesPayload { - return v.value -} - -func (v *NullableUpdateRulesPayload) Set(val *UpdateRulesPayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRulesPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRulesPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRulesPayload(val *UpdateRulesPayload) *NullableUpdateRulesPayload { - return &NullableUpdateRulesPayload{value: val, isSet: true} -} - -func (v NullableUpdateRulesPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRulesPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_update_rules_response.go b/services/albwaf/v1alphaapi/model_update_rules_response.go deleted file mode 100644 index ba55d5bab..000000000 --- a/services/albwaf/v1alphaapi/model_update_rules_response.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the UpdateRulesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRulesResponse{} - -// UpdateRulesResponse UpdateRulesResponse returns rule configuration name and it's rules. -type UpdateRulesResponse struct { - // Rule configuration name. - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` - // Custom rules written in Seclang syntax. - Rules *string `json:"rules,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateRulesResponse UpdateRulesResponse - -// NewUpdateRulesResponse instantiates a new UpdateRulesResponse 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 NewUpdateRulesResponse() *UpdateRulesResponse { - this := UpdateRulesResponse{} - return &this -} - -// NewUpdateRulesResponseWithDefaults instantiates a new UpdateRulesResponse 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 NewUpdateRulesResponseWithDefaults() *UpdateRulesResponse { - this := UpdateRulesResponse{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateRulesResponse) 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 *UpdateRulesResponse) 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 *UpdateRulesResponse) 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 *UpdateRulesResponse) SetName(v string) { - o.Name = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *UpdateRulesResponse) 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 *UpdateRulesResponse) 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 *UpdateRulesResponse) 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 *UpdateRulesResponse) SetRegion(v string) { - o.Region = &v -} - -// GetRules returns the Rules field value if set, zero value otherwise. -func (o *UpdateRulesResponse) GetRules() string { - if o == nil || IsNil(o.Rules) { - var ret string - 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 *UpdateRulesResponse) GetRulesOk() (*string, 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 *UpdateRulesResponse) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false -} - -// SetRules gets a reference to the given string and assigns it to the Rules field. -func (o *UpdateRulesResponse) SetRules(v string) { - o.Rules = &v -} - -func (o UpdateRulesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRulesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - 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 *UpdateRulesResponse) UnmarshalJSON(data []byte) (err error) { - varUpdateRulesResponse := _UpdateRulesResponse{} - - err = json.Unmarshal(data, &varUpdateRulesResponse) - - if err != nil { - return err - } - - *o = UpdateRulesResponse(varUpdateRulesResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "region") - delete(additionalProperties, "rules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateRulesResponse struct { - value *UpdateRulesResponse - isSet bool -} - -func (v NullableUpdateRulesResponse) Get() *UpdateRulesResponse { - return v.value -} - -func (v *NullableUpdateRulesResponse) Set(val *UpdateRulesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRulesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRulesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRulesResponse(val *UpdateRulesResponse) *NullableUpdateRulesResponse { - return &NullableUpdateRulesResponse{value: val, isSet: true} -} - -func (v NullableUpdateRulesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRulesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1alphaapi/model_update_waf_payload.go b/services/albwaf/v1alphaapi/model_update_waf_payload.go deleted file mode 100644 index 62d386d6d..000000000 --- a/services/albwaf/v1alphaapi/model_update_waf_payload.go +++ /dev/null @@ -1,344 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -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 core rule set configuration for that WAF. - CoreRuleSetName *string `json:"coreRuleSetName,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"` - // 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}$"` - // Name of the rule configuration for that WAF. - RulesConfigName *string `json:"rulesConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - 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 -} - -// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise. -func (o *UpdateWAFPayload) GetCoreRuleSetName() string { - if o == nil || IsNil(o.CoreRuleSetName) { - var ret string - return ret - } - return *o.CoreRuleSetName -} - -// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateWAFPayload) GetCoreRuleSetNameOk() (*string, bool) { - if o == nil || IsNil(o.CoreRuleSetName) { - return nil, false - } - return o.CoreRuleSetName, true -} - -// HasCoreRuleSetName returns a boolean if a field has been set. -func (o *UpdateWAFPayload) HasCoreRuleSetName() bool { - if o != nil && !IsNil(o.CoreRuleSetName) { - return true - } - - return false -} - -// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field. -func (o *UpdateWAFPayload) SetCoreRuleSetName(v string) { - o.CoreRuleSetName = &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 -} - -// 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 -} - -// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise. -func (o *UpdateWAFPayload) GetRulesConfigName() string { - if o == nil || IsNil(o.RulesConfigName) { - var ret string - return ret - } - return *o.RulesConfigName -} - -// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateWAFPayload) GetRulesConfigNameOk() (*string, bool) { - if o == nil || IsNil(o.RulesConfigName) { - return nil, false - } - return o.RulesConfigName, true -} - -// HasRulesConfigName returns a boolean if a field has been set. -func (o *UpdateWAFPayload) HasRulesConfigName() bool { - if o != nil && !IsNil(o.RulesConfigName) { - return true - } - - return false -} - -// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field. -func (o *UpdateWAFPayload) SetRulesConfigName(v string) { - o.RulesConfigName = &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.CoreRuleSetName) { - toSerialize["coreRuleSetName"] = o.CoreRuleSetName - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - 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.RulesConfigName) { - toSerialize["rulesConfigName"] = o.RulesConfigName - } - - 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, "coreRuleSetName") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "projectId") - delete(additionalProperties, "region") - delete(additionalProperties, "rulesConfigName") - 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/v1alphaapi/model_update_waf_response.go b/services/albwaf/v1alphaapi/model_update_waf_response.go deleted file mode 100644 index 3724a8f7e..000000000 --- a/services/albwaf/v1alphaapi/model_update_waf_response.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -STACKIT Application Load Balancer Web Application Firewall API - -### DEPRECATED! Use v1beta 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 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" -) - -// checks if the UpdateWAFResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateWAFResponse{} - -// UpdateWAFResponse UpdateWAFResponse returns name and custom rules. -type UpdateWAFResponse struct { - // Name of the core rule set configuration for that WAF. - CoreRuleSetName *string `json:"coreRuleSetName,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"` - // WAF name - Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - // Region - Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` - // Name of the rule configuration for that WAF. - RulesConfigName *string `json:"rulesConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` - AdditionalProperties map[string]interface{} -} - -type _UpdateWAFResponse UpdateWAFResponse - -// NewUpdateWAFResponse instantiates a new UpdateWAFResponse 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 NewUpdateWAFResponse() *UpdateWAFResponse { - this := UpdateWAFResponse{} - return &this -} - -// NewUpdateWAFResponseWithDefaults instantiates a new UpdateWAFResponse 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 NewUpdateWAFResponseWithDefaults() *UpdateWAFResponse { - this := UpdateWAFResponse{} - return &this -} - -// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise. -func (o *UpdateWAFResponse) GetCoreRuleSetName() string { - if o == nil || IsNil(o.CoreRuleSetName) { - var ret string - return ret - } - return *o.CoreRuleSetName -} - -// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateWAFResponse) GetCoreRuleSetNameOk() (*string, bool) { - if o == nil || IsNil(o.CoreRuleSetName) { - return nil, false - } - return o.CoreRuleSetName, true -} - -// HasCoreRuleSetName returns a boolean if a field has been set. -func (o *UpdateWAFResponse) HasCoreRuleSetName() bool { - if o != nil && !IsNil(o.CoreRuleSetName) { - return true - } - - return false -} - -// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field. -func (o *UpdateWAFResponse) SetCoreRuleSetName(v string) { - o.CoreRuleSetName = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) SetLabels(v map[string]string) { - o.Labels = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) SetName(v string) { - o.Name = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) 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 *UpdateWAFResponse) SetRegion(v string) { - o.Region = &v -} - -// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise. -func (o *UpdateWAFResponse) GetRulesConfigName() string { - if o == nil || IsNil(o.RulesConfigName) { - var ret string - return ret - } - return *o.RulesConfigName -} - -// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateWAFResponse) GetRulesConfigNameOk() (*string, bool) { - if o == nil || IsNil(o.RulesConfigName) { - return nil, false - } - return o.RulesConfigName, true -} - -// HasRulesConfigName returns a boolean if a field has been set. -func (o *UpdateWAFResponse) HasRulesConfigName() bool { - if o != nil && !IsNil(o.RulesConfigName) { - return true - } - - return false -} - -// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field. -func (o *UpdateWAFResponse) SetRulesConfigName(v string) { - o.RulesConfigName = &v -} - -func (o UpdateWAFResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateWAFResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CoreRuleSetName) { - toSerialize["coreRuleSetName"] = o.CoreRuleSetName - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region - } - if !IsNil(o.RulesConfigName) { - toSerialize["rulesConfigName"] = o.RulesConfigName - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateWAFResponse) UnmarshalJSON(data []byte) (err error) { - varUpdateWAFResponse := _UpdateWAFResponse{} - - err = json.Unmarshal(data, &varUpdateWAFResponse) - - if err != nil { - return err - } - - *o = UpdateWAFResponse(varUpdateWAFResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "coreRuleSetName") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "region") - delete(additionalProperties, "rulesConfigName") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateWAFResponse struct { - value *UpdateWAFResponse - isSet bool -} - -func (v NullableUpdateWAFResponse) Get() *UpdateWAFResponse { - return v.value -} - -func (v *NullableUpdateWAFResponse) Set(val *UpdateWAFResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateWAFResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateWAFResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateWAFResponse(val *UpdateWAFResponse) *NullableUpdateWAFResponse { - return &NullableUpdateWAFResponse{value: val, isSet: true} -} - -func (v NullableUpdateWAFResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateWAFResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/albwaf/v1betaapi/model_behaviour.go b/services/albwaf/v1betaapi/model_behaviour.go index dce0208ca..92d449905 100644 --- a/services/albwaf/v1betaapi/model_behaviour.go +++ b/services/albwaf/v1betaapi/model_behaviour.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the Behaviour type satisfies the MappedNullable interface at compile time @@ -19,7 +20,7 @@ var _ MappedNullable = &Behaviour{} // Behaviour struct for Behaviour type Behaviour struct { - Action *BehaviourAction `json:"action,omitempty"` + Action BehaviourAction `json:"action"` // 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. @@ -33,8 +34,9 @@ type _Behaviour Behaviour // 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 { +func NewBehaviour(action BehaviourAction) *Behaviour { this := Behaviour{} + this.Action = action return &this } @@ -46,36 +48,28 @@ func NewBehaviourWithDefaults() *Behaviour { return &this } -// GetAction returns the Action field value if set, zero value otherwise. +// GetAction returns the Action field value func (o *Behaviour) GetAction() BehaviourAction { - if o == nil || IsNil(o.Action) { + if o == nil { var ret BehaviourAction return ret } - return *o.Action + + return o.Action } -// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// GetActionOk returns a tuple with the Action field value // and a boolean to check if the value has been set. func (o *Behaviour) GetActionOk() (*BehaviourAction, bool) { - if o == nil || IsNil(o.Action) { + if o == nil { return nil, false } - return o.Action, true + 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. +// SetAction sets field value func (o *Behaviour) SetAction(v BehaviourAction) { - o.Action = &v + o.Action = v } // GetLog returns the Log field value if set, zero value otherwise. @@ -152,9 +146,7 @@ func (o Behaviour) MarshalJSON() ([]byte, error) { func (o Behaviour) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Action) { - toSerialize["action"] = o.Action - } + toSerialize["action"] = o.Action if !IsNil(o.Log) { toSerialize["log"] = o.Log } @@ -170,6 +162,27 @@ func (o Behaviour) ToMap() (map[string]interface{}, error) { } func (o *Behaviour) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varBehaviour := _Behaviour{} err = json.Unmarshal(data, &varBehaviour) diff --git a/services/albwaf/v1betaapi/model_condition.go b/services/albwaf/v1betaapi/model_condition.go index 3681f1d46..d7a7ad5ef 100644 --- a/services/albwaf/v1betaapi/model_condition.go +++ b/services/albwaf/v1betaapi/model_condition.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the Condition type satisfies the MappedNullable interface at compile time @@ -19,10 +20,10 @@ var _ MappedNullable = &Condition{} // Condition struct for Condition type Condition struct { - Operator *ConditionOperator `json:"operator,omitempty"` + Operator ConditionOperator `json:"operator"` // [HINT] Ordered processing adjustments applied to clean inputs before match checking. Transformations []ConditionTransformationsInner `json:"transformations,omitempty"` - Variable *ConditionVariable `json:"variable,omitempty"` + Variable ConditionVariable `json:"variable"` AdditionalProperties map[string]interface{} } @@ -32,8 +33,10 @@ type _Condition Condition // 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 { +func NewCondition(operator ConditionOperator, variable ConditionVariable) *Condition { this := Condition{} + this.Operator = operator + this.Variable = variable return &this } @@ -45,36 +48,28 @@ func NewConditionWithDefaults() *Condition { return &this } -// GetOperator returns the Operator field value if set, zero value otherwise. +// GetOperator returns the Operator field value func (o *Condition) GetOperator() ConditionOperator { - if o == nil || IsNil(o.Operator) { + if o == nil { var ret ConditionOperator return ret } - return *o.Operator + + return o.Operator } -// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// GetOperatorOk returns a tuple with the Operator field value // and a boolean to check if the value has been set. func (o *Condition) GetOperatorOk() (*ConditionOperator, bool) { - if o == nil || IsNil(o.Operator) { + if o == nil { 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 + return &o.Operator, true } -// SetOperator gets a reference to the given ConditionOperator and assigns it to the Operator field. +// SetOperator sets field value func (o *Condition) SetOperator(v ConditionOperator) { - o.Operator = &v + o.Operator = v } // GetTransformations returns the Transformations field value if set, zero value otherwise. @@ -109,36 +104,28 @@ func (o *Condition) SetTransformations(v []ConditionTransformationsInner) { o.Transformations = v } -// GetVariable returns the Variable field value if set, zero value otherwise. +// GetVariable returns the Variable field value func (o *Condition) GetVariable() ConditionVariable { - if o == nil || IsNil(o.Variable) { + if o == nil { var ret ConditionVariable return ret } - return *o.Variable + + return o.Variable } -// GetVariableOk returns a tuple with the Variable field value if set, nil otherwise +// GetVariableOk returns a tuple with the Variable field value // and a boolean to check if the value has been set. func (o *Condition) GetVariableOk() (*ConditionVariable, bool) { - if o == nil || IsNil(o.Variable) { + if o == nil { 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 + return &o.Variable, true } -// SetVariable gets a reference to the given ConditionVariable and assigns it to the Variable field. +// SetVariable sets field value func (o *Condition) SetVariable(v ConditionVariable) { - o.Variable = &v + o.Variable = v } func (o Condition) MarshalJSON() ([]byte, error) { @@ -151,15 +138,11 @@ func (o Condition) MarshalJSON() ([]byte, error) { func (o Condition) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Operator) { - toSerialize["operator"] = o.Operator - } + toSerialize["operator"] = o.Operator if !IsNil(o.Transformations) { toSerialize["transformations"] = o.Transformations } - if !IsNil(o.Variable) { - toSerialize["variable"] = o.Variable - } + toSerialize["variable"] = o.Variable for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -169,6 +152,28 @@ func (o Condition) ToMap() (map[string]interface{}, error) { } func (o *Condition) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "operator", + "variable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varCondition := _Condition{} err = json.Unmarshal(data, &varCondition) diff --git a/services/albwaf/v1betaapi/model_condition_operator.go b/services/albwaf/v1betaapi/model_condition_operator.go index b7aa8f70e..bd96f9ec7 100644 --- a/services/albwaf/v1betaapi/model_condition_operator.go +++ b/services/albwaf/v1betaapi/model_condition_operator.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the ConditionOperator type satisfies the MappedNullable interface at compile time @@ -19,7 +20,7 @@ var _ MappedNullable = &ConditionOperator{} // ConditionOperator struct for ConditionOperator type ConditionOperator struct { - Type *ConditionOperatorType `json:"type,omitempty"` + Type ConditionOperatorType `json:"type"` // The text or rule regex pattern arguments applied inside the operator execution loop. Value *string `json:"value,omitempty"` AdditionalProperties map[string]interface{} @@ -31,8 +32,9 @@ type _ConditionOperator ConditionOperator // 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 { +func NewConditionOperator(types ConditionOperatorType) *ConditionOperator { this := ConditionOperator{} + this.Type = types return &this } @@ -44,36 +46,28 @@ func NewConditionOperatorWithDefaults() *ConditionOperator { return &this } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *ConditionOperator) GetType() ConditionOperatorType { - if o == nil || IsNil(o.Type) { + if o == nil { var ret ConditionOperatorType return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *ConditionOperator) GetTypeOk() (*ConditionOperatorType, bool) { - if o == nil || IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + 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. +// SetType sets field value func (o *ConditionOperator) SetType(v ConditionOperatorType) { - o.Type = &v + o.Type = v } // GetValue returns the Value field value if set, zero value otherwise. @@ -118,9 +112,7 @@ func (o ConditionOperator) MarshalJSON() ([]byte, error) { func (o ConditionOperator) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["type"] = o.Type if !IsNil(o.Value) { toSerialize["value"] = o.Value } @@ -133,6 +125,27 @@ func (o ConditionOperator) ToMap() (map[string]interface{}, error) { } func (o *ConditionOperator) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varConditionOperator := _ConditionOperator{} err = json.Unmarshal(data, &varConditionOperator) diff --git a/services/albwaf/v1betaapi/model_condition_variable.go b/services/albwaf/v1betaapi/model_condition_variable.go index 10aa179c1..7ef292f8d 100644 --- a/services/albwaf/v1betaapi/model_condition_variable.go +++ b/services/albwaf/v1betaapi/model_condition_variable.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the ConditionVariable type satisfies the MappedNullable interface at compile time @@ -19,7 +20,7 @@ var _ MappedNullable = &ConditionVariable{} // ConditionVariable struct for ConditionVariable type ConditionVariable struct { - Type *ConditionVariableType `json:"type,omitempty"` + Type ConditionVariableType `json:"type"` // Optional key element context for map variables (e.g., matching a 'Host' header key). Value *string `json:"value,omitempty"` AdditionalProperties map[string]interface{} @@ -31,8 +32,9 @@ type _ConditionVariable ConditionVariable // 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 { +func NewConditionVariable(types ConditionVariableType) *ConditionVariable { this := ConditionVariable{} + this.Type = types return &this } @@ -44,36 +46,28 @@ func NewConditionVariableWithDefaults() *ConditionVariable { return &this } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *ConditionVariable) GetType() ConditionVariableType { - if o == nil || IsNil(o.Type) { + if o == nil { var ret ConditionVariableType return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *ConditionVariable) GetTypeOk() (*ConditionVariableType, bool) { - if o == nil || IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + 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. +// SetType sets field value func (o *ConditionVariable) SetType(v ConditionVariableType) { - o.Type = &v + o.Type = v } // GetValue returns the Value field value if set, zero value otherwise. @@ -118,9 +112,7 @@ func (o ConditionVariable) MarshalJSON() ([]byte, error) { func (o ConditionVariable) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["type"] = o.Type if !IsNil(o.Value) { toSerialize["value"] = o.Value } @@ -133,6 +125,27 @@ func (o ConditionVariable) ToMap() (map[string]interface{}, error) { } func (o *ConditionVariable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varConditionVariable := _ConditionVariable{} err = json.Unmarshal(data, &varConditionVariable) diff --git a/services/albwaf/v1betaapi/model_create_custom_rule.go b/services/albwaf/v1betaapi/model_create_custom_rule.go index fabe2168b..67de23467 100644 --- a/services/albwaf/v1betaapi/model_create_custom_rule.go +++ b/services/albwaf/v1betaapi/model_create_custom_rule.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the CreateCustomRule type satisfies the MappedNullable interface at compile time @@ -19,9 +20,9 @@ var _ MappedNullable = &CreateCustomRule{} // CreateCustomRule struct for CreateCustomRule type CreateCustomRule struct { - Behaviour *Behaviour `json:"behaviour,omitempty"` + Behaviour Behaviour `json:"behaviour"` // [HINT] Order matters! First condition match triggers execution. - Conditions []Condition `json:"conditions,omitempty"` + Conditions []Condition `json:"conditions"` // A clear description explaining the threat vector or criteria addressed by this rule. Description *string `json:"description,omitempty"` AdditionalProperties map[string]interface{} @@ -33,8 +34,10 @@ type _CreateCustomRule CreateCustomRule // 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 { +func NewCreateCustomRule(behaviour Behaviour, conditions []Condition) *CreateCustomRule { this := CreateCustomRule{} + this.Behaviour = behaviour + this.Conditions = conditions return &this } @@ -46,66 +49,50 @@ func NewCreateCustomRuleWithDefaults() *CreateCustomRule { return &this } -// GetBehaviour returns the Behaviour field value if set, zero value otherwise. +// GetBehaviour returns the Behaviour field value func (o *CreateCustomRule) GetBehaviour() Behaviour { - if o == nil || IsNil(o.Behaviour) { + if o == nil { var ret Behaviour return ret } - return *o.Behaviour + + return o.Behaviour } -// GetBehaviourOk returns a tuple with the Behaviour field value if set, nil otherwise +// GetBehaviourOk returns a tuple with the Behaviour field value // and a boolean to check if the value has been set. func (o *CreateCustomRule) GetBehaviourOk() (*Behaviour, bool) { - if o == nil || IsNil(o.Behaviour) { + if o == nil { 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 + return &o.Behaviour, true } -// SetBehaviour gets a reference to the given Behaviour and assigns it to the Behaviour field. +// SetBehaviour sets field value func (o *CreateCustomRule) SetBehaviour(v Behaviour) { - o.Behaviour = &v + o.Behaviour = v } -// GetConditions returns the Conditions field value if set, zero value otherwise. +// GetConditions returns the Conditions field value func (o *CreateCustomRule) GetConditions() []Condition { - if o == nil || IsNil(o.Conditions) { + if o == nil { var ret []Condition return ret } + return o.Conditions } -// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// GetConditionsOk returns a tuple with the Conditions field value // and a boolean to check if the value has been set. func (o *CreateCustomRule) GetConditionsOk() ([]Condition, bool) { - if o == nil || IsNil(o.Conditions) { + if o == nil { 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. +// SetConditions sets field value func (o *CreateCustomRule) SetConditions(v []Condition) { o.Conditions = v } @@ -152,12 +139,8 @@ func (o CreateCustomRule) MarshalJSON() ([]byte, error) { 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 - } + toSerialize["behaviour"] = o.Behaviour + toSerialize["conditions"] = o.Conditions if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -170,6 +153,28 @@ func (o CreateCustomRule) ToMap() (map[string]interface{}, error) { } func (o *CreateCustomRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "behaviour", + "conditions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varCreateCustomRule := _CreateCustomRule{} err = json.Unmarshal(data, &varCreateCustomRule) diff --git a/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go b/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go index f808d341f..1fde754d5 100644 --- a/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go +++ b/services/albwaf/v1betaapi/model_create_custom_rule_group_payload.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the CreateCustomRuleGroupPayload type satisfies the MappedNullable interface at compile time @@ -20,13 +21,13 @@ 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])?$"` + Name string `json:"name" 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"` + Rules []CreateCustomRule `json:"rules"` AdditionalProperties map[string]interface{} } @@ -36,8 +37,10 @@ type _CreateCustomRuleGroupPayload CreateCustomRuleGroupPayload // 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 { +func NewCreateCustomRuleGroupPayload(name string, rules []CreateCustomRule) *CreateCustomRuleGroupPayload { this := CreateCustomRuleGroupPayload{} + this.Name = name + this.Rules = rules return &this } @@ -49,36 +52,28 @@ func NewCreateCustomRuleGroupPayloadWithDefaults() *CreateCustomRuleGroupPayload return &this } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *CreateCustomRuleGroupPayload) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *CreateCustomRuleGroupPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { 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 + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *CreateCustomRuleGroupPayload) SetName(v string) { - o.Name = &v + o.Name = v } // GetProjectId returns the ProjectId field value if set, zero value otherwise. @@ -145,34 +140,26 @@ func (o *CreateCustomRuleGroupPayload) SetRegion(v string) { o.Region = &v } -// GetRules returns the Rules field value if set, zero value otherwise. +// GetRules returns the Rules field value func (o *CreateCustomRuleGroupPayload) GetRules() []CreateCustomRule { - if o == nil || IsNil(o.Rules) { + if o == nil { var ret []CreateCustomRule return ret } + return o.Rules } -// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// GetRulesOk returns a tuple with the Rules field value // and a boolean to check if the value has been set. func (o *CreateCustomRuleGroupPayload) GetRulesOk() ([]CreateCustomRule, bool) { - if o == nil || IsNil(o.Rules) { + if o == nil { 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. +// SetRules sets field value func (o *CreateCustomRuleGroupPayload) SetRules(v []CreateCustomRule) { o.Rules = v } @@ -187,18 +174,14 @@ func (o CreateCustomRuleGroupPayload) MarshalJSON() ([]byte, error) { func (o CreateCustomRuleGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = 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 - } + toSerialize["rules"] = o.Rules for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -208,6 +191,28 @@ func (o CreateCustomRuleGroupPayload) ToMap() (map[string]interface{}, error) { } func (o *CreateCustomRuleGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "rules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varCreateCustomRuleGroupPayload := _CreateCustomRuleGroupPayload{} err = json.Unmarshal(data, &varCreateCustomRuleGroupPayload) diff --git a/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go b/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go index 825addfd0..a32682f8a 100644 --- a/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go +++ b/services/albwaf/v1betaapi/model_create_managed_rule_set_payload.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the CreateManagedRuleSetPayload type satisfies the MappedNullable interface at compile time @@ -20,12 +21,12 @@ 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])?$"` + Name string `json:"name" 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"` + Region *string `json:"region,omitempty" validate:"regexp=^[a-z]{2,4}[0-9]{2}$"` + Type MRSType `json:"type"` AdditionalProperties map[string]interface{} } @@ -35,8 +36,10 @@ type _CreateManagedRuleSetPayload CreateManagedRuleSetPayload // 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 { +func NewCreateManagedRuleSetPayload(name string, types MRSType) *CreateManagedRuleSetPayload { this := CreateManagedRuleSetPayload{} + this.Name = name + this.Type = types return &this } @@ -48,36 +51,28 @@ func NewCreateManagedRuleSetPayloadWithDefaults() *CreateManagedRuleSetPayload { return &this } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *CreateManagedRuleSetPayload) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *CreateManagedRuleSetPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { 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 + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *CreateManagedRuleSetPayload) SetName(v string) { - o.Name = &v + o.Name = v } // GetProjectId returns the ProjectId field value if set, zero value otherwise. @@ -144,36 +139,28 @@ func (o *CreateManagedRuleSetPayload) SetRegion(v string) { o.Region = &v } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *CreateManagedRuleSetPayload) GetType() MRSType { - if o == nil || IsNil(o.Type) { + if o == nil { var ret MRSType return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *CreateManagedRuleSetPayload) GetTypeOk() (*MRSType, bool) { - if o == nil || IsNil(o.Type) { + if o == nil { 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 + return &o.Type, true } -// SetType gets a reference to the given MRSType and assigns it to the Type field. +// SetType sets field value func (o *CreateManagedRuleSetPayload) SetType(v MRSType) { - o.Type = &v + o.Type = v } func (o CreateManagedRuleSetPayload) MarshalJSON() ([]byte, error) { @@ -186,18 +173,14 @@ func (o CreateManagedRuleSetPayload) MarshalJSON() ([]byte, error) { func (o CreateManagedRuleSetPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = 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 - } + toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -207,6 +190,28 @@ func (o CreateManagedRuleSetPayload) ToMap() (map[string]interface{}, error) { } func (o *CreateManagedRuleSetPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varCreateManagedRuleSetPayload := _CreateManagedRuleSetPayload{} err = json.Unmarshal(data, &varCreateManagedRuleSetPayload) diff --git a/services/albwaf/v1betaapi/model_create_waf_payload.go b/services/albwaf/v1betaapi/model_create_waf_payload.go index baa033bdc..769493c73 100644 --- a/services/albwaf/v1betaapi/model_create_waf_payload.go +++ b/services/albwaf/v1betaapi/model_create_waf_payload.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the CreateWAFPayload type satisfies the MappedNullable interface at compile time @@ -26,7 +27,7 @@ type CreateWAFPayload struct { // 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])?$"` + Name string `json:"name" 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 @@ -40,8 +41,9 @@ type _CreateWAFPayload CreateWAFPayload // 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 { +func NewCreateWAFPayload(name string) *CreateWAFPayload { this := CreateWAFPayload{} + this.Name = name return &this } @@ -149,36 +151,28 @@ func (o *CreateWAFPayload) SetManagedRuleSetName(v string) { o.ManagedRuleSetName = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *CreateWAFPayload) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *CreateWAFPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + 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. +// SetName sets field value func (o *CreateWAFPayload) SetName(v string) { - o.Name = &v + o.Name = v } // GetProjectId returns the ProjectId field value if set, zero value otherwise. @@ -264,9 +258,7 @@ func (o CreateWAFPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.ManagedRuleSetName) { toSerialize["managedRuleSetName"] = o.ManagedRuleSetName } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.ProjectId) { toSerialize["projectId"] = o.ProjectId } @@ -282,6 +274,27 @@ func (o CreateWAFPayload) ToMap() (map[string]interface{}, error) { } func (o *CreateWAFPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varCreateWAFPayload := _CreateWAFPayload{} err = json.Unmarshal(data, &varCreateWAFPayload) diff --git a/services/albwaf/v1betaapi/model_mrs_rule.go b/services/albwaf/v1betaapi/model_mrs_rule.go index 11d5bca62..af255f790 100644 --- a/services/albwaf/v1betaapi/model_mrs_rule.go +++ b/services/albwaf/v1betaapi/model_mrs_rule.go @@ -19,7 +19,7 @@ var _ MappedNullable = &MRSRule{} // MRSRule Rule represents an individual security or validation rule. type MRSRule struct { - // SQL Injection Attack Detected via libinjection + // A description of what this rule covers. Description *string `json:"description,omitempty"` Mode *Mode `json:"mode,omitempty"` // Impact level. diff --git a/services/albwaf/v1betaapi/model_update_waf_payload.go b/services/albwaf/v1betaapi/model_update_waf_payload.go index bcb083f29..2c85afda8 100644 --- a/services/albwaf/v1betaapi/model_update_waf_payload.go +++ b/services/albwaf/v1betaapi/model_update_waf_payload.go @@ -12,6 +12,7 @@ package v1betaapi import ( "encoding/json" + "fmt" ) // checks if the UpdateWAFPayload type satisfies the MappedNullable interface at compile time @@ -26,7 +27,7 @@ type UpdateWAFPayload struct { // 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])?$"` + Name string `json:"name" 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 @@ -40,8 +41,9 @@ type _UpdateWAFPayload UpdateWAFPayload // 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 { +func NewUpdateWAFPayload(name string) *UpdateWAFPayload { this := UpdateWAFPayload{} + this.Name = name return &this } @@ -149,36 +151,28 @@ func (o *UpdateWAFPayload) SetManagedRuleSetName(v string) { o.ManagedRuleSetName = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *UpdateWAFPayload) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *UpdateWAFPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true + 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. +// SetName sets field value func (o *UpdateWAFPayload) SetName(v string) { - o.Name = &v + o.Name = v } // GetProjectId returns the ProjectId field value if set, zero value otherwise. @@ -264,9 +258,7 @@ func (o UpdateWAFPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.ManagedRuleSetName) { toSerialize["managedRuleSetName"] = o.ManagedRuleSetName } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.ProjectId) { toSerialize["projectId"] = o.ProjectId } @@ -282,6 +274,27 @@ func (o UpdateWAFPayload) ToMap() (map[string]interface{}, error) { } func (o *UpdateWAFPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varUpdateWAFPayload := _UpdateWAFPayload{} err = json.Unmarshal(data, &varUpdateWAFPayload)