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