# DDoS Protection # Advanced TCP Protection # Allowlist ## List all allowlist prefixes. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionAllowlistListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist` List all allowlist prefixes for an account. ### Parameters - `params AdvancedTCPProtectionAllowlistListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionAllowlistListResponse struct{…}` - `ID string` The unique ID of the allowlist prefix. - `Comment string` An optional comment describing the allowlist prefix. - `CreatedOn Time` The creation timestamp of the allowlist prefix. - `Enabled bool` Whether to enable the allowlist prefix into effect. Defaults to false. - `ModifiedOn Time` The last modification timestamp of the allowlist prefix. - `Prefix string` The allowlist prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.List(context.TODO(), ddos_protection.AdvancedTCPProtectionAllowlistListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "enabled": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "prefix" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create allowlist prefix. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.New(ctx, params) (*AdvancedTCPProtectionAllowlistNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist` Create an allowlist prefix for an account. ### Parameters - `params AdvancedTCPProtectionAllowlistNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Comment param.Field[string]` Body param: An comment describing the allowlist prefix. - `Enabled param.Field[bool]` Body param: Whether to enable the allowlist prefix into effect. - `Prefix param.Field[string]` Body param: The allowlist prefix to add in CIDR format. ### Returns - `type AdvancedTCPProtectionAllowlistNewResponse struct{…}` - `ID string` The unique ID of the allowlist prefix. - `Comment string` An optional comment describing the allowlist prefix. - `CreatedOn Time` The creation timestamp of the allowlist prefix. - `Enabled bool` Whether to enable the allowlist prefix into effect. Defaults to false. - `ModifiedOn Time` The last modification timestamp of the allowlist prefix. - `Prefix string` The allowlist prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) allowlist, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.New(context.TODO(), ddos_protection.AdvancedTCPProtectionAllowlistNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Comment: cloudflare.F("comment"), Enabled: cloudflare.F(true), Prefix: cloudflare.F("prefix"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", allowlist.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "enabled": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "prefix" } } ``` ## Delete all allowlist prefixes. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.BulkDelete(ctx, body) (*AdvancedTCPProtectionAllowlistBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist` Delete all allowlist prefixes for an account. ### Parameters - `body AdvancedTCPProtectionAllowlistBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionAllowlistBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionAllowlistBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionAllowlistBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionAllowlistBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionAllowlistBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionAllowlistBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionAllowlistBulkDeleteResponseSuccessTrue AdvancedTCPProtectionAllowlistBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionAllowlistBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Items ## Get allowlist prefix. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Get(ctx, prefixID, query) (*AdvancedTCPProtectionAllowlistItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist/{prefix_id}` Get an allowlist prefix specified by the given UUID. ### Parameters - `prefixID string` UUID. - `query AdvancedTCPProtectionAllowlistItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionAllowlistItemGetResponse struct{…}` - `ID string` The unique ID of the allowlist prefix. - `Comment string` An optional comment describing the allowlist prefix. - `CreatedOn Time` The creation timestamp of the allowlist prefix. - `Enabled bool` Whether to enable the allowlist prefix into effect. Defaults to false. - `ModifiedOn Time` The last modification timestamp of the allowlist prefix. - `Prefix string` The allowlist prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionAllowlistItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "enabled": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "prefix" } } ``` ## Update allowlist prefix. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Edit(ctx, prefixID, params) (*AdvancedTCPProtectionAllowlistItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist/{prefix_id}` Update an allowlist prefix specified by the given UUID. ### Parameters - `prefixID string` UUID. - `params AdvancedTCPProtectionAllowlistItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Comment param.Field[string]` Body param: A comment describing the allowlist prefix. Optional. - `Enabled param.Field[bool]` Body param: Whether to enable the allowlist prefix into effect. Optional. ### Returns - `type AdvancedTCPProtectionAllowlistItemEditResponse struct{…}` - `ID string` The unique ID of the allowlist prefix. - `Comment string` An optional comment describing the allowlist prefix. - `CreatedOn Time` The creation timestamp of the allowlist prefix. - `Enabled bool` Whether to enable the allowlist prefix into effect. Defaults to false. - `ModifiedOn Time` The last modification timestamp of the allowlist prefix. - `Prefix string` The allowlist prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionAllowlistItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "enabled": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "prefix" } } ``` ## Delete allowlist prefix. `client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Delete(ctx, prefixID, body) (*AdvancedTCPProtectionAllowlistItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/allowlist/{prefix_id}` Delete the allowlist prefix for an account given a UUID. ### Parameters - `prefixID string` UUID. - `body AdvancedTCPProtectionAllowlistItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionAllowlistItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionAllowlistItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionAllowlistItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionAllowlistItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionAllowlistItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionAllowlistItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionAllowlistItemDeleteResponseSuccessTrue AdvancedTCPProtectionAllowlistItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.Allowlist.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionAllowlistItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Prefixes ## List all prefixes. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionPrefixListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes` List all prefixes for an account. ### Parameters - `params AdvancedTCPProtectionPrefixListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionPrefixListResponse struct{…}` - `ID string` The unique ID of the prefix. - `Comment string` A comment describing the prefix. - `CreatedOn Time` The creation timestamp of the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `ModifiedOn Time` The last modification timestamp of the prefix. - `Prefix string` The prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.List(context.TODO(), ddos_protection.AdvancedTCPProtectionPrefixListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "excluded": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "192.0.2.0/24" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create prefix. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.New(ctx, params) (*AdvancedTCPProtectionPrefixNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes` Create a prefix for an account. ### Parameters - `params AdvancedTCPProtectionPrefixNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Comment param.Field[string]` Body param: A comment describing the prefix. - `Excluded param.Field[bool]` Body param: Whether to exclude the prefix from protection. - `Prefix param.Field[string]` Body param: The prefix to add in CIDR format. ### Returns - `type AdvancedTCPProtectionPrefixNewResponse struct{…}` - `ID string` The unique ID of the prefix. - `Comment string` A comment describing the prefix. - `CreatedOn Time` The creation timestamp of the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `ModifiedOn Time` The last modification timestamp of the prefix. - `Prefix string` The prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) prefix, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.New(context.TODO(), ddos_protection.AdvancedTCPProtectionPrefixNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Comment: cloudflare.F("comment"), Excluded: cloudflare.F(true), Prefix: cloudflare.F("192.0.2.0/24"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", prefix.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "excluded": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "192.0.2.0/24" } } ``` ## Delete all prefixes. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.BulkDelete(ctx, body) (*AdvancedTCPProtectionPrefixBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes` Delete all prefixes for an account. ### Parameters - `body AdvancedTCPProtectionPrefixBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionPrefixBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionPrefixBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionPrefixBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionPrefixBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionPrefixBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionPrefixBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionPrefixBulkDeleteResponseSuccessTrue AdvancedTCPProtectionPrefixBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionPrefixBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Create multiple prefixes. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.BulkNew(ctx, params) (*SinglePage[AdvancedTCPProtectionPrefixBulkNewResponse], error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes/bulk` Create multiple prefixes for an account. ### Parameters - `params AdvancedTCPProtectionPrefixBulkNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Body param.Field[[]AdvancedTCPProtectionPrefixBulkNewParamsBody]` Body param - `Comment string` A comment describing the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `Prefix string` The prefix to add in CIDR format. ### Returns - `type AdvancedTCPProtectionPrefixBulkNewResponse struct{…}` - `ID string` The unique ID of the prefix. - `Comment string` A comment describing the prefix. - `CreatedOn Time` The creation timestamp of the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `ModifiedOn Time` The last modification timestamp of the prefix. - `Prefix string` The prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.BulkNew(context.TODO(), ddos_protection.AdvancedTCPProtectionPrefixBulkNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: []ddos_protection.AdvancedTCPProtectionPrefixBulkNewParamsBody{ddos_protection.AdvancedTCPProtectionPrefixBulkNewParamsBody{ Comment: cloudflare.F("comment"), Excluded: cloudflare.F(true), Prefix: cloudflare.F("192.0.2.0/24"), }}, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "excluded": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "192.0.2.0/24" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` # Items ## Get prefix. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Get(ctx, prefixID, query) (*AdvancedTCPProtectionPrefixItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes/{prefix_id}` Get a prefix specified by the given UUID. ### Parameters - `prefixID string` UUID. - `query AdvancedTCPProtectionPrefixItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionPrefixItemGetResponse struct{…}` - `ID string` The unique ID of the prefix. - `Comment string` A comment describing the prefix. - `CreatedOn Time` The creation timestamp of the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `ModifiedOn Time` The last modification timestamp of the prefix. - `Prefix string` The prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionPrefixItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "excluded": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "192.0.2.0/24" } } ``` ## Update prefix. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Edit(ctx, prefixID, params) (*AdvancedTCPProtectionPrefixItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes/{prefix_id}` Update a prefix specified by the given UUID. ### Parameters - `prefixID string` UUID. - `params AdvancedTCPProtectionPrefixItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Comment param.Field[string]` Body param: A new comment for the prefix. Optional. - `Excluded param.Field[bool]` Body param: Whether to exclude the prefix from protection. Optional. ### Returns - `type AdvancedTCPProtectionPrefixItemEditResponse struct{…}` - `ID string` The unique ID of the prefix. - `Comment string` A comment describing the prefix. - `CreatedOn Time` The creation timestamp of the prefix. - `Excluded bool` Whether to exclude the prefix from protection. - `ModifiedOn Time` The last modification timestamp of the prefix. - `Prefix string` The prefix in CIDR format. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionPrefixItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "comment": "comment", "created_on": "2019-12-27T18:11:19.117Z", "excluded": true, "modified_on": "2019-12-27T18:11:19.117Z", "prefix": "192.0.2.0/24" } } ``` ## Delete prefix. `client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Delete(ctx, prefixID, body) (*AdvancedTCPProtectionPrefixItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/prefixes/{prefix_id}` Delete the prefix for an account given a UUID. ### Parameters - `prefixID string` UUID. - `body AdvancedTCPProtectionPrefixItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionPrefixItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionPrefixItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionPrefixItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionPrefixItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionPrefixItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionPrefixItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionPrefixItemDeleteResponseSuccessTrue AdvancedTCPProtectionPrefixItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.Prefixes.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionPrefixItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # SYN Protection # Filters ## List all SYN Protection filters. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionSynProtectionFilterListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters` List all SYN Protection filters for an account. ### Parameters - `params AdvancedTCPProtectionSynProtectionFilterListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Mode param.Field[string]` Query param: The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterListResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.List(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionFilterListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create a SYN Protection filter. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.New(ctx, params) (*AdvancedTCPProtectionSynProtectionFilterNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters` Create a SYN Protection filter for an account. ### Parameters - `params AdvancedTCPProtectionSynProtectionFilterNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Expression param.Field[string]` Body param: The filter expression. - `Mode param.Field[string]` Body param: The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterNewResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) filter, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.New(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionFilterNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Expression: cloudflare.F("ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }"), Mode: cloudflare.F("mode"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", filter.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Delete all SYN Protection filters. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.BulkDelete(ctx, body) (*AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters` Delete all SYN Protection filters for an account. ### Parameters - `body AdvancedTCPProtectionSynProtectionFilterBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseSuccessTrue AdvancedTCPProtectionSynProtectionFilterBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionFilterBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Items ## Get SYN Protection filter. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Get(ctx, filterID, query) (*AdvancedTCPProtectionSynProtectionFilterItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/{filter_id}` Get a SYN Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `query AdvancedTCPProtectionSynProtectionFilterItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterItemGetResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionFilterItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Update SYN Protection filter. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Edit(ctx, filterID, params) (*AdvancedTCPProtectionSynProtectionFilterItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/{filter_id}` Update a SYN Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `params AdvancedTCPProtectionSynProtectionFilterItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Expression param.Field[string]` Body param: The new filter expression. Optional. - `Mode param.Field[string]` Body param: The new mode for the filter. Optional. Must be one of 'enabled', 'disabled', 'monitoring'. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterItemEditResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionFilterItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Delete SYN Protection filter. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Delete(ctx, filterID, body) (*AdvancedTCPProtectionSynProtectionFilterItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/{filter_id}` Delete a SYN Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `body AdvancedTCPProtectionSynProtectionFilterItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionFilterItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseSuccessTrue AdvancedTCPProtectionSynProtectionFilterItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Filters.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionFilterItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Rules ## List all SYN Protection rules. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionSynProtectionRuleListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules` List all SYN Protection rules for an account. ### Parameters - `params AdvancedTCPProtectionSynProtectionRuleListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleListResponse struct{…}` - `ID string` The unique ID of the SYN Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the SYN Protection rule. - `MitigationType string` The type of mitigation for SYN Protection. Must be one of 'challenge' or 'retransmit'. - `Mode string` The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the SYN Protection rule. - `Name string` The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.List(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionRuleListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mitigation_type": "mitigation_type", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create SYN Protection rule. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.New(ctx, params) (*AdvancedTCPProtectionSynProtectionRuleNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules` Create a SYN Protection rule for an account. ### Parameters - `params AdvancedTCPProtectionSynProtectionRuleNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `BurstSensitivity param.Field[string]` Body param: The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `Mode param.Field[string]` Body param: The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `Name param.Field[string]` Body param: The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity param.Field[string]` Body param: The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope param.Field[string]` Body param: The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'. - `MitigationType param.Field[string]` Body param: The type of mitigation. Must be one of 'challenge' or 'retransmit'. Optional. Defaults to 'challenge'. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleNewResponse struct{…}` - `ID string` The unique ID of the SYN Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the SYN Protection rule. - `MitigationType string` The type of mitigation for SYN Protection. Must be one of 'challenge' or 'retransmit'. - `Mode string` The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the SYN Protection rule. - `Name string` The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.New(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionRuleNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), BurstSensitivity: cloudflare.F("burst_sensitivity"), Mode: cloudflare.F("mode"), Name: cloudflare.F("name"), RateSensitivity: cloudflare.F("rate_sensitivity"), Scope: cloudflare.F("scope"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", rule.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mitigation_type": "mitigation_type", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Delete all SYN Protection rules. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.BulkDelete(ctx, body) (*AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules` Delete all SYN Protection rules for an account. ### Parameters - `body AdvancedTCPProtectionSynProtectionRuleBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseSuccessTrue AdvancedTCPProtectionSynProtectionRuleBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionSynProtectionRuleBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Items ## Get SYN Protection rule. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Get(ctx, ruleID, query) (*AdvancedTCPProtectionSynProtectionRuleItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/{rule_id}` Get a SYN Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `query AdvancedTCPProtectionSynProtectionRuleItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleItemGetResponse struct{…}` - `ID string` The unique ID of the SYN Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the SYN Protection rule. - `MitigationType string` The type of mitigation for SYN Protection. Must be one of 'challenge' or 'retransmit'. - `Mode string` The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the SYN Protection rule. - `Name string` The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionRuleItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mitigation_type": "mitigation_type", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Update SYN Protection rule. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Edit(ctx, ruleID, params) (*AdvancedTCPProtectionSynProtectionRuleItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/{rule_id}` Update a SYN Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `params AdvancedTCPProtectionSynProtectionRuleItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `BurstSensitivity param.Field[string]` Body param: The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'. - `MitigationType param.Field[string]` Body param: The new mitigation type. Optional. Must be one of 'challenge' or 'retransmit'. - `Mode param.Field[string]` Body param: The new mode for SYN Protection. Optional. Must be one of 'enabled', 'disabled', 'monitoring'. - `RateSensitivity param.Field[string]` Body param: The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleItemEditResponse struct{…}` - `ID string` The unique ID of the SYN Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the SYN Protection rule. - `MitigationType string` The type of mitigation for SYN Protection. Must be one of 'challenge' or 'retransmit'. - `Mode string` The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the SYN Protection rule. - `Name string` The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionRuleItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mitigation_type": "mitigation_type", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Delete SYN Protection rule. `client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Delete(ctx, ruleID, body) (*AdvancedTCPProtectionSynProtectionRuleItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/{rule_id}` Delete a SYN Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `body AdvancedTCPProtectionSynProtectionRuleItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionSynProtectionRuleItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseSuccessTrue AdvancedTCPProtectionSynProtectionRuleItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.SynProtection.Rules.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionSynProtectionRuleItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # TCP Flow Protection # Filters ## List all TCP Flow Protection filters. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionTCPFlowProtectionFilterListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters` List all TCP Flow Protection filters for an account. ### Parameters - `params AdvancedTCPProtectionTCPFlowProtectionFilterListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Mode param.Field[string]` Query param: The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterListResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.List(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create a TCP Flow Protection filter. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.New(ctx, params) (*AdvancedTCPProtectionTCPFlowProtectionFilterNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters` Create a TCP Flow Protection filter for an account. ### Parameters - `params AdvancedTCPProtectionTCPFlowProtectionFilterNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `Expression param.Field[string]` Body param: The filter expression. - `Mode param.Field[string]` Body param: The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterNewResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) filter, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.New(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Expression: cloudflare.F("ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }"), Mode: cloudflare.F("mode"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", filter.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Delete all TCP Flow Protection filters. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.BulkDelete(ctx, body) (*AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters` Delete all TCP Flow Protection filters for an account. ### Parameters - `body AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseSuccessTrue AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Items ## Get TCP Flow Protection filter. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Get(ctx, filterID, query) (*AdvancedTCPProtectionTCPFlowProtectionFilterItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/{filter_id}` Get a TCP Flow Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `query AdvancedTCPProtectionTCPFlowProtectionFilterItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterItemGetResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Update TCP Flow Protection filter. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Edit(ctx, filterID, params) (*AdvancedTCPProtectionTCPFlowProtectionFilterItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/{filter_id}` Update a TCP Flow Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `params AdvancedTCPProtectionTCPFlowProtectionFilterItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Expression param.Field[string]` Body param: The new filter expression. Optional. - `Mode param.Field[string]` Body param: The new mode for the filter. Optional. Must be one of 'enabled', 'disabled', 'monitoring'. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterItemEditResponse struct{…}` - `ID string` The unique ID of the expression filter. - `CreatedOn Time` The creation timestamp of the expression filter. - `Expression string` The filter expression. - `Mode string` The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the expression filter. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "expression": "ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z" } } ``` ## Delete TCP Flow Protection filter. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Delete(ctx, filterID, body) (*AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/{filter_id}` Delete a TCP Flow Protection filter specified by the given UUID. ### Parameters - `filterID string` UUID. - `body AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseSuccessTrue AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Filters.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionFilterItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Rules ## List all TCP Flow Protection rules. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.List(ctx, params) (*V4PagePaginationArray[AdvancedTCPProtectionTCPFlowProtectionRuleListResponse], error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules` List all TCP Flow Protection rules for an account. ### Parameters - `params AdvancedTCPProtectionTCPFlowProtectionRuleListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Direction param.Field[string]` Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'. - `Order param.Field[string]` Query param: The field to order by. Defaults to 'prefix'. - `Page param.Field[int64]` Query param: The page number for pagination. Defaults to 1. - `PerPage param.Field[int64]` Query param: The number of items per page. Must be between 10 and 1000. Defaults to 25. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleListResponse struct{…}` - `ID string` The unique ID of the TCP Flow Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the TCP Flow Protection rule. - `Mode string` The mode for TCP Flow Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the TCP Flow Protection rule. - `Name string` The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the TCP Flow Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.List(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create TCP Flow Protection rule. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.New(ctx, params) (*AdvancedTCPProtectionTCPFlowProtectionRuleNewResponse, error)` **post** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules` Create a TCP Flow Protection rule for an account. ### Parameters - `params AdvancedTCPProtectionTCPFlowProtectionRuleNewParams` - `AccountID param.Field[string]` Path param: Identifier. - `BurstSensitivity param.Field[string]` Body param: The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `Mode param.Field[string]` Body param: The mode for the TCP Flow Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `Name param.Field[string]` Body param: The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity param.Field[string]` Body param: The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope param.Field[string]` Body param: The scope for the TCP Flow Protection rule. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleNewResponse struct{…}` - `ID string` The unique ID of the TCP Flow Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the TCP Flow Protection rule. - `Mode string` The mode for TCP Flow Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the TCP Flow Protection rule. - `Name string` The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the TCP Flow Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.New(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), BurstSensitivity: cloudflare.F("burst_sensitivity"), Mode: cloudflare.F("mode"), Name: cloudflare.F("name"), RateSensitivity: cloudflare.F("rate_sensitivity"), Scope: cloudflare.F("scope"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", rule.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Delete all TCP Flow Protection rules. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.BulkDelete(ctx, body) (*AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules` Delete all TCP Flow Protection rules for an account. ### Parameters - `body AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseSuccessTrue AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.BulkDelete(context.TODO(), ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleBulkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Items ## Get TCP Flow Protection rule. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Get(ctx, ruleID, query) (*AdvancedTCPProtectionTCPFlowProtectionRuleItemGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/{rule_id}` Get a TCP Flow Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `query AdvancedTCPProtectionTCPFlowProtectionRuleItemGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleItemGetResponse struct{…}` - `ID string` The unique ID of the TCP Flow Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the TCP Flow Protection rule. - `Mode string` The mode for TCP Flow Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the TCP Flow Protection rule. - `Name string` The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the TCP Flow Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleItemGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Update TCP Flow Protection rule. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Edit(ctx, ruleID, params) (*AdvancedTCPProtectionTCPFlowProtectionRuleItemEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/{rule_id}` Update a TCP Flow Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `params AdvancedTCPProtectionTCPFlowProtectionRuleItemEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `BurstSensitivity param.Field[string]` Body param: The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'. - `Mode param.Field[string]` Body param: The new mode for TCP Flow Protection. Optional. Must be one of 'enabled', 'disabled', 'monitoring'. - `RateSensitivity param.Field[string]` Body param: The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleItemEditResponse struct{…}` - `ID string` The unique ID of the TCP Flow Protection rule. - `BurstSensitivity string` The burst sensitivity. Must be one of 'low', 'medium', 'high'. - `CreatedOn Time` The creation timestamp of the TCP Flow Protection rule. - `Mode string` The mode for TCP Flow Protection. Must be one of 'enabled', 'disabled', 'monitoring'. - `ModifiedOn Time` The last modification timestamp of the TCP Flow Protection rule. - `Name string` The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. - `RateSensitivity string` The rate sensitivity. Must be one of 'low', 'medium', 'high'. - `Scope string` The scope for the TCP Flow Protection rule. Must be one of 'global', 'region', or 'datacenter'. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleItemEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "id", "burst_sensitivity": "burst_sensitivity", "created_on": "2019-12-27T18:11:19.117Z", "mode": "mode", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "rate_sensitivity": "rate_sensitivity", "scope": "scope" } } ``` ## Delete TCP Flow Protection rule. `client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Delete(ctx, ruleID, body) (*AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponse, error)` **delete** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/{rule_id}` Delete a TCP Flow Protection rule specified by the given UUID. ### Parameters - `ruleID string` UUID. - `body AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponse struct{…}` - `Errors []AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseErrorsSource` - `Pointer string` - `Messages []AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseMessagesSource` - `Pointer string` - `Success AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseSuccess` Whether the API call was successful. - `const AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseSuccessTrue AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) item, err := client.DDoSProtection.AdvancedTCPProtection.TCPFlowProtection.Rules.Items.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ddos_protection.AdvancedTCPProtectionTCPFlowProtectionRuleItemDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", item.Errors) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` # Status ## Get protection status. `client.DDoSProtection.AdvancedTCPProtection.Status.Get(ctx, query) (*AdvancedTCPProtectionStatusGetResponse, error)` **get** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status` Get the protection status of the account. ### Parameters - `query AdvancedTCPProtectionStatusGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type AdvancedTCPProtectionStatusGetResponse struct{…}` - `Enabled bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) status, err := client.DDoSProtection.AdvancedTCPProtection.Status.Get(context.TODO(), ddos_protection.AdvancedTCPProtectionStatusGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", status.Enabled) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true } } ``` ## Update protection status. `client.DDoSProtection.AdvancedTCPProtection.Status.Edit(ctx, params) (*AdvancedTCPProtectionStatusEditResponse, error)` **patch** `/accounts/{account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status` Update the protection status of the account. ### Parameters - `params AdvancedTCPProtectionStatusEditParams` - `AccountID param.Field[string]` Path param: Identifier. - `Enabled param.Field[bool]` Body param: Enables or disables protection. ### Returns - `type AdvancedTCPProtectionStatusEditResponse struct{…}` - `Enabled bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ddos_protection" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DDoSProtection.AdvancedTCPProtection.Status.Edit(context.TODO(), ddos_protection.AdvancedTCPProtectionStatusEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Enabled: cloudflare.F(true), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Enabled) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true } } ```