# API Gateway # Configurations ## Retrieve information about specific configuration properties `client.APIGateway.Configurations.Get(ctx, params) (*Configuration, error)` **get** `/zones/{zone_id}/api_gateway/configuration` Gets the current API Shield configuration settings for a zone, including validation behavior and enforcement mode. ### Parameters - `params ConfigurationGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Normalize param.Field[bool]` Query param: Ensures that the configuration is written or retrieved in normalized fashion ### Returns - `type Configuration struct{…}` - `AuthIDCharacteristics []ConfigurationAuthIDCharacteristic` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristic struct{…}` Auth ID Characteristic - `Name string` The name of the characteristic field, i.e., the header or cookie name. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeHeader ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "header"` - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeCookie ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "cookie"` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaim struct{…}` Auth ID Characteristic extracted from JWT Token Claims - `Name string` Claim location expressed as `$(token_config_id):$(json_path)`, where `token_config_id` is the ID of the token configuration used in validating the JWT, and `json_path` is a RFC 9535 JSONPath (https://goessner.net/articles/JsonPath/, https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in dot or bracket notation, may only specify literal keys or array indexes, and must return a singleton value, which will be interpreted as a string. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimTypeJWT ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType = "jwt"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) configuration, err := client.APIGateway.Configurations.Get(context.TODO(), api_gateway.ConfigurationGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", configuration.AuthIDCharacteristics) } ``` #### 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" } } ], "result": { "auth_id_characteristics": [ { "name": "authorization", "type": "header" } ] }, "success": true } ``` ## Update configuration properties `client.APIGateway.Configurations.Update(ctx, params) (*Configuration, error)` **put** `/zones/{zone_id}/api_gateway/configuration` Updates API Shield configuration settings for a zone. Can modify validation strictness, enforcement mode, and other global settings. ### Parameters - `params ConfigurationUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Configuration param.Field[Configuration]` Body param - `Normalize param.Field[bool]` Query param: Ensures that the configuration is written or retrieved in normalized fashion ### Returns - `type Configuration struct{…}` - `AuthIDCharacteristics []ConfigurationAuthIDCharacteristic` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristic struct{…}` Auth ID Characteristic - `Name string` The name of the characteristic field, i.e., the header or cookie name. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeHeader ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "header"` - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeCookie ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "cookie"` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaim struct{…}` Auth ID Characteristic extracted from JWT Token Claims - `Name string` Claim location expressed as `$(token_config_id):$(json_path)`, where `token_config_id` is the ID of the token configuration used in validating the JWT, and `json_path` is a RFC 9535 JSONPath (https://goessner.net/articles/JsonPath/, https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in dot or bracket notation, may only specify literal keys or array indexes, and must return a singleton value, which will be interpreted as a string. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimTypeJWT ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType = "jwt"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) configuration, err := client.APIGateway.Configurations.Update(context.TODO(), api_gateway.ConfigurationUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Configuration: api_gateway.ConfigurationParam{ AuthIDCharacteristics: cloudflare.F([]api_gateway.ConfigurationAuthIDCharacteristicsUnionParam{api_gateway.ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicParam{ Name: cloudflare.F("authorization"), Type: cloudflare.F(api_gateway.ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeHeader), }}), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", configuration.AuthIDCharacteristics) } ``` #### 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" } } ], "result": { "auth_id_characteristics": [ { "name": "authorization", "type": "header" } ] }, "success": true } ``` ## Domain Types ### Configuration - `type Configuration struct{…}` - `AuthIDCharacteristics []ConfigurationAuthIDCharacteristic` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristic struct{…}` Auth ID Characteristic - `Name string` The name of the characteristic field, i.e., the header or cookie name. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeHeader ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "header"` - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicTypeCookie ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicType = "cookie"` - `type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaim struct{…}` Auth ID Characteristic extracted from JWT Token Claims - `Name string` Claim location expressed as `$(token_config_id):$(json_path)`, where `token_config_id` is the ID of the token configuration used in validating the JWT, and `json_path` is a RFC 9535 JSONPath (https://goessner.net/articles/JsonPath/, https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in dot or bracket notation, may only specify literal keys or array indexes, and must return a singleton value, which will be interpreted as a string. - `Type ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType` The type of characteristic. - `const ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimTypeJWT ConfigurationAuthIDCharacteristicsAPIShieldAuthIDCharacteristicJWTClaimType = "jwt"` # Discovery ## Retrieve discovered operations on a zone rendered as OpenAPI schemas `client.APIGateway.Discovery.Get(ctx, query) (*DiscoveryGetResponse, error)` **get** `/zones/{zone_id}/api_gateway/discovery` Retrieve the most up to date view of discovered operations, rendered as OpenAPI schemas ### Parameters - `query DiscoveryGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type DiscoveryGetResponse struct{…}` - `Schemas []unknown` - `Timestamp Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) discovery, err := client.APIGateway.Discovery.Get(context.TODO(), api_gateway.DiscoveryGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", discovery.Schemas) } ``` #### 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" } } ], "result": { "schemas": [ { "info": { "title": "OpenAPI JSON schema for www.example.com", "version": "1.0" }, "openapi": "3.0.0", "paths": { "... Further paths ...": {}, "/api/v1/users/{var1}": { "get": { "parameters": [ { "in": "path", "name": "var1", "required": true, "schema": { "type": "string" } } ] } } }, "servers": [ { "url": "www.example.com" } ] } ], "timestamp": "2014-01-01T05:20:00.12345Z" }, "success": true } ``` ## Domain Types ### Discovery Operation - `type DiscoveryOperation struct{…}` - `ID string` UUID. - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method DiscoveryOperationMethod` The HTTP method used to access the endpoint. - `const DiscoveryOperationMethodGet DiscoveryOperationMethod = "GET"` - `const DiscoveryOperationMethodPost DiscoveryOperationMethod = "POST"` - `const DiscoveryOperationMethodHead DiscoveryOperationMethod = "HEAD"` - `const DiscoveryOperationMethodOptions DiscoveryOperationMethod = "OPTIONS"` - `const DiscoveryOperationMethodPut DiscoveryOperationMethod = "PUT"` - `const DiscoveryOperationMethodDelete DiscoveryOperationMethod = "DELETE"` - `const DiscoveryOperationMethodConnect DiscoveryOperationMethod = "CONNECT"` - `const DiscoveryOperationMethodPatch DiscoveryOperationMethod = "PATCH"` - `const DiscoveryOperationMethodTrace DiscoveryOperationMethod = "TRACE"` - `Origin []DiscoveryOperationOrigin` API discovery engine(s) that discovered this operation - `const DiscoveryOperationOriginMl DiscoveryOperationOrigin = "ML"` - `const DiscoveryOperationOriginSessionIdentifier DiscoveryOperationOrigin = "SessionIdentifier"` - `const DiscoveryOperationOriginLabelDiscovery DiscoveryOperationOrigin = "LabelDiscovery"` - `State DiscoveryOperationState` State of operation in API Discovery * `review` - Operation is not saved into API Shield Endpoint Management * `saved` - Operation is saved into API Shield Endpoint Management * `ignored` - Operation is marked as ignored - `const DiscoveryOperationStateReview DiscoveryOperationState = "review"` - `const DiscoveryOperationStateSaved DiscoveryOperationState = "saved"` - `const DiscoveryOperationStateIgnored DiscoveryOperationState = "ignored"` - `Features DiscoveryOperationFeatures` - `TrafficStats DiscoveryOperationFeaturesTrafficStats` - `LastUpdated Time` - `PeriodSeconds int64` The period in seconds these statistics were computed over - `Requests float64` The average number of requests seen during this period # Operations ## Retrieve discovered operations on a zone `client.APIGateway.Discovery.Operations.List(ctx, params) (*V4PagePaginationArray[DiscoveryOperation], error)` **get** `/zones/{zone_id}/api_gateway/discovery/operations` Retrieve the most up to date view of discovered operations ### Parameters - `params DiscoveryOperationListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Diff param.Field[bool]` Query param: When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management - `Direction param.Field[DiscoveryOperationListParamsDirection]` Query param: Direction to order results. - `const DiscoveryOperationListParamsDirectionAsc DiscoveryOperationListParamsDirection = "asc"` - `const DiscoveryOperationListParamsDirectionDesc DiscoveryOperationListParamsDirection = "desc"` - `Endpoint param.Field[string]` Query param: Filter results to only include endpoints containing this pattern. - `Host param.Field[[]string]` Query param: Filter results to only include the specified hosts. - `Method param.Field[[]string]` Query param: Filter results to only include the specified HTTP methods. - `Order param.Field[DiscoveryOperationListParamsOrder]` Query param: Field to order by - `const DiscoveryOperationListParamsOrderHost DiscoveryOperationListParamsOrder = "host"` - `const DiscoveryOperationListParamsOrderMethod DiscoveryOperationListParamsOrder = "method"` - `const DiscoveryOperationListParamsOrderEndpoint DiscoveryOperationListParamsOrder = "endpoint"` - `const DiscoveryOperationListParamsOrderTrafficStatsRequests DiscoveryOperationListParamsOrder = "traffic_stats.requests"` - `const DiscoveryOperationListParamsOrderTrafficStatsLastUpdated DiscoveryOperationListParamsOrder = "traffic_stats.last_updated"` - `Origin param.Field[DiscoveryOperationListParamsOrigin]` Query param: Filter results to only include discovery results sourced from a particular discovery engine * `ML` - Discovered operations that were sourced using ML API Discovery * `SessionIdentifier` - Discovered operations that were sourced using Session Identifier API Discovery - `const DiscoveryOperationListParamsOriginMl DiscoveryOperationListParamsOrigin = "ML"` - `const DiscoveryOperationListParamsOriginSessionIdentifier DiscoveryOperationListParamsOrigin = "SessionIdentifier"` - `const DiscoveryOperationListParamsOriginLabelDiscovery DiscoveryOperationListParamsOrigin = "LabelDiscovery"` - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. - `State param.Field[DiscoveryOperationListParamsState]` Query param: Filter results to only include discovery results in a particular state. States are as follows * `review` - Discovered operations that are not saved into API Shield Endpoint Management * `saved` - Discovered operations that are already saved into API Shield Endpoint Management * `ignored` - Discovered operations that have been marked as ignored - `const DiscoveryOperationListParamsStateReview DiscoveryOperationListParamsState = "review"` - `const DiscoveryOperationListParamsStateSaved DiscoveryOperationListParamsState = "saved"` - `const DiscoveryOperationListParamsStateIgnored DiscoveryOperationListParamsState = "ignored"` ### Returns - `type DiscoveryOperation struct{…}` - `ID string` UUID. - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method DiscoveryOperationMethod` The HTTP method used to access the endpoint. - `const DiscoveryOperationMethodGet DiscoveryOperationMethod = "GET"` - `const DiscoveryOperationMethodPost DiscoveryOperationMethod = "POST"` - `const DiscoveryOperationMethodHead DiscoveryOperationMethod = "HEAD"` - `const DiscoveryOperationMethodOptions DiscoveryOperationMethod = "OPTIONS"` - `const DiscoveryOperationMethodPut DiscoveryOperationMethod = "PUT"` - `const DiscoveryOperationMethodDelete DiscoveryOperationMethod = "DELETE"` - `const DiscoveryOperationMethodConnect DiscoveryOperationMethod = "CONNECT"` - `const DiscoveryOperationMethodPatch DiscoveryOperationMethod = "PATCH"` - `const DiscoveryOperationMethodTrace DiscoveryOperationMethod = "TRACE"` - `Origin []DiscoveryOperationOrigin` API discovery engine(s) that discovered this operation - `const DiscoveryOperationOriginMl DiscoveryOperationOrigin = "ML"` - `const DiscoveryOperationOriginSessionIdentifier DiscoveryOperationOrigin = "SessionIdentifier"` - `const DiscoveryOperationOriginLabelDiscovery DiscoveryOperationOrigin = "LabelDiscovery"` - `State DiscoveryOperationState` State of operation in API Discovery * `review` - Operation is not saved into API Shield Endpoint Management * `saved` - Operation is saved into API Shield Endpoint Management * `ignored` - Operation is marked as ignored - `const DiscoveryOperationStateReview DiscoveryOperationState = "review"` - `const DiscoveryOperationStateSaved DiscoveryOperationState = "saved"` - `const DiscoveryOperationStateIgnored DiscoveryOperationState = "ignored"` - `Features DiscoveryOperationFeatures` - `TrafficStats DiscoveryOperationFeaturesTrafficStats` - `LastUpdated Time` - `PeriodSeconds int64` The period in seconds these statistics were computed over - `Requests float64` The average number of requests seen during this period ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Discovery.Operations.List(context.TODO(), api_gateway.DiscoveryOperationListParams{ ZoneID: 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" } } ], "result": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "origin": [ "ML" ], "state": "review", "features": { "traffic_stats": { "last_updated": "2014-01-01T05:20:00.12345Z", "period_seconds": 3600, "requests": 1987.06 } } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Patch discovered operation `client.APIGateway.Discovery.Operations.Edit(ctx, operationID, params) (*DiscoveryOperationEditResponse, error)` **patch** `/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}` Update the `state` on a discovered operation ### Parameters - `operationID string` UUID. - `params DiscoveryOperationEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `State param.Field[DiscoveryOperationEditParamsState]` Body param: Mark state of operation in API Discovery * `review` - Mark operation as for review * `ignored` - Mark operation as ignored - `const DiscoveryOperationEditParamsStateReview DiscoveryOperationEditParamsState = "review"` - `const DiscoveryOperationEditParamsStateIgnored DiscoveryOperationEditParamsState = "ignored"` ### Returns - `type DiscoveryOperationEditResponse struct{…}` - `State DiscoveryOperationEditResponseState` State of operation in API Discovery * `review` - Operation is not saved into API Shield Endpoint Management * `saved` - Operation is saved into API Shield Endpoint Management * `ignored` - Operation is marked as ignored - `const DiscoveryOperationEditResponseStateReview DiscoveryOperationEditResponseState = "review"` - `const DiscoveryOperationEditResponseStateSaved DiscoveryOperationEditResponseState = "saved"` - `const DiscoveryOperationEditResponseStateIgnored DiscoveryOperationEditResponseState = "ignored"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.APIGateway.Discovery.Operations.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.DiscoveryOperationEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.State) } ``` #### 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" } } ], "result": { "state": "review" }, "success": true } ``` ## Patch discovered operations `client.APIGateway.Discovery.Operations.BulkEdit(ctx, params) (*DiscoveryOperationBulkEditResponse, error)` **patch** `/zones/{zone_id}/api_gateway/discovery/operations` Update the `state` on one or more discovered operations ### Parameters - `params DiscoveryOperationBulkEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Body param.Field[map[string, DiscoveryOperationBulkEditParamsBody]]` Body param - `State DiscoveryOperationBulkEditParamsBodyState` Mark state of operation in API Discovery * `review` - Mark operation as for review * `ignored` - Mark operation as ignored - `const DiscoveryOperationBulkEditParamsBodyStateReview DiscoveryOperationBulkEditParamsBodyState = "review"` - `const DiscoveryOperationBulkEditParamsBodyStateIgnored DiscoveryOperationBulkEditParamsBodyState = "ignored"` ### Returns - `type DiscoveryOperationBulkEditResponse map[string, DiscoveryOperationBulkEditResponseItem]` - `State DiscoveryOperationBulkEditResponseItemState` Mark state of operation in API Discovery * `review` - Mark operation as for review * `ignored` - Mark operation as ignored - `const DiscoveryOperationBulkEditResponseItemStateReview DiscoveryOperationBulkEditResponseItemState = "review"` - `const DiscoveryOperationBulkEditResponseItemStateIgnored DiscoveryOperationBulkEditResponseItemState = "ignored"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.APIGateway.Discovery.Operations.BulkEdit(context.TODO(), api_gateway.DiscoveryOperationBulkEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: map[string]api_gateway.DiscoveryOperationBulkEditParamsBody{ "3818d821-5901-4147-a474-f5f5aec1d54e": api_gateway.DiscoveryOperationBulkEditParamsBody{ }, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": api_gateway.DiscoveryOperationBulkEditParamsBody{ }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### 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" } } ], "result": { "3818d821-5901-4147-a474-f5f5aec1d54e": { "state": "ignored" }, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": { "state": "review" } }, "success": true } ``` # Labels ## Retrieve all labels `client.APIGateway.Labels.List(ctx, params) (*V4PagePaginationArray[LabelListResponse], error)` **get** `/zones/{zone_id}/api_gateway/labels` Retrieve all labels ### Parameters - `params LabelListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Direction param.Field[LabelListParamsDirection]` Query param: Direction to order results. - `const LabelListParamsDirectionAsc LabelListParamsDirection = "asc"` - `const LabelListParamsDirectionDesc LabelListParamsDirection = "desc"` - `Filter param.Field[string]` Query param: Filter for labels where the name or description matches using substring match - `Order param.Field[LabelListParamsOrder]` Query param: Field to order by - `const LabelListParamsOrderName LabelListParamsOrder = "name"` - `const LabelListParamsOrderDescription LabelListParamsOrder = "description"` - `const LabelListParamsOrderCreatedAt LabelListParamsOrder = "created_at"` - `const LabelListParamsOrderLastUpdated LabelListParamsOrder = "last_updated"` - `const LabelListParamsOrderMappedResourcesOperations LabelListParamsOrder = "mapped_resources.operations"` - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. - `Source param.Field[LabelListParamsSource]` Query param: Filter for labels with source - `const LabelListParamsSourceUser LabelListParamsSource = "user"` - `const LabelListParamsSourceManaged LabelListParamsSource = "managed"` - `WithMappedResourceCounts param.Field[bool]` Query param: Include `mapped_resources` for each label ### Returns - `type LabelListResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelListResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelListResponseSourceUser LabelListResponseSource = "user"` - `const LabelListResponseSourceManaged LabelListResponseSource = "managed"` - `MappedResources unknown` Provides counts of what resources are linked to this label ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Labels.List(context.TODO(), api_gateway.LabelListParams{ ZoneID: 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" } } ], "result": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user", "mapped_resources": { "operations": 29 } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` # User ## Create user labels `client.APIGateway.Labels.User.BulkNew(ctx, params) (*SinglePage[LabelUserBulkNewResponse], error)` **post** `/zones/{zone_id}/api_gateway/labels/user` Create user labels ### Parameters - `params LabelUserBulkNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Body param.Field[[]LabelUserBulkNewParamsBody]` Body param - `Name string` The name of the label - `Description string` The description of the label - `Metadata unknown` Metadata for the label ### Returns - `type LabelUserBulkNewResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserBulkNewResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserBulkNewResponseSourceUser LabelUserBulkNewResponseSource = "user"` - `const LabelUserBulkNewResponseSourceManaged LabelUserBulkNewResponseSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Labels.User.BulkNew(context.TODO(), api_gateway.LabelUserBulkNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: []api_gateway.LabelUserBulkNewParamsBody{api_gateway.LabelUserBulkNewParamsBody{ Name: cloudflare.F("login"), }}, }) 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" } } ], "result": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Delete user labels `client.APIGateway.Labels.User.BulkDelete(ctx, body) (*SinglePage[LabelUserBulkDeleteResponse], error)` **delete** `/zones/{zone_id}/api_gateway/labels/user` Delete user labels ### Parameters - `body LabelUserBulkDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type LabelUserBulkDeleteResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserBulkDeleteResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserBulkDeleteResponseSourceUser LabelUserBulkDeleteResponseSource = "user"` - `const LabelUserBulkDeleteResponseSourceManaged LabelUserBulkDeleteResponseSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Labels.User.BulkDelete(context.TODO(), api_gateway.LabelUserBulkDeleteParams{ ZoneID: 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" } } ], "result": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Retrieve user label `client.APIGateway.Labels.User.Get(ctx, name, params) (*LabelUserGetResponse, error)` **get** `/zones/{zone_id}/api_gateway/labels/user/{name}` Retrieve user label ### Parameters - `name string` The name of the label - `params LabelUserGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `WithMappedResourceCounts param.Field[bool]` Query param: Include `mapped_resources` for each label ### Returns - `type LabelUserGetResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserGetResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserGetResponseSourceUser LabelUserGetResponseSource = "user"` - `const LabelUserGetResponseSourceManaged LabelUserGetResponseSource = "managed"` - `MappedResources unknown` Provides counts of what resources are linked to this label ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) user, err := client.APIGateway.Labels.User.Get( context.TODO(), "login", api_gateway.LabelUserGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", user.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user", "mapped_resources": { "operations": 29 } }, "success": true } ``` ## Update user label `client.APIGateway.Labels.User.Update(ctx, name, params) (*LabelUserUpdateResponse, error)` **put** `/zones/{zone_id}/api_gateway/labels/user/{name}` Update all fields on a label ### Parameters - `name string` The name of the label - `params LabelUserUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Description param.Field[string]` Body param: The description of the label - `Metadata param.Field[unknown]` Body param: Metadata for the label ### Returns - `type LabelUserUpdateResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserUpdateResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserUpdateResponseSourceUser LabelUserUpdateResponseSource = "user"` - `const LabelUserUpdateResponseSourceManaged LabelUserUpdateResponseSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) user, err := client.APIGateway.Labels.User.Update( context.TODO(), "login", api_gateway.LabelUserUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", user.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" }, "success": true } ``` ## Patch user label `client.APIGateway.Labels.User.Edit(ctx, name, params) (*LabelUserEditResponse, error)` **patch** `/zones/{zone_id}/api_gateway/labels/user/{name}` Update certain fields on a label ### Parameters - `name string` The name of the label - `params LabelUserEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Description param.Field[string]` Body param: The description of the label - `Metadata param.Field[unknown]` Body param: Metadata for the label ### Returns - `type LabelUserEditResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserEditResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserEditResponseSourceUser LabelUserEditResponseSource = "user"` - `const LabelUserEditResponseSourceManaged LabelUserEditResponseSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.APIGateway.Labels.User.Edit( context.TODO(), "login", api_gateway.LabelUserEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" }, "success": true } ``` ## Delete user label `client.APIGateway.Labels.User.Delete(ctx, name, body) (*LabelUserDeleteResponse, error)` **delete** `/zones/{zone_id}/api_gateway/labels/user/{name}` Delete user label ### Parameters - `name string` The name of the label - `body LabelUserDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type LabelUserDeleteResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserDeleteResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserDeleteResponseSourceUser LabelUserDeleteResponseSource = "user"` - `const LabelUserDeleteResponseSourceManaged LabelUserDeleteResponseSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) user, err := client.APIGateway.Labels.User.Delete( context.TODO(), "login", api_gateway.LabelUserDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", user.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" }, "success": true } ``` # Resources # Operation ## Replace operation(s) attached to a user label `client.APIGateway.Labels.User.Resources.Operation.Update(ctx, name, params) (*LabelUserResourceOperationUpdateResponse, error)` **put** `/zones/{zone_id}/api_gateway/labels/user/{name}/resources/operation` Replace all operations(s) attached to a user label ### Parameters - `name string` The name of the label - `params LabelUserResourceOperationUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Selector param.Field[LabelUserResourceOperationUpdateParamsSelector]` Body param: Operation IDs selector - `Include LabelUserResourceOperationUpdateParamsSelectorInclude` - `OperationIDs []string` ### Returns - `type LabelUserResourceOperationUpdateResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelUserResourceOperationUpdateResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelUserResourceOperationUpdateResponseSourceUser LabelUserResourceOperationUpdateResponseSource = "user"` - `const LabelUserResourceOperationUpdateResponseSourceManaged LabelUserResourceOperationUpdateResponseSource = "managed"` - `MappedResources unknown` Provides counts of what resources are linked to this label ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Labels.User.Resources.Operation.Update( context.TODO(), "login", api_gateway.LabelUserResourceOperationUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Selector: cloudflare.F(api_gateway.LabelUserResourceOperationUpdateParamsSelector{ Include: cloudflare.F(api_gateway.LabelUserResourceOperationUpdateParamsSelectorInclude{ OperationIDs: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }), }), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user", "mapped_resources": { "operations": 29 } }, "success": true } ``` # Managed ## Retrieve managed label `client.APIGateway.Labels.Managed.Get(ctx, name, params) (*LabelManagedGetResponse, error)` **get** `/zones/{zone_id}/api_gateway/labels/managed/{name}` Retrieve managed label ### Parameters - `name string` The name of the label - `params LabelManagedGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `WithMappedResourceCounts param.Field[bool]` Query param: Include `mapped_resources` for each label ### Returns - `type LabelManagedGetResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelManagedGetResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelManagedGetResponseSourceUser LabelManagedGetResponseSource = "user"` - `const LabelManagedGetResponseSourceManaged LabelManagedGetResponseSource = "managed"` - `MappedResources unknown` Provides counts of what resources are linked to this label ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) managed, err := client.APIGateway.Labels.Managed.Get( context.TODO(), "login", api_gateway.LabelManagedGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", managed.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "managed", "mapped_resources": { "operations": 29 } }, "success": true } ``` # Resources # Operation ## Replace operation(s) attached to a managed label `client.APIGateway.Labels.Managed.Resources.Operation.Update(ctx, name, params) (*LabelManagedResourceOperationUpdateResponse, error)` **put** `/zones/{zone_id}/api_gateway/labels/managed/{name}/resources/operation` Replace all operations(s) attached to a managed label ### Parameters - `name string` The name of the label - `params LabelManagedResourceOperationUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Selector param.Field[LabelManagedResourceOperationUpdateParamsSelector]` Body param: Operation IDs selector - `Include LabelManagedResourceOperationUpdateParamsSelectorInclude` - `OperationIDs []string` ### Returns - `type LabelManagedResourceOperationUpdateResponse struct{…}` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source LabelManagedResourceOperationUpdateResponseSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const LabelManagedResourceOperationUpdateResponseSourceUser LabelManagedResourceOperationUpdateResponseSource = "user"` - `const LabelManagedResourceOperationUpdateResponseSourceManaged LabelManagedResourceOperationUpdateResponseSource = "managed"` - `MappedResources unknown` Provides counts of what resources are linked to this label ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Labels.Managed.Resources.Operation.Update( context.TODO(), "login", api_gateway.LabelManagedResourceOperationUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Selector: cloudflare.F(api_gateway.LabelManagedResourceOperationUpdateParamsSelector{ Include: cloudflare.F(api_gateway.LabelManagedResourceOperationUpdateParamsSelectorInclude{ OperationIDs: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }), }), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.CreatedAt) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "managed", "mapped_resources": { "operations": 29 } }, "success": true } ``` # Operations ## Retrieve information about all operations on a zone `client.APIGateway.Operations.List(ctx, params) (*V4PagePaginationArray[OperationListResponse], error)` **get** `/zones/{zone_id}/api_gateway/operations` Lists all API operations tracked by API Shield for a zone with pagination. Returns operation details including method, path, and feature configurations. ### Parameters - `params OperationListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Direction param.Field[OperationListParamsDirection]` Query param: Direction to order results. - `const OperationListParamsDirectionAsc OperationListParamsDirection = "asc"` - `const OperationListParamsDirectionDesc OperationListParamsDirection = "desc"` - `Endpoint param.Field[string]` Query param: Filter results to only include endpoints containing this pattern. - `Feature param.Field[[]OperationListParamsFeature]` Query param: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. - `const OperationListParamsFeatureThresholds OperationListParamsFeature = "thresholds"` - `const OperationListParamsFeatureParameterSchemas OperationListParamsFeature = "parameter_schemas"` - `const OperationListParamsFeatureSchemaInfo OperationListParamsFeature = "schema_info"` - `Host param.Field[[]string]` Query param: Filter results to only include the specified hosts. - `Method param.Field[[]string]` Query param: Filter results to only include the specified HTTP methods. - `Order param.Field[OperationListParamsOrder]` Query param: Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`. - `const OperationListParamsOrderMethod OperationListParamsOrder = "method"` - `const OperationListParamsOrderHost OperationListParamsOrder = "host"` - `const OperationListParamsOrderEndpoint OperationListParamsOrder = "endpoint"` - `const OperationListParamsOrderThresholdsKey OperationListParamsOrder = "thresholds.$key"` - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. ### Returns - `type OperationListResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationListResponseMethod` The HTTP method used to access the endpoint. - `const OperationListResponseMethodGet OperationListResponseMethod = "GET"` - `const OperationListResponseMethodPost OperationListResponseMethod = "POST"` - `const OperationListResponseMethodHead OperationListResponseMethod = "HEAD"` - `const OperationListResponseMethodOptions OperationListResponseMethod = "OPTIONS"` - `const OperationListResponseMethodPut OperationListResponseMethod = "PUT"` - `const OperationListResponseMethodDelete OperationListResponseMethod = "DELETE"` - `const OperationListResponseMethodConnect OperationListResponseMethod = "CONNECT"` - `const OperationListResponseMethodPatch OperationListResponseMethod = "PATCH"` - `const OperationListResponseMethodTrace OperationListResponseMethod = "TRACE"` - `OperationID string` UUID. - `Features OperationListResponseFeatures` - `type OperationListResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds OperationListResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type OperationListResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting OperationListResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Operations.List(context.TODO(), api_gateway.OperationListParams{ ZoneID: 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Retrieve information about an operation `client.APIGateway.Operations.Get(ctx, operationID, params) (*OperationGetResponse, error)` **get** `/zones/{zone_id}/api_gateway/operations/{operation_id}` Gets detailed information about a specific API operation in API Shield, including its schema validation settings and traffic statistics. ### Parameters - `operationID string` UUID. - `params OperationGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Feature param.Field[[]OperationGetParamsFeature]` Query param: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. - `const OperationGetParamsFeatureThresholds OperationGetParamsFeature = "thresholds"` - `const OperationGetParamsFeatureParameterSchemas OperationGetParamsFeature = "parameter_schemas"` - `const OperationGetParamsFeatureSchemaInfo OperationGetParamsFeature = "schema_info"` ### Returns - `type OperationGetResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationGetResponseMethod` The HTTP method used to access the endpoint. - `const OperationGetResponseMethodGet OperationGetResponseMethod = "GET"` - `const OperationGetResponseMethodPost OperationGetResponseMethod = "POST"` - `const OperationGetResponseMethodHead OperationGetResponseMethod = "HEAD"` - `const OperationGetResponseMethodOptions OperationGetResponseMethod = "OPTIONS"` - `const OperationGetResponseMethodPut OperationGetResponseMethod = "PUT"` - `const OperationGetResponseMethodDelete OperationGetResponseMethod = "DELETE"` - `const OperationGetResponseMethodConnect OperationGetResponseMethod = "CONNECT"` - `const OperationGetResponseMethodPatch OperationGetResponseMethod = "PATCH"` - `const OperationGetResponseMethodTrace OperationGetResponseMethod = "TRACE"` - `OperationID string` UUID. - `Features OperationGetResponseFeatures` - `type OperationGetResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds OperationGetResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting OperationGetResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Operations.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.OperationID) } ``` #### 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" } } ], "result": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } }, "success": true } ``` ## Add one operation to a zone `client.APIGateway.Operations.New(ctx, params) (*OperationNewResponse, error)` **post** `/zones/{zone_id}/api_gateway/operations/item` Add one operation to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date. ### Parameters - `params OperationNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Endpoint param.Field[string]` Body param: The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host param.Field[string]` Body param: RFC3986-compliant host. - `Method param.Field[OperationNewParamsMethod]` Body param: The HTTP method used to access the endpoint. - `const OperationNewParamsMethodGet OperationNewParamsMethod = "GET"` - `const OperationNewParamsMethodPost OperationNewParamsMethod = "POST"` - `const OperationNewParamsMethodHead OperationNewParamsMethod = "HEAD"` - `const OperationNewParamsMethodOptions OperationNewParamsMethod = "OPTIONS"` - `const OperationNewParamsMethodPut OperationNewParamsMethod = "PUT"` - `const OperationNewParamsMethodDelete OperationNewParamsMethod = "DELETE"` - `const OperationNewParamsMethodConnect OperationNewParamsMethod = "CONNECT"` - `const OperationNewParamsMethodPatch OperationNewParamsMethod = "PATCH"` - `const OperationNewParamsMethodTrace OperationNewParamsMethod = "TRACE"` ### Returns - `type OperationNewResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationNewResponseMethod` The HTTP method used to access the endpoint. - `const OperationNewResponseMethodGet OperationNewResponseMethod = "GET"` - `const OperationNewResponseMethodPost OperationNewResponseMethod = "POST"` - `const OperationNewResponseMethodHead OperationNewResponseMethod = "HEAD"` - `const OperationNewResponseMethodOptions OperationNewResponseMethod = "OPTIONS"` - `const OperationNewResponseMethodPut OperationNewResponseMethod = "PUT"` - `const OperationNewResponseMethodDelete OperationNewResponseMethod = "DELETE"` - `const OperationNewResponseMethodConnect OperationNewResponseMethod = "CONNECT"` - `const OperationNewResponseMethodPatch OperationNewResponseMethod = "PATCH"` - `const OperationNewResponseMethodTrace OperationNewResponseMethod = "TRACE"` - `OperationID string` UUID. - `Features OperationNewResponseFeatures` - `type OperationNewResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds OperationNewResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type OperationNewResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas OperationNewResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas OperationNewResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type OperationNewResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting OperationNewResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 OperationNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Operations.New(context.TODO(), api_gateway.OperationNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Endpoint: cloudflare.F("/api/v1/users/{var1}"), Host: cloudflare.F("www.example.com"), Method: cloudflare.F(api_gateway.OperationNewParamsMethodGet), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.OperationID) } ``` #### 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" } } ], "result": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } }, "success": true } ``` ## Delete an operation `client.APIGateway.Operations.Delete(ctx, operationID, body) (*OperationDeleteResponse, error)` **delete** `/zones/{zone_id}/api_gateway/operations/{operation_id}` Removes a single API operation from API Shield endpoint management. The operation will no longer be tracked or protected by API Shield rules. ### Parameters - `operationID string` UUID. - `body OperationDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type OperationDeleteResponse struct{…}` - `Errors Message` - `Code int64` - `Message string` - `DocumentationURL string` - `Source MessageItemSource` - `Pointer string` - `Messages Message` - `Success OperationDeleteResponseSuccess` Whether the API call was successful. - `const OperationDeleteResponseSuccessTrue OperationDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) operation, err := client.APIGateway.Operations.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.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 } ``` ## Add operations to a zone `client.APIGateway.Operations.BulkNew(ctx, params) (*SinglePage[OperationBulkNewResponse], error)` **post** `/zones/{zone_id}/api_gateway/operations` Add one or more operations to a zone. Endpoints can contain path variables. Host, method, endpoint will be normalized to a canoncial form when creating an operation and must be unique on the zone. Inserting an operation that matches an existing one will return the record of the already existing operation and update its last_updated date. ### Parameters - `params OperationBulkNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Body param.Field[[]OperationBulkNewParamsBody]` Body param - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `Method OperationBulkNewParamsBodyMethod` The HTTP method used to access the endpoint. - `const OperationBulkNewParamsBodyMethodGet OperationBulkNewParamsBodyMethod = "GET"` - `const OperationBulkNewParamsBodyMethodPost OperationBulkNewParamsBodyMethod = "POST"` - `const OperationBulkNewParamsBodyMethodHead OperationBulkNewParamsBodyMethod = "HEAD"` - `const OperationBulkNewParamsBodyMethodOptions OperationBulkNewParamsBodyMethod = "OPTIONS"` - `const OperationBulkNewParamsBodyMethodPut OperationBulkNewParamsBodyMethod = "PUT"` - `const OperationBulkNewParamsBodyMethodDelete OperationBulkNewParamsBodyMethod = "DELETE"` - `const OperationBulkNewParamsBodyMethodConnect OperationBulkNewParamsBodyMethod = "CONNECT"` - `const OperationBulkNewParamsBodyMethodPatch OperationBulkNewParamsBodyMethod = "PATCH"` - `const OperationBulkNewParamsBodyMethodTrace OperationBulkNewParamsBodyMethod = "TRACE"` ### Returns - `type OperationBulkNewResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationBulkNewResponseMethod` The HTTP method used to access the endpoint. - `const OperationBulkNewResponseMethodGet OperationBulkNewResponseMethod = "GET"` - `const OperationBulkNewResponseMethodPost OperationBulkNewResponseMethod = "POST"` - `const OperationBulkNewResponseMethodHead OperationBulkNewResponseMethod = "HEAD"` - `const OperationBulkNewResponseMethodOptions OperationBulkNewResponseMethod = "OPTIONS"` - `const OperationBulkNewResponseMethodPut OperationBulkNewResponseMethod = "PUT"` - `const OperationBulkNewResponseMethodDelete OperationBulkNewResponseMethod = "DELETE"` - `const OperationBulkNewResponseMethodConnect OperationBulkNewResponseMethod = "CONNECT"` - `const OperationBulkNewResponseMethodPatch OperationBulkNewResponseMethod = "PATCH"` - `const OperationBulkNewResponseMethodTrace OperationBulkNewResponseMethod = "TRACE"` - `OperationID string` UUID. - `Features OperationBulkNewResponseFeatures` - `type OperationBulkNewResponseFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds OperationBulkNewResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type OperationBulkNewResponseFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas OperationBulkNewResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas OperationBulkNewResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type OperationBulkNewResponseFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting OperationBulkNewResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 OperationBulkNewResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock OperationBulkNewResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Operations.BulkNew(context.TODO(), api_gateway.OperationBulkNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: []api_gateway.OperationBulkNewParamsBody{api_gateway.OperationBulkNewParamsBody{ Endpoint: cloudflare.F("/api/v1/users/{var1}"), Host: cloudflare.F("www.example.com"), Method: cloudflare.F(api_gateway.OperationBulkNewParamsBodyMethodGet), }}, }) 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } } ], "success": true } ``` ## Delete multiple operations `client.APIGateway.Operations.BulkDelete(ctx, body) (*OperationBulkDeleteResponse, error)` **delete** `/zones/{zone_id}/api_gateway/operations` Bulk removes multiple API operations from API Shield endpoint management in a single request. Efficient for cleaning up unused endpoints. ### Parameters - `body OperationBulkDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type OperationBulkDeleteResponse struct{…}` - `Errors Message` - `Code int64` - `Message string` - `DocumentationURL string` - `Source MessageItemSource` - `Pointer string` - `Messages Message` - `Success OperationBulkDeleteResponseSuccess` Whether the API call was successful. - `const OperationBulkDeleteResponseSuccessTrue OperationBulkDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.APIGateway.Operations.BulkDelete(context.TODO(), api_gateway.OperationBulkDeleteParams{ ZoneID: 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 } ``` ## Domain Types ### API Shield - `type APIShield struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method APIShieldMethod` The HTTP method used to access the endpoint. - `const APIShieldMethodGet APIShieldMethod = "GET"` - `const APIShieldMethodPost APIShieldMethod = "POST"` - `const APIShieldMethodHead APIShieldMethod = "HEAD"` - `const APIShieldMethodOptions APIShieldMethod = "OPTIONS"` - `const APIShieldMethodPut APIShieldMethod = "PUT"` - `const APIShieldMethodDelete APIShieldMethod = "DELETE"` - `const APIShieldMethodConnect APIShieldMethod = "CONNECT"` - `const APIShieldMethodPatch APIShieldMethod = "PATCH"` - `const APIShieldMethodTrace APIShieldMethod = "TRACE"` - `OperationID string` UUID. # Labels ## Replace label(s) on an operation in endpoint management `client.APIGateway.Operations.Labels.Update(ctx, operationID, params) (*OperationLabelUpdateResponse, error)` **put** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Replace label(s) on an operation in endpoint management ### Parameters - `operationID string` UUID. - `params OperationLabelUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Managed param.Field[[]string]` Body param: List of managed label names. Omitting this property or passing an empty array will result in all managed labels being removed from the operation - `User param.Field[[]string]` Body param: List of user label names. Omitting this property or passing an empty array will result in all user labels being removed from the operation ### Returns - `type OperationLabelUpdateResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelUpdateResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelUpdateResponseMethodGet OperationLabelUpdateResponseMethod = "GET"` - `const OperationLabelUpdateResponseMethodPost OperationLabelUpdateResponseMethod = "POST"` - `const OperationLabelUpdateResponseMethodHead OperationLabelUpdateResponseMethod = "HEAD"` - `const OperationLabelUpdateResponseMethodOptions OperationLabelUpdateResponseMethod = "OPTIONS"` - `const OperationLabelUpdateResponseMethodPut OperationLabelUpdateResponseMethod = "PUT"` - `const OperationLabelUpdateResponseMethodDelete OperationLabelUpdateResponseMethod = "DELETE"` - `const OperationLabelUpdateResponseMethodConnect OperationLabelUpdateResponseMethod = "CONNECT"` - `const OperationLabelUpdateResponseMethodPatch OperationLabelUpdateResponseMethod = "PATCH"` - `const OperationLabelUpdateResponseMethodTrace OperationLabelUpdateResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelUpdateResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelUpdateResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelUpdateResponseLabelsSourceUser OperationLabelUpdateResponseLabelsSource = "user"` - `const OperationLabelUpdateResponseLabelsSourceManaged OperationLabelUpdateResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) label, err := client.APIGateway.Operations.Labels.Update( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationLabelUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", label.OperationID) } ``` #### 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" } } ], "result": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Attach label(s) on an operation in endpoint management `client.APIGateway.Operations.Labels.New(ctx, operationID, params) (*OperationLabelNewResponse, error)` **post** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Attach label(s) on an operation in endpoint management ### Parameters - `operationID string` UUID. - `params OperationLabelNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Managed param.Field[[]string]` Body param: List of managed label names. - `User param.Field[[]string]` Body param: List of user label names. ### Returns - `type OperationLabelNewResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelNewResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelNewResponseMethodGet OperationLabelNewResponseMethod = "GET"` - `const OperationLabelNewResponseMethodPost OperationLabelNewResponseMethod = "POST"` - `const OperationLabelNewResponseMethodHead OperationLabelNewResponseMethod = "HEAD"` - `const OperationLabelNewResponseMethodOptions OperationLabelNewResponseMethod = "OPTIONS"` - `const OperationLabelNewResponseMethodPut OperationLabelNewResponseMethod = "PUT"` - `const OperationLabelNewResponseMethodDelete OperationLabelNewResponseMethod = "DELETE"` - `const OperationLabelNewResponseMethodConnect OperationLabelNewResponseMethod = "CONNECT"` - `const OperationLabelNewResponseMethodPatch OperationLabelNewResponseMethod = "PATCH"` - `const OperationLabelNewResponseMethodTrace OperationLabelNewResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelNewResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelNewResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelNewResponseLabelsSourceUser OperationLabelNewResponseLabelsSource = "user"` - `const OperationLabelNewResponseLabelsSourceManaged OperationLabelNewResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) label, err := client.APIGateway.Operations.Labels.New( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationLabelNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", label.OperationID) } ``` #### 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" } } ], "result": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Remove label(s) on an operation in endpoint management `client.APIGateway.Operations.Labels.Delete(ctx, operationID, body) (*OperationLabelDeleteResponse, error)` **delete** `/zones/{zone_id}/api_gateway/operations/{operation_id}/labels` Remove label(s) on an operation in endpoint management ### Parameters - `operationID string` UUID. - `body OperationLabelDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type OperationLabelDeleteResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelDeleteResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelDeleteResponseMethodGet OperationLabelDeleteResponseMethod = "GET"` - `const OperationLabelDeleteResponseMethodPost OperationLabelDeleteResponseMethod = "POST"` - `const OperationLabelDeleteResponseMethodHead OperationLabelDeleteResponseMethod = "HEAD"` - `const OperationLabelDeleteResponseMethodOptions OperationLabelDeleteResponseMethod = "OPTIONS"` - `const OperationLabelDeleteResponseMethodPut OperationLabelDeleteResponseMethod = "PUT"` - `const OperationLabelDeleteResponseMethodDelete OperationLabelDeleteResponseMethod = "DELETE"` - `const OperationLabelDeleteResponseMethodConnect OperationLabelDeleteResponseMethod = "CONNECT"` - `const OperationLabelDeleteResponseMethodPatch OperationLabelDeleteResponseMethod = "PATCH"` - `const OperationLabelDeleteResponseMethodTrace OperationLabelDeleteResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelDeleteResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelDeleteResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelDeleteResponseLabelsSourceUser OperationLabelDeleteResponseLabelsSource = "user"` - `const OperationLabelDeleteResponseLabelsSourceManaged OperationLabelDeleteResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) label, err := client.APIGateway.Operations.Labels.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationLabelDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", label.OperationID) } ``` #### 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" } } ], "result": { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] }, "success": true } ``` ## Bulk replace label(s) on operation(s) in endpoint management `client.APIGateway.Operations.Labels.BulkUpdate(ctx, params) (*SinglePage[OperationLabelBulkUpdateResponse], error)` **put** `/zones/{zone_id}/api_gateway/operations/labels` Bulk replace label(s) on operation(s) in endpoint management ### Parameters - `params OperationLabelBulkUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Managed param.Field[OperationLabelBulkUpdateParamsManaged]` Body param: Managed labels to replace for all affected operations - `Labels []string` List of managed label names. Providing an empty array will result in all managed labels being removed from all affected operations - `Selector param.Field[OperationLabelBulkUpdateParamsSelector]` Body param: Operation IDs selector - `Include OperationLabelBulkUpdateParamsSelectorInclude` - `OperationIDs []string` - `User param.Field[OperationLabelBulkUpdateParamsUser]` Body param: User labels to replace for all affected operations - `Labels []string` List of user label names. Providing an empty array will result in all user labels being removed from all affected operations ### Returns - `type OperationLabelBulkUpdateResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelBulkUpdateResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelBulkUpdateResponseMethodGet OperationLabelBulkUpdateResponseMethod = "GET"` - `const OperationLabelBulkUpdateResponseMethodPost OperationLabelBulkUpdateResponseMethod = "POST"` - `const OperationLabelBulkUpdateResponseMethodHead OperationLabelBulkUpdateResponseMethod = "HEAD"` - `const OperationLabelBulkUpdateResponseMethodOptions OperationLabelBulkUpdateResponseMethod = "OPTIONS"` - `const OperationLabelBulkUpdateResponseMethodPut OperationLabelBulkUpdateResponseMethod = "PUT"` - `const OperationLabelBulkUpdateResponseMethodDelete OperationLabelBulkUpdateResponseMethod = "DELETE"` - `const OperationLabelBulkUpdateResponseMethodConnect OperationLabelBulkUpdateResponseMethod = "CONNECT"` - `const OperationLabelBulkUpdateResponseMethodPatch OperationLabelBulkUpdateResponseMethod = "PATCH"` - `const OperationLabelBulkUpdateResponseMethodTrace OperationLabelBulkUpdateResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelBulkUpdateResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelBulkUpdateResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelBulkUpdateResponseLabelsSourceUser OperationLabelBulkUpdateResponseLabelsSource = "user"` - `const OperationLabelBulkUpdateResponseLabelsSourceManaged OperationLabelBulkUpdateResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Operations.Labels.BulkUpdate(context.TODO(), api_gateway.OperationLabelBulkUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Managed: cloudflare.F(api_gateway.OperationLabelBulkUpdateParamsManaged{ Labels: cloudflare.F([]string{"login"}), }), Selector: cloudflare.F(api_gateway.OperationLabelBulkUpdateParamsSelector{ Include: cloudflare.F(api_gateway.OperationLabelBulkUpdateParamsSelectorInclude{ OperationIDs: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }), }), User: cloudflare.F(api_gateway.OperationLabelBulkUpdateParamsUser{ Labels: cloudflare.F([]string{"login"}), }), }) 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` ## Bulk attach label(s) on operation(s) in endpoint management `client.APIGateway.Operations.Labels.BulkNew(ctx, params) (*SinglePage[OperationLabelBulkNewResponse], error)` **post** `/zones/{zone_id}/api_gateway/operations/labels` Bulk attach label(s) on operation(s) in endpoint management ### Parameters - `params OperationLabelBulkNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Selector param.Field[OperationLabelBulkNewParamsSelector]` Body param: Operation IDs selector - `Include OperationLabelBulkNewParamsSelectorInclude` - `OperationIDs []string` - `Managed param.Field[OperationLabelBulkNewParamsManaged]` Body param - `Labels []string` List of managed label names. - `User param.Field[OperationLabelBulkNewParamsUser]` Body param - `Labels []string` List of user label names. ### Returns - `type OperationLabelBulkNewResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelBulkNewResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelBulkNewResponseMethodGet OperationLabelBulkNewResponseMethod = "GET"` - `const OperationLabelBulkNewResponseMethodPost OperationLabelBulkNewResponseMethod = "POST"` - `const OperationLabelBulkNewResponseMethodHead OperationLabelBulkNewResponseMethod = "HEAD"` - `const OperationLabelBulkNewResponseMethodOptions OperationLabelBulkNewResponseMethod = "OPTIONS"` - `const OperationLabelBulkNewResponseMethodPut OperationLabelBulkNewResponseMethod = "PUT"` - `const OperationLabelBulkNewResponseMethodDelete OperationLabelBulkNewResponseMethod = "DELETE"` - `const OperationLabelBulkNewResponseMethodConnect OperationLabelBulkNewResponseMethod = "CONNECT"` - `const OperationLabelBulkNewResponseMethodPatch OperationLabelBulkNewResponseMethod = "PATCH"` - `const OperationLabelBulkNewResponseMethodTrace OperationLabelBulkNewResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelBulkNewResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelBulkNewResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelBulkNewResponseLabelsSourceUser OperationLabelBulkNewResponseLabelsSource = "user"` - `const OperationLabelBulkNewResponseLabelsSourceManaged OperationLabelBulkNewResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Operations.Labels.BulkNew(context.TODO(), api_gateway.OperationLabelBulkNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Selector: cloudflare.F(api_gateway.OperationLabelBulkNewParamsSelector{ Include: cloudflare.F(api_gateway.OperationLabelBulkNewParamsSelectorInclude{ OperationIDs: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }), }), }) 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` ## Bulk remove label(s) on operation(s) in endpoint management `client.APIGateway.Operations.Labels.BulkDelete(ctx, body) (*SinglePage[OperationLabelBulkDeleteResponse], error)` **delete** `/zones/{zone_id}/api_gateway/operations/labels` Bulk remove label(s) on operation(s) in endpoint management ### Parameters - `body OperationLabelBulkDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type OperationLabelBulkDeleteResponse struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method OperationLabelBulkDeleteResponseMethod` The HTTP method used to access the endpoint. - `const OperationLabelBulkDeleteResponseMethodGet OperationLabelBulkDeleteResponseMethod = "GET"` - `const OperationLabelBulkDeleteResponseMethodPost OperationLabelBulkDeleteResponseMethod = "POST"` - `const OperationLabelBulkDeleteResponseMethodHead OperationLabelBulkDeleteResponseMethod = "HEAD"` - `const OperationLabelBulkDeleteResponseMethodOptions OperationLabelBulkDeleteResponseMethod = "OPTIONS"` - `const OperationLabelBulkDeleteResponseMethodPut OperationLabelBulkDeleteResponseMethod = "PUT"` - `const OperationLabelBulkDeleteResponseMethodDelete OperationLabelBulkDeleteResponseMethod = "DELETE"` - `const OperationLabelBulkDeleteResponseMethodConnect OperationLabelBulkDeleteResponseMethod = "CONNECT"` - `const OperationLabelBulkDeleteResponseMethodPatch OperationLabelBulkDeleteResponseMethod = "PATCH"` - `const OperationLabelBulkDeleteResponseMethodTrace OperationLabelBulkDeleteResponseMethod = "TRACE"` - `OperationID string` UUID. - `Labels []OperationLabelBulkDeleteResponseLabel` - `CreatedAt Time` - `Description string` The description of the label - `LastUpdated Time` - `Metadata unknown` Metadata for the label - `Name string` The name of the label - `Source OperationLabelBulkDeleteResponseLabelsSource` * `user` - label is owned by the user * `managed` - label is owned by cloudflare - `const OperationLabelBulkDeleteResponseLabelsSourceUser OperationLabelBulkDeleteResponseLabelsSource = "user"` - `const OperationLabelBulkDeleteResponseLabelsSourceManaged OperationLabelBulkDeleteResponseLabelsSource = "managed"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.Operations.Labels.BulkDelete(context.TODO(), api_gateway.OperationLabelBulkDeleteParams{ ZoneID: 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "labels": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "All endpoints that deal with logins", "last_updated": "2014-01-01T05:20:00.12345Z", "metadata": { "foo": "bar" }, "name": "login", "source": "user" } ] } ], "success": true } ``` # Schema Validation ## Retrieve operation-level schema validation settings `client.APIGateway.Operations.SchemaValidation.Get(ctx, operationID, query) (*OperationSchemaValidationGetResponse, error)` **get** `/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation` Retrieves operation-level schema validation settings on the zone ### Parameters - `operationID string` UUID. - `query OperationSchemaValidationGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type OperationSchemaValidationGetResponse struct{…}` - `MitigationAction OperationSchemaValidationGetResponseMitigationAction` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `const OperationSchemaValidationGetResponseMitigationActionLog OperationSchemaValidationGetResponseMitigationAction = "log"` - `const OperationSchemaValidationGetResponseMitigationActionBlock OperationSchemaValidationGetResponseMitigationAction = "block"` - `const OperationSchemaValidationGetResponseMitigationActionNone OperationSchemaValidationGetResponseMitigationAction = "none"` - `OperationID string` UUID. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) schemaValidation, err := client.APIGateway.Operations.SchemaValidation.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationSchemaValidationGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", schemaValidation.OperationID) } ``` #### Response ```json { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ``` ## Update operation-level schema validation settings `client.APIGateway.Operations.SchemaValidation.Update(ctx, operationID, params) (*OperationSchemaValidationUpdateResponse, error)` **put** `/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation` Updates operation-level schema validation settings on the zone ### Parameters - `operationID string` UUID. - `params OperationSchemaValidationUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `MitigationAction param.Field[OperationSchemaValidationUpdateParamsMitigationAction]` Body param: When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `const OperationSchemaValidationUpdateParamsMitigationActionLog OperationSchemaValidationUpdateParamsMitigationAction = "log"` - `const OperationSchemaValidationUpdateParamsMitigationActionBlock OperationSchemaValidationUpdateParamsMitigationAction = "block"` - `const OperationSchemaValidationUpdateParamsMitigationActionNone OperationSchemaValidationUpdateParamsMitigationAction = "none"` ### Returns - `type OperationSchemaValidationUpdateResponse struct{…}` - `MitigationAction OperationSchemaValidationUpdateResponseMitigationAction` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `const OperationSchemaValidationUpdateResponseMitigationActionLog OperationSchemaValidationUpdateResponseMitigationAction = "log"` - `const OperationSchemaValidationUpdateResponseMitigationActionBlock OperationSchemaValidationUpdateResponseMitigationAction = "block"` - `const OperationSchemaValidationUpdateResponseMitigationActionNone OperationSchemaValidationUpdateResponseMitigationAction = "none"` - `OperationID string` UUID. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) schemaValidation, err := client.APIGateway.Operations.SchemaValidation.Update( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.OperationSchemaValidationUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", schemaValidation.OperationID) } ``` #### Response ```json { "mitigation_action": "block", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ``` ## Update multiple operation-level schema validation settings `client.APIGateway.Operations.SchemaValidation.Edit(ctx, params) (*SettingsMultipleRequest, error)` **patch** `/zones/{zone_id}/api_gateway/operations/schema_validation` Updates multiple operation-level schema validation settings on the zone ### Parameters - `params OperationSchemaValidationEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `SettingsMultipleRequest param.Field[SettingsMultipleRequest]` Body param ### Returns - `type SettingsMultipleRequest map[string, SettingsMultipleRequestItem]` - `MitigationAction SettingsMultipleRequestItemMitigationAction` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `const SettingsMultipleRequestItemMitigationActionLog SettingsMultipleRequestItemMitigationAction = "log"` - `const SettingsMultipleRequestItemMitigationActionBlock SettingsMultipleRequestItemMitigationAction = "block"` - `const SettingsMultipleRequestItemMitigationActionNone SettingsMultipleRequestItemMitigationAction = "none"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) settingsMultipleRequest, err := client.APIGateway.Operations.SchemaValidation.Edit(context.TODO(), api_gateway.OperationSchemaValidationEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), SettingsMultipleRequest: api_gateway.SettingsMultipleRequestParam{ "3818d821-5901-4147-a474-f5f5aec1d54e": api_gateway.SettingsMultipleRequestItemParam{ }, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": api_gateway.SettingsMultipleRequestItemParam{ }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", settingsMultipleRequest) } ``` #### 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" } } ], "result": { "3818d821-5901-4147-a474-f5f5aec1d54e": { "mitigation_action": "log" }, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": { "mitigation_action": "block" } }, "success": true } ``` ## Domain Types ### Settings Multiple Request - `type SettingsMultipleRequest map[string, SettingsMultipleRequestItem]` - `MitigationAction SettingsMultipleRequestItemMitigationAction` When set, this applies a mitigation action to this operation - `log` log request when request does not conform to schema for this operation - `block` deny access to the site when request does not conform to schema for this operation - `none` will skip mitigation for this operation - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied - `const SettingsMultipleRequestItemMitigationActionLog SettingsMultipleRequestItemMitigationAction = "log"` - `const SettingsMultipleRequestItemMitigationActionBlock SettingsMultipleRequestItemMitigationAction = "block"` - `const SettingsMultipleRequestItemMitigationActionNone SettingsMultipleRequestItemMitigationAction = "none"` # Schemas ## Retrieve operations and features as OpenAPI schemas `client.APIGateway.Schemas.List(ctx, params) (*SchemaListResponse, error)` **get** `/zones/{zone_id}/api_gateway/schemas` Retrieve operations and features as OpenAPI schemas ### Parameters - `params SchemaListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Feature param.Field[[]SchemaListParamsFeature]` Query param: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. - `const SchemaListParamsFeatureThresholds SchemaListParamsFeature = "thresholds"` - `const SchemaListParamsFeatureParameterSchemas SchemaListParamsFeature = "parameter_schemas"` - `const SchemaListParamsFeatureSchemaInfo SchemaListParamsFeature = "schema_info"` - `Host param.Field[[]string]` Query param: Receive schema only for the given host(s). ### Returns - `type SchemaListResponse struct{…}` - `Schemas []unknown` - `Timestamp string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) schemas, err := client.APIGateway.Schemas.List(context.TODO(), api_gateway.SchemaListParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", schemas.Schemas) } ``` #### 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" } } ], "result": { "schemas": [ { "info": { "title": "OpenAPI JSON schema for www.example.com", "version": "1.0" }, "openapi": "3.0.0", "paths": { "... Further paths ...": {}, "/api/v1/users/{var1}": { "get": { "parameters": [ { "in": "path", "name": "var1", "required": true, "schema": { "type": "string" } } ] } } }, "servers": [ { "url": "www.example.com" } ] } ], "timestamp": "timestamp" }, "success": true } ``` # Settings ## Domain Types ### Settings - `type Settings struct{…}` - `ValidationDefaultMitigationAction SettingsValidationDefaultMitigationAction` The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation - `const SettingsValidationDefaultMitigationActionNone SettingsValidationDefaultMitigationAction = "none"` - `const SettingsValidationDefaultMitigationActionLog SettingsValidationDefaultMitigationAction = "log"` - `const SettingsValidationDefaultMitigationActionBlock SettingsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction SettingsValidationOverrideMitigationAction` When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request - `null` indicates that no override is in place - `const SettingsValidationOverrideMitigationActionNone SettingsValidationOverrideMitigationAction = "none"` # Schema Validation ## Retrieve zone level schema validation settings `client.APIGateway.Settings.SchemaValidation.Get(ctx, query) (*Settings, error)` **get** `/zones/{zone_id}/api_gateway/settings/schema_validation` Retrieves zone level schema validation settings currently set on the zone ### Parameters - `query SettingSchemaValidationGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type Settings struct{…}` - `ValidationDefaultMitigationAction SettingsValidationDefaultMitigationAction` The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation - `const SettingsValidationDefaultMitigationActionNone SettingsValidationDefaultMitigationAction = "none"` - `const SettingsValidationDefaultMitigationActionLog SettingsValidationDefaultMitigationAction = "log"` - `const SettingsValidationDefaultMitigationActionBlock SettingsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction SettingsValidationOverrideMitigationAction` When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request - `null` indicates that no override is in place - `const SettingsValidationOverrideMitigationActionNone SettingsValidationOverrideMitigationAction = "none"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) settings, err := client.APIGateway.Settings.SchemaValidation.Get(context.TODO(), api_gateway.SettingSchemaValidationGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", settings.ValidationDefaultMitigationAction) } ``` #### Response ```json { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" } ``` ## Update zone level schema validation settings `client.APIGateway.Settings.SchemaValidation.Update(ctx, params) (*Settings, error)` **put** `/zones/{zone_id}/api_gateway/settings/schema_validation` Updates zone level schema validation settings on the zone ### Parameters - `params SettingSchemaValidationUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ValidationDefaultMitigationAction param.Field[SettingSchemaValidationUpdateParamsValidationDefaultMitigationAction]` Body param: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation - `const SettingSchemaValidationUpdateParamsValidationDefaultMitigationActionNone SettingSchemaValidationUpdateParamsValidationDefaultMitigationAction = "none"` - `const SettingSchemaValidationUpdateParamsValidationDefaultMitigationActionLog SettingSchemaValidationUpdateParamsValidationDefaultMitigationAction = "log"` - `const SettingSchemaValidationUpdateParamsValidationDefaultMitigationActionBlock SettingSchemaValidationUpdateParamsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction param.Field[SettingSchemaValidationUpdateParamsValidationOverrideMitigationAction]` Body param: When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request - `null` indicates that no override is in place To clear any override, use the special value `disable_override` or `null` - `const SettingSchemaValidationUpdateParamsValidationOverrideMitigationActionNone SettingSchemaValidationUpdateParamsValidationOverrideMitigationAction = "none"` - `const SettingSchemaValidationUpdateParamsValidationOverrideMitigationActionDisableOverride SettingSchemaValidationUpdateParamsValidationOverrideMitigationAction = "disable_override"` ### Returns - `type Settings struct{…}` - `ValidationDefaultMitigationAction SettingsValidationDefaultMitigationAction` The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation - `const SettingsValidationDefaultMitigationActionNone SettingsValidationDefaultMitigationAction = "none"` - `const SettingsValidationDefaultMitigationActionLog SettingsValidationDefaultMitigationAction = "log"` - `const SettingsValidationDefaultMitigationActionBlock SettingsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction SettingsValidationOverrideMitigationAction` When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request - `null` indicates that no override is in place - `const SettingsValidationOverrideMitigationActionNone SettingsValidationOverrideMitigationAction = "none"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) settings, err := client.APIGateway.Settings.SchemaValidation.Update(context.TODO(), api_gateway.SettingSchemaValidationUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), ValidationDefaultMitigationAction: cloudflare.F(api_gateway.SettingSchemaValidationUpdateParamsValidationDefaultMitigationActionBlock), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", settings.ValidationDefaultMitigationAction) } ``` #### Response ```json { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" } ``` ## Update zone level schema validation settings `client.APIGateway.Settings.SchemaValidation.Edit(ctx, params) (*Settings, error)` **patch** `/zones/{zone_id}/api_gateway/settings/schema_validation` Updates zone level schema validation settings on the zone ### Parameters - `params SettingSchemaValidationEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ValidationDefaultMitigationAction param.Field[SettingSchemaValidationEditParamsValidationDefaultMitigationAction]` Body param: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation `null` will have no effect. - `const SettingSchemaValidationEditParamsValidationDefaultMitigationActionNone SettingSchemaValidationEditParamsValidationDefaultMitigationAction = "none"` - `const SettingSchemaValidationEditParamsValidationDefaultMitigationActionLog SettingSchemaValidationEditParamsValidationDefaultMitigationAction = "log"` - `const SettingSchemaValidationEditParamsValidationDefaultMitigationActionBlock SettingSchemaValidationEditParamsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction param.Field[SettingSchemaValidationEditParamsValidationOverrideMitigationAction]` Body param: When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request To clear any override, use the special value `disable_override` `null` will have no effect. - `const SettingSchemaValidationEditParamsValidationOverrideMitigationActionNone SettingSchemaValidationEditParamsValidationOverrideMitigationAction = "none"` - `const SettingSchemaValidationEditParamsValidationOverrideMitigationActionDisableOverride SettingSchemaValidationEditParamsValidationOverrideMitigationAction = "disable_override"` ### Returns - `type Settings struct{…}` - `ValidationDefaultMitigationAction SettingsValidationDefaultMitigationAction` The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: * `log` - log request when request does not conform to schema * `block` - deny access to the site when request does not conform to schema A special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation - `const SettingsValidationDefaultMitigationActionNone SettingsValidationDefaultMitigationAction = "none"` - `const SettingsValidationDefaultMitigationActionLog SettingsValidationDefaultMitigationAction = "log"` - `const SettingsValidationDefaultMitigationActionBlock SettingsValidationDefaultMitigationAction = "block"` - `ValidationOverrideMitigationAction SettingsValidationOverrideMitigationAction` When set, this overrides both zone level and operation level mitigation actions. - `none` will skip running schema validation entirely for the request - `null` indicates that no override is in place - `const SettingsValidationOverrideMitigationActionNone SettingsValidationOverrideMitigationAction = "none"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) settings, err := client.APIGateway.Settings.SchemaValidation.Edit(context.TODO(), api_gateway.SettingSchemaValidationEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", settings.ValidationDefaultMitigationAction) } ``` #### Response ```json { "validation_default_mitigation_action": "block", "validation_override_mitigation_action": "none" } ``` # User Schemas ## Retrieve information about all schemas on a zone `client.APIGateway.UserSchemas.List(ctx, params) (*V4PagePaginationArray[OldPublicSchema], error)` **get** `/zones/{zone_id}/api_gateway/user_schemas` Lists all OpenAPI schemas uploaded to API Shield for the zone, including their validation status and associated operations. ### Parameters - `params UserSchemaListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `OmitSource param.Field[bool]` Query param: Omit the source-files of schemas and only retrieve their meta-data. - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. - `ValidationEnabled param.Field[bool]` Query param: Flag whether schema is enabled for validation. ### Returns - `type OldPublicSchema struct{…}` - `CreatedAt Time` - `Kind OldPublicSchemaKind` Kind of schema - `const OldPublicSchemaKindOpenAPIV3 OldPublicSchemaKind = "openapi_v3"` - `Name string` Name of the schema - `SchemaID string` UUID. - `Source string` Source of the schema - `ValidationEnabled bool` Flag whether schema is enabled for validation. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.UserSchemas.List(context.TODO(), api_gateway.UserSchemaListParams{ ZoneID: 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" } } ], "result": [ { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Retrieve information about a specific schema on a zone `client.APIGateway.UserSchemas.Get(ctx, schemaID, params) (*OldPublicSchema, error)` **get** `/zones/{zone_id}/api_gateway/user_schemas/{schema_id}` Gets detailed information about a specific uploaded OpenAPI schema, including its contents and validation configuration. ### Parameters - `schemaID string` - `params UserSchemaGetParams` - `ZoneID param.Field[string]` Path param: Identifier. - `OmitSource param.Field[bool]` Query param: Omit the source-files of schemas and only retrieve their meta-data. ### Returns - `type OldPublicSchema struct{…}` - `CreatedAt Time` - `Kind OldPublicSchemaKind` Kind of schema - `const OldPublicSchemaKindOpenAPIV3 OldPublicSchemaKind = "openapi_v3"` - `Name string` Name of the schema - `SchemaID string` UUID. - `Source string` Source of the schema - `ValidationEnabled bool` Flag whether schema is enabled for validation. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) oldPublicSchema, err := client.APIGateway.UserSchemas.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.UserSchemaGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", oldPublicSchema.SchemaID) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "success": true } ``` ## Upload a schema to a zone `client.APIGateway.UserSchemas.New(ctx, params) (*UserSchemaNewResponse, error)` **post** `/zones/{zone_id}/api_gateway/user_schemas` Upload a schema to a zone ### Parameters - `params UserSchemaNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `File param.Field[Reader]` Body param: Schema file bytes - `Kind param.Field[UserSchemaNewParamsKind]` Body param: Kind of schema - `const UserSchemaNewParamsKindOpenAPIV3 UserSchemaNewParamsKind = "openapi_v3"` - `Name param.Field[string]` Body param: Name of the schema - `ValidationEnabled param.Field[UserSchemaNewParamsValidationEnabled]` Body param: Flag whether schema is enabled for validation. - `const UserSchemaNewParamsValidationEnabledTrue UserSchemaNewParamsValidationEnabled = "true"` - `const UserSchemaNewParamsValidationEnabledFalse UserSchemaNewParamsValidationEnabled = "false"` ### Returns - `type UserSchemaNewResponse struct{…}` - `Schema OldPublicSchema` - `CreatedAt Time` - `Kind OldPublicSchemaKind` Kind of schema - `const OldPublicSchemaKindOpenAPIV3 OldPublicSchemaKind = "openapi_v3"` - `Name string` Name of the schema - `SchemaID string` UUID. - `Source string` Source of the schema - `ValidationEnabled bool` Flag whether schema is enabled for validation. - `UploadDetails UserSchemaNewResponseUploadDetails` - `Warnings []UserSchemaNewResponseUploadDetailsWarning` Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema. - `Code int64` Code that identifies the event that occurred. - `Locations []string` JSONPath location(s) in the schema where these events were encountered. See for JSONPath specification. - `Message string` Diagnostic message that describes the event. ### Example ```go package main import ( "bytes" "context" "fmt" "io" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) userSchema, err := client.APIGateway.UserSchemas.New(context.TODO(), api_gateway.UserSchemaNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), File: cloudflare.F(io.Reader(bytes.NewBuffer([]byte("Example data")))), Kind: cloudflare.F(api_gateway.UserSchemaNewParamsKindOpenAPIV3), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", userSchema.Schema) } ``` #### 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" } } ], "result": { "schema": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "upload_details": { "warnings": [ { "code": 28, "locations": [ ".paths[\"/user/{username}\"].put" ], "message": "unsupported media type: application/octet-stream" } ] } }, "success": true } ``` ## Enable validation for a schema `client.APIGateway.UserSchemas.Edit(ctx, schemaID, params) (*OldPublicSchema, error)` **patch** `/zones/{zone_id}/api_gateway/user_schemas/{schema_id}` Activates schema validation for an uploaded OpenAPI schema. Requests to matching endpoints will be validated against the schema definitions. ### Parameters - `schemaID string` - `params UserSchemaEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `ValidationEnabled param.Field[UserSchemaEditParamsValidationEnabled]` Body param: Flag whether schema is enabled for validation. - `const UserSchemaEditParamsValidationEnabledTrue UserSchemaEditParamsValidationEnabled = true` ### Returns - `type OldPublicSchema struct{…}` - `CreatedAt Time` - `Kind OldPublicSchemaKind` Kind of schema - `const OldPublicSchemaKindOpenAPIV3 OldPublicSchemaKind = "openapi_v3"` - `Name string` Name of the schema - `SchemaID string` UUID. - `Source string` Source of the schema - `ValidationEnabled bool` Flag whether schema is enabled for validation. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) oldPublicSchema, err := client.APIGateway.UserSchemas.Edit( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.UserSchemaEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", oldPublicSchema.SchemaID) } ``` #### 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" } } ], "result": { "created_at": "2014-01-01T05:20:00.12345Z", "kind": "openapi_v3", "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "source": "", "validation_enabled": true }, "success": true } ``` ## Delete a schema `client.APIGateway.UserSchemas.Delete(ctx, schemaID, body) (*UserSchemaDeleteResponse, error)` **delete** `/zones/{zone_id}/api_gateway/user_schemas/{schema_id}` Permanently removes an uploaded OpenAPI schema from API Shield schema validation. Operations using this schema will lose their validation rules. ### Parameters - `schemaID string` - `body UserSchemaDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type UserSchemaDeleteResponse struct{…}` - `Errors Message` - `Code int64` - `Message string` - `DocumentationURL string` - `Source MessageItemSource` - `Pointer string` - `Messages Message` - `Success UserSchemaDeleteResponseSuccess` Whether the API call was successful. - `const UserSchemaDeleteResponseSuccessTrue UserSchemaDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) userSchema, err := client.APIGateway.UserSchemas.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.UserSchemaDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", userSchema.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 } ``` ## Domain Types ### Message - `type Message []MessageItem` - `Code int64` - `Message string` - `DocumentationURL string` - `Source MessageItemSource` - `Pointer string` ### Old Public Schema - `type OldPublicSchema struct{…}` - `CreatedAt Time` - `Kind OldPublicSchemaKind` Kind of schema - `const OldPublicSchemaKindOpenAPIV3 OldPublicSchemaKind = "openapi_v3"` - `Name string` Name of the schema - `SchemaID string` UUID. - `Source string` Source of the schema - `ValidationEnabled bool` Flag whether schema is enabled for validation. # Operations ## Retrieve all operations from a schema. `client.APIGateway.UserSchemas.Operations.List(ctx, schemaID, params) (*V4PagePaginationArray[UserSchemaOperationListResponse], error)` **get** `/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations` Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations. ### Parameters - `schemaID string` - `params UserSchemaOperationListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Endpoint param.Field[string]` Query param: Filter results to only include endpoints containing this pattern. - `Feature param.Field[[]UserSchemaOperationListParamsFeature]` Query param: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. - `const UserSchemaOperationListParamsFeatureThresholds UserSchemaOperationListParamsFeature = "thresholds"` - `const UserSchemaOperationListParamsFeatureParameterSchemas UserSchemaOperationListParamsFeature = "parameter_schemas"` - `const UserSchemaOperationListParamsFeatureSchemaInfo UserSchemaOperationListParamsFeature = "schema_info"` - `Host param.Field[[]string]` Query param: Filter results to only include the specified hosts. - `Method param.Field[[]string]` Query param: Filter results to only include the specified HTTP methods. - `OperationStatus param.Field[UserSchemaOperationListParamsOperationStatus]` Query param: Filter results by whether operations exist in API Shield Endpoint Management or not. `new` will just return operations from the schema that do not exist in API Shield Endpoint Management. `existing` will just return operations from the schema that already exist in API Shield Endpoint Management. - `const UserSchemaOperationListParamsOperationStatusNew UserSchemaOperationListParamsOperationStatus = "new"` - `const UserSchemaOperationListParamsOperationStatusExisting UserSchemaOperationListParamsOperationStatus = "existing"` - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. ### Returns - `type UserSchemaOperationListResponse interface{…}` - `type UserSchemaOperationListResponseAPIShieldOperation struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `LastUpdated Time` - `Method UserSchemaOperationListResponseAPIShieldOperationMethod` The HTTP method used to access the endpoint. - `const UserSchemaOperationListResponseAPIShieldOperationMethodGet UserSchemaOperationListResponseAPIShieldOperationMethod = "GET"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodPost UserSchemaOperationListResponseAPIShieldOperationMethod = "POST"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodHead UserSchemaOperationListResponseAPIShieldOperationMethod = "HEAD"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodOptions UserSchemaOperationListResponseAPIShieldOperationMethod = "OPTIONS"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodPut UserSchemaOperationListResponseAPIShieldOperationMethod = "PUT"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodDelete UserSchemaOperationListResponseAPIShieldOperationMethod = "DELETE"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodConnect UserSchemaOperationListResponseAPIShieldOperationMethod = "CONNECT"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodPatch UserSchemaOperationListResponseAPIShieldOperationMethod = "PATCH"` - `const UserSchemaOperationListResponseAPIShieldOperationMethodTrace UserSchemaOperationListResponseAPIShieldOperationMethod = "TRACE"` - `OperationID string` UUID. - `Features UserSchemaOperationListResponseAPIShieldOperationFeatures` - `type UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureThresholds struct{…}` - `Thresholds UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds` - `AuthIDTokens int64` The total number of auth-ids seen across this calculation. - `DataPoints int64` The number of data points used for the threshold suggestion calculation. - `LastUpdated Time` - `P50 int64` The p50 quantile of requests (in period_seconds). - `P90 int64` The p90 quantile of requests (in period_seconds). - `P99 int64` The p99 quantile of requests (in period_seconds). - `PeriodSeconds int64` The period over which this threshold is suggested. - `Requests int64` The estimated number of requests covered by these calculations. - `SuggestedThreshold int64` The suggested threshold in requests done by the same auth_id or period_seconds. - `type UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas struct{…}` - `ParameterSchemas UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas` - `LastUpdated Time` - `ParameterSchemas UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas` An operation schema object containing a response. - `Parameters []unknown` An array containing the learned parameter schemas. - `Responses unknown` An empty response object. This field is required to yield a valid operation schema. - `type UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting struct{…}` - `APIRouting UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting` API Routing settings on endpoint. - `LastUpdated Time` - `Route string` Target route. - `type UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals struct{…}` - `ConfidenceIntervals UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals` - `LastUpdated Time` - `SuggestedThreshold UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold` - `ConfidenceIntervals UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals` - `P90 UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P95 UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `P99 UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99` Upper and lower bound for percentile estimate - `Lower float64` Lower bound for percentile estimate - `Upper float64` Upper bound for percentile estimate - `Mean float64` Suggested threshold. - `type UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo struct{…}` - `SchemaInfo UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo` - `ActiveSchema UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema` Schema active on endpoint. - `ID string` UUID. - `CreatedAt Time` - `IsLearned bool` True if schema is Cloudflare-provided. - `Name string` Schema file name. - `LearnedAvailable bool` True if a Cloudflare-provided learned schema is available for this endpoint. - `MitigationAction UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction` Action taken on requests failing validation. - `const UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionNone UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "none"` - `const UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionLog UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "log"` - `const UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationActionBlock UserSchemaOperationListResponseAPIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoMitigationAction = "block"` - `type UserSchemaOperationListResponseAPIShieldBasicOperation struct{…}` - `Endpoint string` The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/. - `Host string` RFC3986-compliant host. - `Method UserSchemaOperationListResponseAPIShieldBasicOperationMethod` The HTTP method used to access the endpoint. - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodGet UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "GET"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodPost UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "POST"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodHead UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "HEAD"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodOptions UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "OPTIONS"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodPut UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "PUT"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodDelete UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "DELETE"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodConnect UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "CONNECT"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodPatch UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "PATCH"` - `const UserSchemaOperationListResponseAPIShieldBasicOperationMethodTrace UserSchemaOperationListResponseAPIShieldBasicOperationMethod = "TRACE"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.UserSchemas.Operations.List( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", api_gateway.UserSchemaOperationListParams{ ZoneID: 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" } } ], "result": [ { "endpoint": "/api/v1/users/{var1}", "host": "www.example.com", "last_updated": "2014-01-01T05:20:00.12345Z", "method": "GET", "operation_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "features": { "thresholds": { "auth_id_tokens": 0, "data_points": 0, "last_updated": "2014-01-01T05:20:00.12345Z", "p50": 0, "p90": 0, "p99": 0, "period_seconds": 0, "requests": 0, "suggested_threshold": 0 } } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` # Hosts ## Retrieve schema hosts in a zone `client.APIGateway.UserSchemas.Hosts.List(ctx, params) (*V4PagePaginationArray[UserSchemaHostListResponse], error)` **get** `/zones/{zone_id}/api_gateway/user_schemas/hosts` Lists all unique hosts found in uploaded OpenAPI schemas for the zone. Useful for understanding which domains have schema coverage. ### Parameters - `params UserSchemaHostListParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Maximum number of results per page. ### Returns - `type UserSchemaHostListResponse struct{…}` - `CreatedAt Time` - `Hosts []string` Hosts serving the schema, e.g zone.host.com - `Name string` Name of the schema - `SchemaID string` UUID. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.APIGateway.UserSchemas.Hosts.List(context.TODO(), api_gateway.UserSchemaHostListParams{ ZoneID: 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": [ { "created_at": "2014-01-01T05:20:00.12345Z", "hosts": [ "string" ], "name": "petstore schema", "schema_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` # Expression Template # Fallthrough ## Generate fallthrough WAF expression template from a set of API hosts `client.APIGateway.ExpressionTemplate.Fallthrough.New(ctx, params) (*ExpressionTemplateFallthroughNewResponse, error)` **post** `/zones/{zone_id}/api_gateway/expression-template/fallthrough` Creates an expression template fallthrough rule for API Shield. Used for configuring default behavior when no other expression templates match. ### Parameters - `params ExpressionTemplateFallthroughNewParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Hosts param.Field[[]string]` Body param: List of hosts to be targeted in the expression ### Returns - `type ExpressionTemplateFallthroughNewResponse struct{…}` - `Expression string` WAF Expression for fallthrough - `Title string` Title for the expression ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/api_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) fallthrough_, err := client.APIGateway.ExpressionTemplate.Fallthrough.New(context.TODO(), api_gateway.ExpressionTemplateFallthroughNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Hosts: cloudflare.F([]string{"{zone}.domain1.tld", "domain2.tld"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fallthrough_.Expression) } ``` #### 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" } } ], "result": { "expression": "(cf.api_gateway.fallthrough_detected)", "title": "Fallthrough Expression for [zone.domain.tld]" }, "success": true } ```