# 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 } ```