From 31cb137b1f74d77cd325411b9abb14499f41f217 Mon Sep 17 00:00:00 2001 From: AlejandroFabianCampos Date: Tue, 22 Sep 2026 11:56:26 -0500 Subject: [PATCH 1/4] feat: provider skeleton with endpoint resource and chains data source Co-Authored-By: Claude Opus 5 (1M context) --- .gitignore | 7 + GNUmakefile | 32 + README.md | 58 +- api/admin/admin.gen.go | 16817 ++++++++++++++++++++ api/admin/config.yaml | 8 + api/admin/gen/main.go | 170 + api/admin/openapi.json | 5829 +++++++ api/admin/openapi.upstream.json | 5826 +++++++ api/admin/patches.json | 173 + examples/endpoint/main.tf | 33 + go.mod | 37 + go.sum | 114 + internal/client/client.go | 406 + internal/client/client_test.go | 55 + internal/client/endpoint_test.go | 108 + internal/client/errors.go | 53 + internal/client/transport.go | 140 + internal/provider/chains_data_source.go | 132 + internal/provider/data.go | 11 + internal/provider/endpoint_resource.go | 479 + internal/provider/provider.go | 142 + internal/provider/provider_test.go | 40 + internal/provider/slug_validation.go | 75 + internal/provider/slug_validation_test.go | 76 + main.go | 27 + 25 files changed, 30836 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 GNUmakefile create mode 100644 api/admin/admin.gen.go create mode 100644 api/admin/config.yaml create mode 100644 api/admin/gen/main.go create mode 100644 api/admin/openapi.json create mode 100644 api/admin/openapi.upstream.json create mode 100644 api/admin/patches.json create mode 100644 examples/endpoint/main.tf create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/client/client.go create mode 100644 internal/client/client_test.go create mode 100644 internal/client/endpoint_test.go create mode 100644 internal/client/errors.go create mode 100644 internal/client/transport.go create mode 100644 internal/provider/chains_data_source.go create mode 100644 internal/provider/data.go create mode 100644 internal/provider/endpoint_resource.go create mode 100644 internal/provider/provider.go create mode 100644 internal/provider/provider_test.go create mode 100644 internal/provider/slug_validation.go create mode 100644 internal/provider/slug_validation_test.go create mode 100644 main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a98b3d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +terraform-provider-quicknode +dist/ +*.tfstate +*.tfstate.* +.terraform/ +.terraform.lock.hcl +.env diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..8dc101d --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,32 @@ +OAPI_CODEGEN_VERSION ?= v2.8.0 +ADMIN_SPEC_URL ?= https://www.quicknode.com/docs/openapi/admin-api.openapi.json + +default: build + +build: + go build ./... + +# vendor refreshes the upstream Admin API spec. Review the diff before +# generating: an upstream change can silently invalidate a patch in +# api/admin/patches.json. +vendor: + curl -sSf -o api/admin/openapi.upstream.json $(ADMIN_SPEC_URL) + +generate: + go run ./api/admin/gen + cd api/admin && go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@$(OAPI_CODEGEN_VERSION) -config config.yaml openapi.json + gofmt -w api/admin/admin.gen.go + +lint: + gofmt -l . | tee /dev/stderr | (! read) + go vet ./... + +test: + go test ./... + +# testacc creates real, billable Quicknode resources. It needs QUICKNODE_API_KEY +# for a paid account that is dedicated to testing. +testacc: + TF_ACC=1 go test ./... -v -timeout 30m + +.PHONY: default build vendor generate lint test testacc diff --git a/README.md b/README.md index 6338fe4..f664dd6 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,57 @@ terraform { provider "quicknode" {} resource "quicknode_endpoint" "payments" { - chain = "ethereum" + chain = "eth" network = "mainnet" label = "payments-prod" + tags = ["prod", "payments"] } +# Working endpoint, credential included. output "rpc_url" { - value = quicknode_endpoint.payments.http_url - sensitive = true # the URL embeds your auth token + value = quicknode_endpoint.payments.http_url_with_token + sensitive = true +} + +# Same endpoint with the credential removed: safe to log or display. +output "rpc_base_url" { + value = quicknode_endpoint.payments.http_url } ``` -Authentication uses a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) key (paid plans), via the `QUICKNODE_API_KEY` environment variable or the provider block. Endpoint URLs contain auth tokens and are stored in Terraform state — use encrypted remote state. +Chain slugs are abbreviations that often differ from the chain's name — Ethereum is `eth`, Avalanche is `avax`, Arbitrum is `arb`, Polygon is `matic`. Read `data.quicknode_chains` for the full list. + +Authentication uses a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) key (paid plans), via the `QUICKNODE_API_KEY` environment variable or the provider block. + +The Admin API returns endpoint URLs with the auth token embedded. The provider exposes both forms: + +| Attribute | Sensitive | Use it for | +|---|---|---| +| `http_url_with_token`, `wss_url_with_token` | yes | anything that makes RPC calls | +| `http_url`, `wss_url` | no | logging, display, anything that must not hold a credential | +| `tokens` | yes | rotation workflows that need token ids | + +Do not rebuild a URL by joining `http_url` to a token. The token is not always the last path segment — some chains append a suffix, as in `https:////evm` — so a hand-assembled URL works on Ethereum and breaks elsewhere. `wss_url` is null on chains without WebSocket support. + +Token values land in Terraform state either way — use encrypted remote state. ## Resources | Name | Status | |---|---| -| `quicknode_endpoint` | ✅ available | -| Endpoint security (IP / domain allowlists, method filters) | ✅ available (being redesigned) | +| `quicknode_endpoint` (label, status, tags, multichain, import) | ✅ available | +| `data.quicknode_chains` | ✅ available | +| `security_options` on `quicknode_endpoint` | 🚧 planned | +| `quicknode_endpoint_ip`, `quicknode_endpoint_domain_mask`, `quicknode_endpoint_referrer`, `quicknode_endpoint_jwt`, `quicknode_endpoint_request_filter` | 🚧 planned | | `quicknode_endpoint_rate_limits`, `quicknode_method_rate_limit` | 🚧 planned | -| `quicknode_stream`, `quicknode_webhook` | 🚧 planned | -| Data sources: `quicknode_chains`, `quicknode_endpoint(s)` | ✅ available | +| `data.quicknode_endpoint(s)` | 🚧 planned | +| `quicknode_stream`, `quicknode_webhook` | 🚧 planned, blocked on published specs | + +Security splits along the way the API splits. The toggles are a single PATCH on +the endpoint, so they become a `security_options` attribute on +`quicknode_endpoint`. Each allowlist entry is a POST/DELETE with no update, so +each becomes its own resource keyed by `endpoint_id` — which also keeps a +one-address change from showing up as a diff on the whole endpoint. Full documentation lives in [`docs/`](./docs) and, once published, on the Terraform Registry. @@ -52,12 +81,17 @@ Full documentation lives in [`docs/`](./docs) and, once published, on the Terraf Requires Go (see `go.mod`) and Terraform >= 1.13. ```sh -make generate # regenerate the API client and docs -make lint # golangci-lint -go build ./... -TF_ACC=1 go test ./... # acceptance tests: creates real, billable resources +make vendor # refresh the upstream Admin API spec +make generate # apply api/admin/patches.json, then regenerate the client +make lint # gofmt + go vet +make test # unit tests +make testacc # acceptance tests: creates real, billable resources ``` +The client is generated from `api/admin/openapi.upstream.json`, which is vendored +verbatim so `make vendor` can refresh it. `api/admin/patches.json` holds the local +schema corrections applied before generation, keeping the vendored copy unmodified. + Contributions welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md). ## License diff --git a/api/admin/admin.gen.go b/api/admin/admin.gen.go new file mode 100644 index 0000000..7de3ec8 --- /dev/null +++ b/api/admin/admin.gen.go @@ -0,0 +1,16817 @@ +// Package admin provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. +package admin + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" +) + +// GetV0EndpointsParams defines parameters for GetV0Endpoints. +type GetV0EndpointsParams struct { + // Limit Specifies the maximum number of endpoints to retrieve in the response. The default value is set to 20 + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Specifies the number of endpoints to skip before starting to retrieve the list + Offset *int `form:"offset,omitempty" json:"offset,omitempty"` + + // Search Search endpoints by subdomain or label + Search *string `form:"search,omitempty" json:"search,omitempty"` + + // SortBy Sort field. Accepted values: name, status, network, label, tags, usage, created_at. Default value: created_at + SortBy *string `form:"sort_by,omitempty" json:"sort_by,omitempty"` + + // SortDirection Sort direction. Accepted values: asc, desc. Default value: ASC + SortDirection *string `form:"sort_direction,omitempty" json:"sort_direction,omitempty"` + + // Networks Filter by network name(s) + Networks *[]interface{} `form:"networks,omitempty" json:"networks,omitempty"` + + // Statuses Filter by endpoint status. Accepted values: active, paused + Statuses *[]interface{} `form:"statuses,omitempty" json:"statuses,omitempty"` + + // Labels Filter by endpoint label(s) + Labels *[]interface{} `form:"labels,omitempty" json:"labels,omitempty"` + + // Dedicated Filter for dedicated endpoints only + Dedicated *bool `form:"dedicated,omitempty" json:"dedicated,omitempty"` + + // IsFlatRate Filter for flat rate endpoints only + IsFlatRate *bool `form:"is_flat_rate,omitempty" json:"is_flat_rate,omitempty"` + + // TagIds Filter endpoints by tag IDs. Can be a single integer or an array of integers. Optional. Cannot be used together with tag_labels + TagIds *[]int `form:"tag_ids,omitempty" json:"tag_ids,omitempty"` + + // TagLabels Filter endpoints by tag labels. Can be a single string or an array of strings. Optional. Cannot be used together with tag_ids + TagLabels *[]string `form:"tag_labels,omitempty" json:"tag_labels,omitempty"` +} + +// PostV0EndpointsJSONBody defines parameters for PostV0Endpoints. +type PostV0EndpointsJSONBody struct { + // Chain The chain name for which the endpoint is to be created + Chain string `json:"chain"` + + // Network The chain network for which the endpoint is to be created + Network string `json:"network"` +} + +// PostV0EndpointsBulkStatusJSONBody defines parameters for PostV0EndpointsBulkStatus. +type PostV0EndpointsBulkStatusJSONBody struct { + // Ids An array of endpoint IDs to update + Ids []interface{} `json:"ids"` + + // Status The status to apply. Accepted values: active, paused + Status string `json:"status"` +} + +// DeleteV0EndpointsBulkTagsJSONBody defines parameters for DeleteV0EndpointsBulkTags. +type DeleteV0EndpointsBulkTagsJSONBody struct { + // Ids An array of endpoint IDs to remove the tag from + Ids []interface{} `json:"ids"` + + // TagId The ID of the tag to remove from the endpoints + TagId int `json:"tag_id"` +} + +// PostV0EndpointsBulkTagsJSONBody defines parameters for PostV0EndpointsBulkTags. +type PostV0EndpointsBulkTagsJSONBody struct { + // Ids An array of endpoint IDs to tag + Ids []interface{} `json:"ids"` + + // Label The tag label to add to the endpoints + Label string `json:"label"` +} + +// PatchV0EndpointsTagsByIdJSONBody defines parameters for PatchV0EndpointsTagsById. +type PatchV0EndpointsTagsByIdJSONBody struct { + // Label The new label for the tag + Label string `json:"label"` +} + +// PatchV0EndpointsByIdJSONBody defines parameters for PatchV0EndpointsById. +type PatchV0EndpointsByIdJSONBody struct { + // Label A descriptive label for the endpoint which you need to update to + Label string `json:"label"` +} + +// PatchV0EndpointsByIdIpCustomHeaderJSONBody defines parameters for PatchV0EndpointsByIdIpCustomHeader. +type PatchV0EndpointsByIdIpCustomHeaderJSONBody struct { + // HeaderName The name of the IP custom header + HeaderName string `json:"header_name"` +} + +// GetV0EndpointsByIdLogDetailsParams defines parameters for GetV0EndpointsByIdLogDetails. +type GetV0EndpointsByIdLogDetailsParams struct { + // RequestId The UUID of the log entry + RequestId string `form:"request_id" json:"request_id"` +} + +// GetV0EndpointsByIdLogsParams defines parameters for GetV0EndpointsByIdLogs. +type GetV0EndpointsByIdLogsParams struct { + // From The start timestamp encoded in ISO8601 format + From string `form:"from" json:"from"` + + // To The end timestamp encoded in ISO8601 format + To string `form:"to" json:"to"` + + // Limit Number of logs (1-100, default: 20) + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // IncludeDetails Includes request/response details. The default value is set to be false + IncludeDetails *bool `form:"include_details,omitempty" json:"include_details,omitempty"` + + // NextAt Pagination token from previous response + NextAt *string `form:"next_at,omitempty" json:"next_at,omitempty"` +} + +// PostV0EndpointsByIdMethodRateLimitsJSONBody defines parameters for PostV0EndpointsByIdMethodRateLimits. +type PostV0EndpointsByIdMethodRateLimitsJSONBody struct { + // Interval Specifies the time interval for the rate limit; valid values include second, minute or hour + Interval string `json:"interval"` + + // Methods An array of method names to which the rate limiter applies + Methods []string `json:"methods"` + + // Rate Specifies the maximum number of requests allowed for the specified methods within the defined interval + Rate int `json:"rate"` +} + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONBody defines parameters for PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId. +type PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONBody struct { + // Methods An array of method names to which the rate limiter applies + Methods []interface{} `json:"methods"` + + // Rate Specifies the maximum number of requests allowed for the specified methods within the defined interval + Rate int `json:"rate"` + + // Status The current status of the rate limiter; valid values include enabled or disabled + Status string `json:"status"` +} + +// GetV0EndpointsByIdMetricsParams defines parameters for GetV0EndpointsByIdMetrics. +type GetV0EndpointsByIdMetricsParams struct { + // Period Specifies the time period for which the data is to be retrieved. Valid values includes - hour, day, week or month + Period string `form:"period" json:"period"` + + // Metric Specifies the type of metric to retrieve. Valid values includes - method_calls_over_time, response_status_over_time, method_call_breakdown, response_status_breakdown or method_response_time_max + Metric string `form:"metric" json:"metric"` + + // Percentile Required when metric is method_response_time_max. Selects the response time percentile to return. For example, 95 returns the response time at or below which 95% of observed RPC responses completed. Accepted values: integers from 1 to 100, such as 50, 95, or 99 + Percentile *int `form:"percentile,omitempty" json:"percentile,omitempty"` +} + +// PatchV0EndpointsByIdRateLimitsJSONBody defines parameters for PatchV0EndpointsByIdRateLimits. +type PatchV0EndpointsByIdRateLimitsJSONBody struct { + // RateLimits Contains the rate limit configurations that you want to update + RateLimits struct { + // Rpd Specifies the maximum number of requests allowed per day + Rpd *int `json:"rpd,omitempty"` + + // Rpm Specifies the maximum number of requests allowed per minute + Rpm *int `json:"rpm,omitempty"` + + // Rps Specifies the maximum number of requests allowed per second + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits"` +} + +// PostV0EndpointsByIdSecurityDomainMasksJSONBody defines parameters for PostV0EndpointsByIdSecurityDomainMasks. +type PostV0EndpointsByIdSecurityDomainMasksJSONBody struct { + // DomainMask The domain mask that you will use to mask your endpoint + DomainMask string `json:"domain_mask"` +} + +// PostV0EndpointsByIdSecurityIpsJSONBody defines parameters for PostV0EndpointsByIdSecurityIps. +type PostV0EndpointsByIdSecurityIpsJSONBody struct { + // Ip The specific IP address that is allowed to access the API endpoint. Only requests originating from this IP address will be permitted + Ip string `json:"ip"` +} + +// PostV0EndpointsByIdSecurityJwtsJSONBody defines parameters for PostV0EndpointsByIdSecurityJwts. +type PostV0EndpointsByIdSecurityJwtsJSONBody struct { + // Kid The key identifier (KID) associated with the public key + Kid *string `json:"kid,omitempty"` + + // Name A human-readable name for the JWT configuration + Name *string `json:"name,omitempty"` + + // PublicKey The public key used to verify the JWT token + PublicKey *string `json:"public_key,omitempty"` +} + +// PostV0EndpointsByIdSecurityReferrersJSONBody defines parameters for PostV0EndpointsByIdSecurityReferrers. +type PostV0EndpointsByIdSecurityReferrersJSONBody struct { + // Referrer The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted + Referrer string `json:"referrer"` +} + +// PostV0EndpointsByIdSecurityRequestFiltersJSONBody defines parameters for PostV0EndpointsByIdSecurityRequestFilters. +type PostV0EndpointsByIdSecurityRequestFiltersJSONBody struct { + // Method An array of method names to whitelist + Method *[]string `json:"method,omitempty"` +} + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONBody defines parameters for PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId. +type PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONBody struct { + // Method An array of method names to whitelist + Method *[]interface{} `json:"method,omitempty"` +} + +// PatchV0EndpointsByIdSecurityOptionsJSONBody defines parameters for PatchV0EndpointsByIdSecurityOptions. +type PatchV0EndpointsByIdSecurityOptionsJSONBody struct { + // Options The options object which contains the following fields: + Options *struct { + // Cors Configures Cross-Origin Resource Sharing (CORS) policies to control how resources can be accessed by external domains. Possible values includes 'enabled' or 'disabled' + Cors *string `json:"cors,omitempty"` + + // DomainMasks Configures the masking or restriction of specific domains. Possible values includes 'enabled' or 'disabled' + DomainMasks *string `json:"domainMasks,omitempty"` + + // Hsts The HTTP Strict Transport Security (HSTS). Possible values includes 'enabled' or 'disabled' + Hsts *string `json:"hsts,omitempty"` + + // Ips Specifies IP address-based restrictions or permissions. Possible values includes 'enabled' or 'disabled' + Ips *string `json:"ips,omitempty"` + + // Jwts Configures JSON Web Tokens (JWTs) for secure authentication and authorization. Possible values includes 'enabled' or 'disabled' + Jwts *string `json:"jwts,omitempty"` + + // Referrers The URL or domain that is allowed to access the specific API endpoint. Possible values includes 'enabled' or 'disabled' + Referrers *string `json:"referrers,omitempty"` + + // Tokens Controls the token-based authentication mechanism. Possible values includes 'enabled' or 'disabled' + Tokens *string `json:"tokens,omitempty"` + } `json:"options,omitempty"` +} + +// PatchV0EndpointsByIdStatusJSONBody defines parameters for PatchV0EndpointsByIdStatus. +type PatchV0EndpointsByIdStatusJSONBody struct { + // Status The new status to apply to the endpoint. Accepted values are 'active' and 'paused' + Status string `json:"status"` +} + +// PostV0EndpointsByIdTagsJSONBody defines parameters for PostV0EndpointsByIdTags. +type PostV0EndpointsByIdTagsJSONBody struct { + // Label The label/name for the new tag + Label string `json:"label"` +} + +// GetV0MetricsParams defines parameters for GetV0Metrics. +type GetV0MetricsParams struct { + // Period The time period for the metrics. Accepted values: hour, day, week, month + Period string `form:"period" json:"period"` + + // Metric The metric to retrieve. Accepted values: method_calls_over_time, metered_endpoint_data_over_time, metered_endpoint_credits_over_time, credits_over_time + Metric string `form:"metric" json:"metric"` +} + +// PostV0TeamsJSONBody defines parameters for PostV0Teams. +type PostV0TeamsJSONBody struct { + // Name The name for the new team + Name string `json:"name"` +} + +// PatchV0TeamsByIdEndpointsJSONBody defines parameters for PatchV0TeamsByIdEndpoints. +type PatchV0TeamsByIdEndpointsJSONBody struct { + // EndpointIds An array of endpoint IDs to assign to the team. Pass an empty array to unassign all endpoints + EndpointIds []interface{} `json:"endpoint_ids"` +} + +// PostV0TeamsByIdMembersJSONBody defines parameters for PostV0TeamsByIdMembers. +type PostV0TeamsByIdMembersJSONBody struct { + // Email The email address of the user to invite + Email string `json:"email"` + + // FullName The full name of the user to invite (required only for new users) + FullName *string `json:"full_name,omitempty"` + + // Role The role to assign to the invited user. Valid values: admin, viewer, billing. Required only for new users + Role *string `json:"role,omitempty"` +} + +// PatchV0ToolingAccessJSONBody defines parameters for PatchV0ToolingAccess. +type PatchV0ToolingAccessJSONBody struct { + // Enabled Set to true to enable (provision/reactivate) Tooling Access or false to disable it + Enabled bool `json:"enabled"` +} + +// GetV0UsageRpcParams defines parameters for GetV0UsageRpc. +type GetV0UsageRpcParams struct { + // StartTime Specifies the start of the time period for which the usage data is to be retrieved + StartTime *int `form:"start_time,omitempty" json:"start_time,omitempty"` + + // EndTime Specifies the end of the time period for which the usage data is to be retrieved + EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"` +} + +// GetV0UsageRpcByChainParams defines parameters for GetV0UsageRpcByChain. +type GetV0UsageRpcByChainParams struct { + // StartTime Specifies the start of the time period for which the usage data is to be retrieved + StartTime *int `form:"start_time,omitempty" json:"start_time,omitempty"` + + // EndTime Specifies the end of the time period for which the usage data is to be retrieved + EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"` +} + +// GetV0UsageRpcByEndpointParams defines parameters for GetV0UsageRpcByEndpoint. +type GetV0UsageRpcByEndpointParams struct { + // StartTime Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization. + StartTime *int `form:"start_time,omitempty" json:"start_time,omitempty"` + + // EndTime Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization. + EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"` +} + +// GetV0UsageRpcByMethodParams defines parameters for GetV0UsageRpcByMethod. +type GetV0UsageRpcByMethodParams struct { + // StartTime Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization. + StartTime *int `form:"start_time,omitempty" json:"start_time,omitempty"` + + // EndTime Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization. + EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"` +} + +// GetV0UsageRpcByTagParams defines parameters for GetV0UsageRpcByTag. +type GetV0UsageRpcByTagParams struct { + // StartTime Start time as a unix timestamp + StartTime *int `form:"start_time,omitempty" json:"start_time,omitempty"` + + // EndTime End time as a unix timestamp + EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"` +} + +// PostV0EndpointsJSONRequestBody defines body for PostV0Endpoints for application/json ContentType. +type PostV0EndpointsJSONRequestBody PostV0EndpointsJSONBody + +// PostV0EndpointsBulkStatusJSONRequestBody defines body for PostV0EndpointsBulkStatus for application/json ContentType. +type PostV0EndpointsBulkStatusJSONRequestBody PostV0EndpointsBulkStatusJSONBody + +// DeleteV0EndpointsBulkTagsJSONRequestBody defines body for DeleteV0EndpointsBulkTags for application/json ContentType. +type DeleteV0EndpointsBulkTagsJSONRequestBody DeleteV0EndpointsBulkTagsJSONBody + +// PostV0EndpointsBulkTagsJSONRequestBody defines body for PostV0EndpointsBulkTags for application/json ContentType. +type PostV0EndpointsBulkTagsJSONRequestBody PostV0EndpointsBulkTagsJSONBody + +// PatchV0EndpointsTagsByIdJSONRequestBody defines body for PatchV0EndpointsTagsById for application/json ContentType. +type PatchV0EndpointsTagsByIdJSONRequestBody PatchV0EndpointsTagsByIdJSONBody + +// PatchV0EndpointsByIdJSONRequestBody defines body for PatchV0EndpointsById for application/json ContentType. +type PatchV0EndpointsByIdJSONRequestBody PatchV0EndpointsByIdJSONBody + +// PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody defines body for PatchV0EndpointsByIdIpCustomHeader for application/json ContentType. +type PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody PatchV0EndpointsByIdIpCustomHeaderJSONBody + +// PostV0EndpointsByIdMethodRateLimitsJSONRequestBody defines body for PostV0EndpointsByIdMethodRateLimits for application/json ContentType. +type PostV0EndpointsByIdMethodRateLimitsJSONRequestBody PostV0EndpointsByIdMethodRateLimitsJSONBody + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody defines body for PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId for application/json ContentType. +type PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONBody + +// PatchV0EndpointsByIdRateLimitsJSONRequestBody defines body for PatchV0EndpointsByIdRateLimits for application/json ContentType. +type PatchV0EndpointsByIdRateLimitsJSONRequestBody PatchV0EndpointsByIdRateLimitsJSONBody + +// PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody defines body for PostV0EndpointsByIdSecurityDomainMasks for application/json ContentType. +type PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody PostV0EndpointsByIdSecurityDomainMasksJSONBody + +// PostV0EndpointsByIdSecurityIpsJSONRequestBody defines body for PostV0EndpointsByIdSecurityIps for application/json ContentType. +type PostV0EndpointsByIdSecurityIpsJSONRequestBody PostV0EndpointsByIdSecurityIpsJSONBody + +// PostV0EndpointsByIdSecurityJwtsJSONRequestBody defines body for PostV0EndpointsByIdSecurityJwts for application/json ContentType. +type PostV0EndpointsByIdSecurityJwtsJSONRequestBody PostV0EndpointsByIdSecurityJwtsJSONBody + +// PostV0EndpointsByIdSecurityReferrersJSONRequestBody defines body for PostV0EndpointsByIdSecurityReferrers for application/json ContentType. +type PostV0EndpointsByIdSecurityReferrersJSONRequestBody PostV0EndpointsByIdSecurityReferrersJSONBody + +// PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody defines body for PostV0EndpointsByIdSecurityRequestFilters for application/json ContentType. +type PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody PostV0EndpointsByIdSecurityRequestFiltersJSONBody + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody defines body for PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId for application/json ContentType. +type PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONBody + +// PatchV0EndpointsByIdSecurityOptionsJSONRequestBody defines body for PatchV0EndpointsByIdSecurityOptions for application/json ContentType. +type PatchV0EndpointsByIdSecurityOptionsJSONRequestBody PatchV0EndpointsByIdSecurityOptionsJSONBody + +// PatchV0EndpointsByIdStatusJSONRequestBody defines body for PatchV0EndpointsByIdStatus for application/json ContentType. +type PatchV0EndpointsByIdStatusJSONRequestBody PatchV0EndpointsByIdStatusJSONBody + +// PostV0EndpointsByIdTagsJSONRequestBody defines body for PostV0EndpointsByIdTags for application/json ContentType. +type PostV0EndpointsByIdTagsJSONRequestBody PostV0EndpointsByIdTagsJSONBody + +// PostV0TeamsJSONRequestBody defines body for PostV0Teams for application/json ContentType. +type PostV0TeamsJSONRequestBody PostV0TeamsJSONBody + +// PatchV0TeamsByIdEndpointsJSONRequestBody defines body for PatchV0TeamsByIdEndpoints for application/json ContentType. +type PatchV0TeamsByIdEndpointsJSONRequestBody PatchV0TeamsByIdEndpointsJSONBody + +// PostV0TeamsByIdMembersJSONRequestBody defines body for PostV0TeamsByIdMembers for application/json ContentType. +type PostV0TeamsByIdMembersJSONRequestBody PostV0TeamsByIdMembersJSONBody + +// PatchV0ToolingAccessJSONRequestBody defines body for PatchV0ToolingAccess for application/json ContentType. +type PatchV0ToolingAccessJSONRequestBody PatchV0ToolingAccessJSONBody + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + + // GetV0AccountInfo Returns information about the account associated with the API key. + // + // Corresponds with GET /v0/account/info (the `GetV0AccountInfo` operationId). + GetV0AccountInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0ApiCreditsByChain Returns the API credit cost of each RPC method available on a chain. + // + // Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version. + // + // Corresponds with GET /v0/api-credits/{chain} (the `GetV0ApiCreditsByChain` operationId). + GetV0ApiCreditsByChain(ctx context.Context, chain string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0BillingInvoices Returns a list of invoices + // + // Corresponds with GET /v0/billing/invoices (the `GetV0BillingInvoices` operationId). + GetV0BillingInvoices(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0BillingPayments Returns a list of payments. + // + // Corresponds with GET /v0/billing/payments (the `GetV0BillingPayments` operationId). + GetV0BillingPayments(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0Chains Returns a list of chains. + // + // Corresponds with GET /v0/chains (the `GetV0Chains` operationId). + GetV0Chains(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0Endpoints Retrieves a list of endpoints. + // + // Retrieves a list of endpoints. Supports searching, filtering, and sorting. + // + // Corresponds with GET /v0/endpoints (the `GetV0Endpoints` operationId). + GetV0Endpoints(ctx context.Context, params *GetV0EndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsWithBody Creates a new endpoint. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). + PostV0EndpointsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0Endpoints Creates a new endpoint. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). + PostV0Endpoints(ctx context.Context, body PostV0EndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsBulkStatusWithBody Pause or unpause multiple endpoints in a single call. + // + // Pause or unpause multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). + PostV0EndpointsBulkStatusWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsBulkStatus Pause or unpause multiple endpoints in a single call. + // + // Pause or unpause multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). + PostV0EndpointsBulkStatus(ctx context.Context, body PostV0EndpointsBulkStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsBulkTagsWithBody Remove a tag from multiple endpoints in a single call. + // + // Remove a tag from multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type. + // + // Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). + DeleteV0EndpointsBulkTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsBulkTags Remove a tag from multiple endpoints in a single call. + // + // Remove a tag from multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). + DeleteV0EndpointsBulkTags(ctx context.Context, body DeleteV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsBulkTagsWithBody Add a tag to multiple endpoints in a single call. + // + // Add a tag to multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). + PostV0EndpointsBulkTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsBulkTags Add a tag to multiple endpoints in a single call. + // + // Add a tag to multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). + PostV0EndpointsBulkTags(ctx context.Context, body PostV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsTags Returns all account-level tags including those with zero endpoints. + // + // Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+. + // + // Corresponds with GET /v0/endpoints/tags (the `GetV0EndpointsTags` operationId). + GetV0EndpointsTags(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsTagsById Deletes an account tag. + // + // Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only. + // + // Corresponds with DELETE /v0/endpoints/tags/{id} (the `DeleteV0EndpointsTagsById` operationId). + DeleteV0EndpointsTagsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsTagsByIdWithBody Renames an account tag. + // + // Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). + PatchV0EndpointsTagsByIdWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsTagsById Renames an account tag. + // + // Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). + PatchV0EndpointsTagsById(ctx context.Context, id int, body PatchV0EndpointsTagsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsById Deletes an endpoint. + // + // Corresponds with DELETE /v0/endpoints/{id} (the `DeleteV0EndpointsById` operationId). + DeleteV0EndpointsById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsById Returns info for a specific endpoint. + // + // Corresponds with GET /v0/endpoints/{id} (the `GetV0EndpointsById` operationId). + GetV0EndpointsById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdWithBody Updates an endpoint. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). + PatchV0EndpointsByIdWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsById Updates an endpoint. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). + PatchV0EndpointsById(ctx context.Context, id string, body PatchV0EndpointsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdDisableMultichain Disables multichain for a specific endpoint. + // + // Corresponds with POST /v0/endpoints/{id}/disable_multichain (the `PostV0EndpointsByIdDisableMultichain` operationId). + PostV0EndpointsByIdDisableMultichain(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdEnableMultichain Enables multichain for a specific endpoint. + // + // Corresponds with POST /v0/endpoints/{id}/enable_multichain (the `PostV0EndpointsByIdEnableMultichain` operationId). + PostV0EndpointsByIdEnableMultichain(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdIpCustomHeader Deletes the IP custom header for a specific endpoint. + // + // Corresponds with DELETE /v0/endpoints/{id}/ip_custom_header (the `DeleteV0EndpointsByIdIpCustomHeader` operationId). + DeleteV0EndpointsByIdIpCustomHeader(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdIpCustomHeaderWithBody Creates or updates an IP custom header for a specific endpoint. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). + PatchV0EndpointsByIdIpCustomHeaderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdIpCustomHeader Creates or updates an IP custom header for a specific endpoint. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). + PatchV0EndpointsByIdIpCustomHeader(ctx context.Context, id string, body PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdLogDetails Retrieves detailed request and response information for a specific log entry. + // + // Corresponds with GET /v0/endpoints/{id}/log_details (the `GetV0EndpointsByIdLogDetails` operationId). + GetV0EndpointsByIdLogDetails(ctx context.Context, id string, params *GetV0EndpointsByIdLogDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdLogs Retrieves logs for a specific endpoint with filtering and pagination options. + // + // Corresponds with GET /v0/endpoints/{id}/logs (the `GetV0EndpointsByIdLogs` operationId). + GetV0EndpointsByIdLogs(ctx context.Context, id string, params *GetV0EndpointsByIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdMethodRateLimits Gets method rate limits. + // + // Corresponds with GET /v0/endpoints/{id}/method-rate-limits (the `GetV0EndpointsByIdMethodRateLimits` operationId). + GetV0EndpointsByIdMethodRateLimits(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdMethodRateLimitsWithBody Creates a method rate limit. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). + PostV0EndpointsByIdMethodRateLimitsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdMethodRateLimits Creates a method rate limit. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). + PostV0EndpointsByIdMethodRateLimits(ctx context.Context, id string, body PostV0EndpointsByIdMethodRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId Deletes a method rate limit. + // + // Corresponds with DELETE /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx context.Context, id string, methodRateLimitId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBody Updates a method rate limit. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBody(ctx context.Context, id string, methodRateLimitId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId Updates a method rate limit. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx context.Context, id string, methodRateLimitId string, body PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdMetrics Returns a single metric. + // + // Corresponds with GET /v0/endpoints/{id}/metrics (the `GetV0EndpointsByIdMetrics` operationId). + GetV0EndpointsByIdMetrics(ctx context.Context, id string, params *GetV0EndpointsByIdMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdRateLimits Gets endpoint rate limits. + // + // Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides. + // + // Corresponds with GET /v0/endpoints/{id}/rate-limits (the `GetV0EndpointsByIdRateLimits` operationId). + GetV0EndpointsByIdRateLimits(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdRateLimitsWithBody Updates endpoint rate limits. + // + // Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). + PatchV0EndpointsByIdRateLimitsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdRateLimits Updates endpoint rate limits. + // + // Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). + PatchV0EndpointsByIdRateLimits(ctx context.Context, id string, body PatchV0EndpointsByIdRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdRateLimitsByOverrideId Deletes a user-set endpoint rate limit by UUID. + // + // Corresponds with DELETE /v0/endpoints/{id}/rate-limits/{override_id} (the `DeleteV0EndpointsByIdRateLimitsByOverrideId` operationId). + DeleteV0EndpointsByIdRateLimitsByOverrideId(ctx context.Context, id string, overrideId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdSecurity Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the + // + // Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint. + // + // Corresponds with GET /v0/endpoints/{id}/security (the `GetV0EndpointsByIdSecurity` operationId). + GetV0EndpointsByIdSecurity(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityDomainMasksWithBody Create an endpoint domain mask. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). + PostV0EndpointsByIdSecurityDomainMasksWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityDomainMasks Create an endpoint domain mask. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). + PostV0EndpointsByIdSecurityDomainMasks(ctx context.Context, id string, body PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId Deletes an existing endpoint domain mask. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/domain_masks/{domain_mask_id} (the `DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId` operationId). + DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId(ctx context.Context, id string, domainMaskId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityIpsWithBody Creates a new endpoint IP. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). + PostV0EndpointsByIdSecurityIpsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityIps Creates a new endpoint IP. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). + PostV0EndpointsByIdSecurityIps(ctx context.Context, id string, body PostV0EndpointsByIdSecurityIpsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityIpsByIpId Deletes an existing endpoint IP. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/ips/{ip_id} (the `DeleteV0EndpointsByIdSecurityIpsByIpId` operationId). + DeleteV0EndpointsByIdSecurityIpsByIpId(ctx context.Context, id string, ipId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityJwtsWithBody Creates a new endpoint JWT. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). + PostV0EndpointsByIdSecurityJwtsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityJwts Creates a new endpoint JWT. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). + PostV0EndpointsByIdSecurityJwts(ctx context.Context, id string, body PostV0EndpointsByIdSecurityJwtsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityJwtsByJwtId Deletes an existing endpoint JWT. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/jwts/{jwt_id} (the `DeleteV0EndpointsByIdSecurityJwtsByJwtId` operationId). + DeleteV0EndpointsByIdSecurityJwtsByJwtId(ctx context.Context, id string, jwtId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityReferrersWithBody Creates a new endpoint referrer. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). + PostV0EndpointsByIdSecurityReferrersWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityReferrers Creates a new endpoint referrer. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). + PostV0EndpointsByIdSecurityReferrers(ctx context.Context, id string, body PostV0EndpointsByIdSecurityReferrersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityReferrersByReferrerId Deletes an existing endpoint referrer. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/referrers/{referrer_id} (the `DeleteV0EndpointsByIdSecurityReferrersByReferrerId` operationId). + DeleteV0EndpointsByIdSecurityReferrersByReferrerId(ctx context.Context, id string, referrerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityRequestFiltersWithBody Creates a new endpoint request filter for method whitelisting. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). + PostV0EndpointsByIdSecurityRequestFiltersWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityRequestFilters Creates a new endpoint request filter for method whitelisting. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). + PostV0EndpointsByIdSecurityRequestFilters(ctx context.Context, id string, body PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId Deletes an existing endpoint request filter. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx context.Context, id string, requestFilterId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBody Updates an existing endpoint request filter. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBody(ctx context.Context, id string, requestFilterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId Updates an existing endpoint request filter. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx context.Context, id string, requestFilterId string, body PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdSecurityTokens Creates a new endpoint authentication token. + // + // Corresponds with POST /v0/endpoints/{id}/security/tokens (the `PostV0EndpointsByIdSecurityTokens` operationId). + PostV0EndpointsByIdSecurityTokens(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdSecurityTokensByTokenId Deletes an existing endpoint token. + // + // Corresponds with DELETE /v0/endpoints/{id}/security/tokens/{token_id} (the `DeleteV0EndpointsByIdSecurityTokensByTokenId` operationId). + DeleteV0EndpointsByIdSecurityTokensByTokenId(ctx context.Context, id string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdSecurityOptions Gets security options for an endpoint. + // + // Corresponds with GET /v0/endpoints/{id}/security_options (the `GetV0EndpointsByIdSecurityOptions` operationId). + GetV0EndpointsByIdSecurityOptions(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdSecurityOptionsWithBody Updates security options for an endpoint. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). + PatchV0EndpointsByIdSecurityOptionsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdSecurityOptions Updates security options for an endpoint. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). + PatchV0EndpointsByIdSecurityOptions(ctx context.Context, id string, body PatchV0EndpointsByIdSecurityOptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdStatusWithBody Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). + PatchV0EndpointsByIdStatusWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0EndpointsByIdStatus Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). + PatchV0EndpointsByIdStatus(ctx context.Context, id string, body PatchV0EndpointsByIdStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdTags Returns all tags for a specific endpoint. + // + // Corresponds with GET /v0/endpoints/{id}/tags (the `GetV0EndpointsByIdTags` operationId). + GetV0EndpointsByIdTags(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdTagsWithBody Creates a new tag for a specific endpoint. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). + PostV0EndpointsByIdTagsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0EndpointsByIdTags Creates a new tag for a specific endpoint. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). + PostV0EndpointsByIdTags(ctx context.Context, id string, body PostV0EndpointsByIdTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0EndpointsByIdTagsByTagId Deletes a tag from a specific endpoint. + // + // Corresponds with DELETE /v0/endpoints/{id}/tags/{tag_id} (the `DeleteV0EndpointsByIdTagsByTagId` operationId). + DeleteV0EndpointsByIdTagsByTagId(ctx context.Context, id string, tagId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0EndpointsByIdUrls Returns the URLs for a specific endpoint. + // + // Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network. + // + // Corresponds with GET /v0/endpoints/{id}/urls (the `GetV0EndpointsByIdUrls` operationId). + GetV0EndpointsByIdUrls(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0Metrics Fetches metrics aggregated across all endpoints for an account. + // + // Corresponds with GET /v0/metrics (the `GetV0Metrics` operationId). + GetV0Metrics(ctx context.Context, params *GetV0MetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0Teams Retrieves a list of all teams. + // + // Corresponds with GET /v0/teams (the `GetV0Teams` operationId). + GetV0Teams(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0TeamsWithBody Creates a new team. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/teams (the `PostV0Teams` operationId). + PostV0TeamsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0Teams Creates a new team. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/teams (the `PostV0Teams` operationId). + PostV0Teams(ctx context.Context, body PostV0TeamsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0TeamsById Deletes an empty team. + // + // Deletes an empty team. The team must have no members before it can be deleted. + // + // Corresponds with DELETE /v0/teams/{id} (the `DeleteV0TeamsById` operationId). + DeleteV0TeamsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0TeamsById Retrieves details for a specific team. + // + // Corresponds with GET /v0/teams/{id} (the `GetV0TeamsById` operationId). + GetV0TeamsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0TeamsByIdEndpoints Retrieves a list of endpoints accessible to a team. + // + // Corresponds with GET /v0/teams/{id}/endpoints (the `GetV0TeamsByIdEndpoints` operationId). + GetV0TeamsByIdEndpoints(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0TeamsByIdEndpointsWithBody Assigns or unassigns endpoints to a team. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). + PatchV0TeamsByIdEndpointsWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0TeamsByIdEndpoints Assigns or unassigns endpoints to a team. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). + PatchV0TeamsByIdEndpoints(ctx context.Context, id int, body PatchV0TeamsByIdEndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0TeamsByIdMembersWithBody Invites a user to a team. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). + PostV0TeamsByIdMembersWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0TeamsByIdMembers Invites a user to a team. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). + PostV0TeamsByIdMembers(ctx context.Context, id int, body PostV0TeamsByIdMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteV0TeamsByIdMembersByUserId Removes a user from a team. + // + // Corresponds with DELETE /v0/teams/{id}/members/{user_id} (the `DeleteV0TeamsByIdMembersByUserId` operationId). + DeleteV0TeamsByIdMembersByUserId(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0TeamsByIdMembersByUserIdResendInvite Resends an invitation email to a pending team member. + // + // Corresponds with POST /v0/teams/{id}/members/{user_id}/resend_invite (the `PostV0TeamsByIdMembersByUserIdResendInvite` operationId). + PostV0TeamsByIdMembersByUserIdResendInvite(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0ToolingAccess Returns whether Tooling Access is enabled for the account. + // + // Corresponds with GET /v0/tooling-access (the `GetV0ToolingAccess` operationId). + GetV0ToolingAccess(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0ToolingAccessWithBody Enable (provision/reactivate) or disable Tooling Access for the account. + // + // Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). + PatchV0ToolingAccessWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchV0ToolingAccess Enable (provision/reactivate) or disable Tooling Access for the account. + // + // Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). + PatchV0ToolingAccess(ctx context.Context, body PatchV0ToolingAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV0ToolingAccessToken Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. + // + // Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first. + // + // Corresponds with POST /v0/tooling-access/token (the `PostV0ToolingAccessToken` operationId). + PostV0ToolingAccessToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0UsageRpc Retrieves usage total for specified time range. + // + // Corresponds with GET /v0/usage/rpc (the `GetV0UsageRpc` operationId). + GetV0UsageRpc(ctx context.Context, params *GetV0UsageRpcParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0UsageRpcByChain Retrieves usage data by chain. + // + // Corresponds with GET /v0/usage/rpc/by-chain (the `GetV0UsageRpcByChain` operationId). + GetV0UsageRpcByChain(ctx context.Context, params *GetV0UsageRpcByChainParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0UsageRpcByEndpoint Retrieves usage data by endpoint. + // + // Corresponds with GET /v0/usage/rpc/by-endpoint (the `GetV0UsageRpcByEndpoint` operationId). + GetV0UsageRpcByEndpoint(ctx context.Context, params *GetV0UsageRpcByEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0UsageRpcByMethod Retrieves usage data by method. + // + // Corresponds with GET /v0/usage/rpc/by-method (the `GetV0UsageRpcByMethod` operationId). + GetV0UsageRpcByMethod(ctx context.Context, params *GetV0UsageRpcByMethodParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV0UsageRpcByTag Retrieves usage data grouped by tag. + // + // Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags. + // + // Corresponds with GET /v0/usage/rpc/by-tag (the `GetV0UsageRpcByTag` operationId). + GetV0UsageRpcByTag(ctx context.Context, params *GetV0UsageRpcByTagParams, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +// GetV0AccountInfo Returns information about the account associated with the API key. +// +// Corresponds with GET /v0/account/info (the `GetV0AccountInfo` operationId). +func (c *Client) GetV0AccountInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0AccountInfoRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0ApiCreditsByChain Returns the API credit cost of each RPC method available on a chain. +// +// Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version. +// +// Corresponds with GET /v0/api-credits/{chain} (the `GetV0ApiCreditsByChain` operationId). +func (c *Client) GetV0ApiCreditsByChain(ctx context.Context, chain string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0ApiCreditsByChainRequest(c.Server, chain) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0BillingInvoices Returns a list of invoices +// +// Corresponds with GET /v0/billing/invoices (the `GetV0BillingInvoices` operationId). +func (c *Client) GetV0BillingInvoices(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0BillingInvoicesRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0BillingPayments Returns a list of payments. +// +// Corresponds with GET /v0/billing/payments (the `GetV0BillingPayments` operationId). +func (c *Client) GetV0BillingPayments(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0BillingPaymentsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0Chains Returns a list of chains. +// +// Corresponds with GET /v0/chains (the `GetV0Chains` operationId). +func (c *Client) GetV0Chains(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0ChainsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0Endpoints Retrieves a list of endpoints. +// +// Retrieves a list of endpoints. Supports searching, filtering, and sorting. +// +// Corresponds with GET /v0/endpoints (the `GetV0Endpoints` operationId). +func (c *Client) GetV0Endpoints(ctx context.Context, params *GetV0EndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsWithBody Creates a new endpoint. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). +func (c *Client) PostV0EndpointsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0Endpoints Creates a new endpoint. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). +func (c *Client) PostV0Endpoints(ctx context.Context, body PostV0EndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsBulkStatusWithBody Pause or unpause multiple endpoints in a single call. +// +// Pause or unpause multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). +func (c *Client) PostV0EndpointsBulkStatusWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsBulkStatusRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsBulkStatus Pause or unpause multiple endpoints in a single call. +// +// Pause or unpause multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). +func (c *Client) PostV0EndpointsBulkStatus(ctx context.Context, body PostV0EndpointsBulkStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsBulkStatusRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsBulkTagsWithBody Remove a tag from multiple endpoints in a single call. +// +// Remove a tag from multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type. +// +// Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). +func (c *Client) DeleteV0EndpointsBulkTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsBulkTagsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsBulkTags Remove a tag from multiple endpoints in a single call. +// +// Remove a tag from multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). +func (c *Client) DeleteV0EndpointsBulkTags(ctx context.Context, body DeleteV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsBulkTagsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsBulkTagsWithBody Add a tag to multiple endpoints in a single call. +// +// Add a tag to multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). +func (c *Client) PostV0EndpointsBulkTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsBulkTagsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsBulkTags Add a tag to multiple endpoints in a single call. +// +// Add a tag to multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). +func (c *Client) PostV0EndpointsBulkTags(ctx context.Context, body PostV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsBulkTagsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsTags Returns all account-level tags including those with zero endpoints. +// +// Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+. +// +// Corresponds with GET /v0/endpoints/tags (the `GetV0EndpointsTags` operationId). +func (c *Client) GetV0EndpointsTags(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsTagsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsTagsById Deletes an account tag. +// +// Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only. +// +// Corresponds with DELETE /v0/endpoints/tags/{id} (the `DeleteV0EndpointsTagsById` operationId). +func (c *Client) DeleteV0EndpointsTagsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsTagsByIdRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsTagsByIdWithBody Renames an account tag. +// +// Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). +func (c *Client) PatchV0EndpointsTagsByIdWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsTagsByIdRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsTagsById Renames an account tag. +// +// Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). +func (c *Client) PatchV0EndpointsTagsById(ctx context.Context, id int, body PatchV0EndpointsTagsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsTagsByIdRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsById Deletes an endpoint. +// +// Corresponds with DELETE /v0/endpoints/{id} (the `DeleteV0EndpointsById` operationId). +func (c *Client) DeleteV0EndpointsById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsById Returns info for a specific endpoint. +// +// Corresponds with GET /v0/endpoints/{id} (the `GetV0EndpointsById` operationId). +func (c *Client) GetV0EndpointsById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdWithBody Updates an endpoint. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). +func (c *Client) PatchV0EndpointsByIdWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsById Updates an endpoint. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). +func (c *Client) PatchV0EndpointsById(ctx context.Context, id string, body PatchV0EndpointsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdDisableMultichain Disables multichain for a specific endpoint. +// +// Corresponds with POST /v0/endpoints/{id}/disable_multichain (the `PostV0EndpointsByIdDisableMultichain` operationId). +func (c *Client) PostV0EndpointsByIdDisableMultichain(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdDisableMultichainRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdEnableMultichain Enables multichain for a specific endpoint. +// +// Corresponds with POST /v0/endpoints/{id}/enable_multichain (the `PostV0EndpointsByIdEnableMultichain` operationId). +func (c *Client) PostV0EndpointsByIdEnableMultichain(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdEnableMultichainRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdIpCustomHeader Deletes the IP custom header for a specific endpoint. +// +// Corresponds with DELETE /v0/endpoints/{id}/ip_custom_header (the `DeleteV0EndpointsByIdIpCustomHeader` operationId). +func (c *Client) DeleteV0EndpointsByIdIpCustomHeader(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdIpCustomHeaderRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdIpCustomHeaderWithBody Creates or updates an IP custom header for a specific endpoint. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). +func (c *Client) PatchV0EndpointsByIdIpCustomHeaderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdIpCustomHeaderRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdIpCustomHeader Creates or updates an IP custom header for a specific endpoint. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). +func (c *Client) PatchV0EndpointsByIdIpCustomHeader(ctx context.Context, id string, body PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdIpCustomHeaderRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdLogDetails Retrieves detailed request and response information for a specific log entry. +// +// Corresponds with GET /v0/endpoints/{id}/log_details (the `GetV0EndpointsByIdLogDetails` operationId). +func (c *Client) GetV0EndpointsByIdLogDetails(ctx context.Context, id string, params *GetV0EndpointsByIdLogDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdLogDetailsRequest(c.Server, id, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdLogs Retrieves logs for a specific endpoint with filtering and pagination options. +// +// Corresponds with GET /v0/endpoints/{id}/logs (the `GetV0EndpointsByIdLogs` operationId). +func (c *Client) GetV0EndpointsByIdLogs(ctx context.Context, id string, params *GetV0EndpointsByIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdLogsRequest(c.Server, id, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdMethodRateLimits Gets method rate limits. +// +// Corresponds with GET /v0/endpoints/{id}/method-rate-limits (the `GetV0EndpointsByIdMethodRateLimits` operationId). +func (c *Client) GetV0EndpointsByIdMethodRateLimits(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdMethodRateLimitsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdMethodRateLimitsWithBody Creates a method rate limit. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). +func (c *Client) PostV0EndpointsByIdMethodRateLimitsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdMethodRateLimitsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdMethodRateLimits Creates a method rate limit. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). +func (c *Client) PostV0EndpointsByIdMethodRateLimits(ctx context.Context, id string, body PostV0EndpointsByIdMethodRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdMethodRateLimitsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId Deletes a method rate limit. +// +// Corresponds with DELETE /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *Client) DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx context.Context, id string, methodRateLimitId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest(c.Server, id, methodRateLimitId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBody Updates a method rate limit. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *Client) PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBody(ctx context.Context, id string, methodRateLimitId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequestWithBody(c.Server, id, methodRateLimitId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId Updates a method rate limit. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *Client) PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx context.Context, id string, methodRateLimitId string, body PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest(c.Server, id, methodRateLimitId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdMetrics Returns a single metric. +// +// Corresponds with GET /v0/endpoints/{id}/metrics (the `GetV0EndpointsByIdMetrics` operationId). +func (c *Client) GetV0EndpointsByIdMetrics(ctx context.Context, id string, params *GetV0EndpointsByIdMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdMetricsRequest(c.Server, id, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdRateLimits Gets endpoint rate limits. +// +// Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides. +// +// Corresponds with GET /v0/endpoints/{id}/rate-limits (the `GetV0EndpointsByIdRateLimits` operationId). +func (c *Client) GetV0EndpointsByIdRateLimits(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdRateLimitsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdRateLimitsWithBody Updates endpoint rate limits. +// +// Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). +func (c *Client) PatchV0EndpointsByIdRateLimitsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdRateLimitsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdRateLimits Updates endpoint rate limits. +// +// Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). +func (c *Client) PatchV0EndpointsByIdRateLimits(ctx context.Context, id string, body PatchV0EndpointsByIdRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdRateLimitsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdRateLimitsByOverrideId Deletes a user-set endpoint rate limit by UUID. +// +// Corresponds with DELETE /v0/endpoints/{id}/rate-limits/{override_id} (the `DeleteV0EndpointsByIdRateLimitsByOverrideId` operationId). +func (c *Client) DeleteV0EndpointsByIdRateLimitsByOverrideId(ctx context.Context, id string, overrideId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdRateLimitsByOverrideIdRequest(c.Server, id, overrideId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdSecurity Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the +// +// Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint. +// +// Corresponds with GET /v0/endpoints/{id}/security (the `GetV0EndpointsByIdSecurity` operationId). +func (c *Client) GetV0EndpointsByIdSecurity(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdSecurityRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityDomainMasksWithBody Create an endpoint domain mask. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). +func (c *Client) PostV0EndpointsByIdSecurityDomainMasksWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityDomainMasksRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityDomainMasks Create an endpoint domain mask. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). +func (c *Client) PostV0EndpointsByIdSecurityDomainMasks(ctx context.Context, id string, body PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityDomainMasksRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId Deletes an existing endpoint domain mask. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/domain_masks/{domain_mask_id} (the `DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId(ctx context.Context, id string, domainMaskId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdRequest(c.Server, id, domainMaskId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityIpsWithBody Creates a new endpoint IP. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). +func (c *Client) PostV0EndpointsByIdSecurityIpsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityIpsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityIps Creates a new endpoint IP. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). +func (c *Client) PostV0EndpointsByIdSecurityIps(ctx context.Context, id string, body PostV0EndpointsByIdSecurityIpsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityIpsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityIpsByIpId Deletes an existing endpoint IP. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/ips/{ip_id} (the `DeleteV0EndpointsByIdSecurityIpsByIpId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityIpsByIpId(ctx context.Context, id string, ipId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityIpsByIpIdRequest(c.Server, id, ipId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityJwtsWithBody Creates a new endpoint JWT. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). +func (c *Client) PostV0EndpointsByIdSecurityJwtsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityJwtsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityJwts Creates a new endpoint JWT. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). +func (c *Client) PostV0EndpointsByIdSecurityJwts(ctx context.Context, id string, body PostV0EndpointsByIdSecurityJwtsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityJwtsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityJwtsByJwtId Deletes an existing endpoint JWT. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/jwts/{jwt_id} (the `DeleteV0EndpointsByIdSecurityJwtsByJwtId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityJwtsByJwtId(ctx context.Context, id string, jwtId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityJwtsByJwtIdRequest(c.Server, id, jwtId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityReferrersWithBody Creates a new endpoint referrer. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). +func (c *Client) PostV0EndpointsByIdSecurityReferrersWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityReferrersRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityReferrers Creates a new endpoint referrer. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). +func (c *Client) PostV0EndpointsByIdSecurityReferrers(ctx context.Context, id string, body PostV0EndpointsByIdSecurityReferrersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityReferrersRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityReferrersByReferrerId Deletes an existing endpoint referrer. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/referrers/{referrer_id} (the `DeleteV0EndpointsByIdSecurityReferrersByReferrerId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityReferrersByReferrerId(ctx context.Context, id string, referrerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityReferrersByReferrerIdRequest(c.Server, id, referrerId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityRequestFiltersWithBody Creates a new endpoint request filter for method whitelisting. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). +func (c *Client) PostV0EndpointsByIdSecurityRequestFiltersWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityRequestFiltersRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityRequestFilters Creates a new endpoint request filter for method whitelisting. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). +func (c *Client) PostV0EndpointsByIdSecurityRequestFilters(ctx context.Context, id string, body PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityRequestFiltersRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId Deletes an existing endpoint request filter. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx context.Context, id string, requestFilterId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest(c.Server, id, requestFilterId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBody Updates an existing endpoint request filter. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *Client) PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBody(ctx context.Context, id string, requestFilterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequestWithBody(c.Server, id, requestFilterId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId Updates an existing endpoint request filter. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *Client) PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx context.Context, id string, requestFilterId string, body PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest(c.Server, id, requestFilterId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdSecurityTokens Creates a new endpoint authentication token. +// +// Corresponds with POST /v0/endpoints/{id}/security/tokens (the `PostV0EndpointsByIdSecurityTokens` operationId). +func (c *Client) PostV0EndpointsByIdSecurityTokens(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdSecurityTokensRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdSecurityTokensByTokenId Deletes an existing endpoint token. +// +// Corresponds with DELETE /v0/endpoints/{id}/security/tokens/{token_id} (the `DeleteV0EndpointsByIdSecurityTokensByTokenId` operationId). +func (c *Client) DeleteV0EndpointsByIdSecurityTokensByTokenId(ctx context.Context, id string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdSecurityTokensByTokenIdRequest(c.Server, id, tokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdSecurityOptions Gets security options for an endpoint. +// +// Corresponds with GET /v0/endpoints/{id}/security_options (the `GetV0EndpointsByIdSecurityOptions` operationId). +func (c *Client) GetV0EndpointsByIdSecurityOptions(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdSecurityOptionsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdSecurityOptionsWithBody Updates security options for an endpoint. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). +func (c *Client) PatchV0EndpointsByIdSecurityOptionsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdSecurityOptionsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdSecurityOptions Updates security options for an endpoint. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). +func (c *Client) PatchV0EndpointsByIdSecurityOptions(ctx context.Context, id string, body PatchV0EndpointsByIdSecurityOptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdSecurityOptionsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdStatusWithBody Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). +func (c *Client) PatchV0EndpointsByIdStatusWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdStatusRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0EndpointsByIdStatus Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). +func (c *Client) PatchV0EndpointsByIdStatus(ctx context.Context, id string, body PatchV0EndpointsByIdStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0EndpointsByIdStatusRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdTags Returns all tags for a specific endpoint. +// +// Corresponds with GET /v0/endpoints/{id}/tags (the `GetV0EndpointsByIdTags` operationId). +func (c *Client) GetV0EndpointsByIdTags(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdTagsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdTagsWithBody Creates a new tag for a specific endpoint. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). +func (c *Client) PostV0EndpointsByIdTagsWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdTagsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0EndpointsByIdTags Creates a new tag for a specific endpoint. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). +func (c *Client) PostV0EndpointsByIdTags(ctx context.Context, id string, body PostV0EndpointsByIdTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0EndpointsByIdTagsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0EndpointsByIdTagsByTagId Deletes a tag from a specific endpoint. +// +// Corresponds with DELETE /v0/endpoints/{id}/tags/{tag_id} (the `DeleteV0EndpointsByIdTagsByTagId` operationId). +func (c *Client) DeleteV0EndpointsByIdTagsByTagId(ctx context.Context, id string, tagId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0EndpointsByIdTagsByTagIdRequest(c.Server, id, tagId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0EndpointsByIdUrls Returns the URLs for a specific endpoint. +// +// Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network. +// +// Corresponds with GET /v0/endpoints/{id}/urls (the `GetV0EndpointsByIdUrls` operationId). +func (c *Client) GetV0EndpointsByIdUrls(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0EndpointsByIdUrlsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0Metrics Fetches metrics aggregated across all endpoints for an account. +// +// Corresponds with GET /v0/metrics (the `GetV0Metrics` operationId). +func (c *Client) GetV0Metrics(ctx context.Context, params *GetV0MetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0MetricsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0Teams Retrieves a list of all teams. +// +// Corresponds with GET /v0/teams (the `GetV0Teams` operationId). +func (c *Client) GetV0Teams(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0TeamsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0TeamsWithBody Creates a new team. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/teams (the `PostV0Teams` operationId). +func (c *Client) PostV0TeamsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0TeamsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0Teams Creates a new team. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/teams (the `PostV0Teams` operationId). +func (c *Client) PostV0Teams(ctx context.Context, body PostV0TeamsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0TeamsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0TeamsById Deletes an empty team. +// +// Deletes an empty team. The team must have no members before it can be deleted. +// +// Corresponds with DELETE /v0/teams/{id} (the `DeleteV0TeamsById` operationId). +func (c *Client) DeleteV0TeamsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0TeamsByIdRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0TeamsById Retrieves details for a specific team. +// +// Corresponds with GET /v0/teams/{id} (the `GetV0TeamsById` operationId). +func (c *Client) GetV0TeamsById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0TeamsByIdRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0TeamsByIdEndpoints Retrieves a list of endpoints accessible to a team. +// +// Corresponds with GET /v0/teams/{id}/endpoints (the `GetV0TeamsByIdEndpoints` operationId). +func (c *Client) GetV0TeamsByIdEndpoints(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0TeamsByIdEndpointsRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0TeamsByIdEndpointsWithBody Assigns or unassigns endpoints to a team. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). +func (c *Client) PatchV0TeamsByIdEndpointsWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0TeamsByIdEndpointsRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0TeamsByIdEndpoints Assigns or unassigns endpoints to a team. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). +func (c *Client) PatchV0TeamsByIdEndpoints(ctx context.Context, id int, body PatchV0TeamsByIdEndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0TeamsByIdEndpointsRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0TeamsByIdMembersWithBody Invites a user to a team. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). +func (c *Client) PostV0TeamsByIdMembersWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0TeamsByIdMembersRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0TeamsByIdMembers Invites a user to a team. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). +func (c *Client) PostV0TeamsByIdMembers(ctx context.Context, id int, body PostV0TeamsByIdMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0TeamsByIdMembersRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// DeleteV0TeamsByIdMembersByUserId Removes a user from a team. +// +// Corresponds with DELETE /v0/teams/{id}/members/{user_id} (the `DeleteV0TeamsByIdMembersByUserId` operationId). +func (c *Client) DeleteV0TeamsByIdMembersByUserId(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteV0TeamsByIdMembersByUserIdRequest(c.Server, id, userId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0TeamsByIdMembersByUserIdResendInvite Resends an invitation email to a pending team member. +// +// Corresponds with POST /v0/teams/{id}/members/{user_id}/resend_invite (the `PostV0TeamsByIdMembersByUserIdResendInvite` operationId). +func (c *Client) PostV0TeamsByIdMembersByUserIdResendInvite(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0TeamsByIdMembersByUserIdResendInviteRequest(c.Server, id, userId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0ToolingAccess Returns whether Tooling Access is enabled for the account. +// +// Corresponds with GET /v0/tooling-access (the `GetV0ToolingAccess` operationId). +func (c *Client) GetV0ToolingAccess(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0ToolingAccessRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0ToolingAccessWithBody Enable (provision/reactivate) or disable Tooling Access for the account. +// +// Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). +func (c *Client) PatchV0ToolingAccessWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0ToolingAccessRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PatchV0ToolingAccess Enable (provision/reactivate) or disable Tooling Access for the account. +// +// Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). +func (c *Client) PatchV0ToolingAccess(ctx context.Context, body PatchV0ToolingAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchV0ToolingAccessRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PostV0ToolingAccessToken Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. +// +// Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first. +// +// Corresponds with POST /v0/tooling-access/token (the `PostV0ToolingAccessToken` operationId). +func (c *Client) PostV0ToolingAccessToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV0ToolingAccessTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0UsageRpc Retrieves usage total for specified time range. +// +// Corresponds with GET /v0/usage/rpc (the `GetV0UsageRpc` operationId). +func (c *Client) GetV0UsageRpc(ctx context.Context, params *GetV0UsageRpcParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0UsageRpcRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0UsageRpcByChain Retrieves usage data by chain. +// +// Corresponds with GET /v0/usage/rpc/by-chain (the `GetV0UsageRpcByChain` operationId). +func (c *Client) GetV0UsageRpcByChain(ctx context.Context, params *GetV0UsageRpcByChainParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0UsageRpcByChainRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0UsageRpcByEndpoint Retrieves usage data by endpoint. +// +// Corresponds with GET /v0/usage/rpc/by-endpoint (the `GetV0UsageRpcByEndpoint` operationId). +func (c *Client) GetV0UsageRpcByEndpoint(ctx context.Context, params *GetV0UsageRpcByEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0UsageRpcByEndpointRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0UsageRpcByMethod Retrieves usage data by method. +// +// Corresponds with GET /v0/usage/rpc/by-method (the `GetV0UsageRpcByMethod` operationId). +func (c *Client) GetV0UsageRpcByMethod(ctx context.Context, params *GetV0UsageRpcByMethodParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0UsageRpcByMethodRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetV0UsageRpcByTag Retrieves usage data grouped by tag. +// +// Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags. +// +// Corresponds with GET /v0/usage/rpc/by-tag (the `GetV0UsageRpcByTag` operationId). +func (c *Client) GetV0UsageRpcByTag(ctx context.Context, params *GetV0UsageRpcByTagParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV0UsageRpcByTagRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewGetV0AccountInfoRequest constructs an http.Request for the GetV0AccountInfo method +func NewGetV0AccountInfoRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/account/info") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0ApiCreditsByChainRequest constructs an http.Request for the GetV0ApiCreditsByChain method +func NewGetV0ApiCreditsByChainRequest(server string, chain string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "chain", chain, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/api-credits/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0BillingInvoicesRequest constructs an http.Request for the GetV0BillingInvoices method +func NewGetV0BillingInvoicesRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/billing/invoices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0BillingPaymentsRequest constructs an http.Request for the GetV0BillingPayments method +func NewGetV0BillingPaymentsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/billing/payments") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0ChainsRequest constructs an http.Request for the GetV0Chains method +func NewGetV0ChainsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/chains") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsRequest constructs an http.Request for the GetV0Endpoints method +func NewGetV0EndpointsRequest(server string, params *GetV0EndpointsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "offset", *params.Offset, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Search != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "search", *params.Search, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.SortBy != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort_by", *params.SortBy, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.SortDirection != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort_direction", *params.SortDirection, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Networks != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "networks", *params.Networks, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Statuses != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "statuses", *params.Statuses, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Labels != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "labels", *params.Labels, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Dedicated != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "dedicated", *params.Dedicated, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.IsFlatRate != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "is_flat_rate", *params.IsFlatRate, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.TagIds != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag_ids", *params.TagIds, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.TagLabels != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag_labels", *params.TagLabels, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsRequest calls the generic PostV0Endpoints builder with application/json body +func NewPostV0EndpointsRequest(server string, body PostV0EndpointsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostV0EndpointsRequestWithBody constructs an http.Request for the PostV0Endpoints method, with any body, and a specified content type +func NewPostV0EndpointsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0EndpointsBulkStatusRequest calls the generic PostV0EndpointsBulkStatus builder with application/json body +func NewPostV0EndpointsBulkStatusRequest(server string, body PostV0EndpointsBulkStatusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsBulkStatusRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostV0EndpointsBulkStatusRequestWithBody constructs an http.Request for the PostV0EndpointsBulkStatus method, with any body, and a specified content type +func NewPostV0EndpointsBulkStatusRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/bulk/status") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsBulkTagsRequest calls the generic DeleteV0EndpointsBulkTags builder with application/json body +func NewDeleteV0EndpointsBulkTagsRequest(server string, body DeleteV0EndpointsBulkTagsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDeleteV0EndpointsBulkTagsRequestWithBody(server, "application/json", bodyReader) +} + +// NewDeleteV0EndpointsBulkTagsRequestWithBody constructs an http.Request for the DeleteV0EndpointsBulkTags method, with any body, and a specified content type +func NewDeleteV0EndpointsBulkTagsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/bulk/tags") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0EndpointsBulkTagsRequest calls the generic PostV0EndpointsBulkTags builder with application/json body +func NewPostV0EndpointsBulkTagsRequest(server string, body PostV0EndpointsBulkTagsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsBulkTagsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostV0EndpointsBulkTagsRequestWithBody constructs an http.Request for the PostV0EndpointsBulkTags method, with any body, and a specified content type +func NewPostV0EndpointsBulkTagsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/bulk/tags") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetV0EndpointsTagsRequest constructs an http.Request for the GetV0EndpointsTags method +func NewGetV0EndpointsTagsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/tags") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteV0EndpointsTagsByIdRequest constructs an http.Request for the DeleteV0EndpointsTagsById method +func NewDeleteV0EndpointsTagsByIdRequest(server string, id int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/tags/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsTagsByIdRequest calls the generic PatchV0EndpointsTagsById builder with application/json body +func NewPatchV0EndpointsTagsByIdRequest(server string, id int, body PatchV0EndpointsTagsByIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsTagsByIdRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsTagsByIdRequestWithBody constructs an http.Request for the PatchV0EndpointsTagsById method, with any body, and a specified content type +func NewPatchV0EndpointsTagsByIdRequestWithBody(server string, id int, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/tags/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdRequest constructs an http.Request for the DeleteV0EndpointsById method +func NewDeleteV0EndpointsByIdRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdRequest constructs an http.Request for the GetV0EndpointsById method +func NewGetV0EndpointsByIdRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsByIdRequest calls the generic PatchV0EndpointsById builder with application/json body +func NewPatchV0EndpointsByIdRequest(server string, id string, body PatchV0EndpointsByIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdRequestWithBody constructs an http.Request for the PatchV0EndpointsById method, with any body, and a specified content type +func NewPatchV0EndpointsByIdRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0EndpointsByIdDisableMultichainRequest constructs an http.Request for the PostV0EndpointsByIdDisableMultichain method +func NewPostV0EndpointsByIdDisableMultichainRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/disable_multichain", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdEnableMultichainRequest constructs an http.Request for the PostV0EndpointsByIdEnableMultichain method +func NewPostV0EndpointsByIdEnableMultichainRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/enable_multichain", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteV0EndpointsByIdIpCustomHeaderRequest constructs an http.Request for the DeleteV0EndpointsByIdIpCustomHeader method +func NewDeleteV0EndpointsByIdIpCustomHeaderRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/ip_custom_header", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsByIdIpCustomHeaderRequest calls the generic PatchV0EndpointsByIdIpCustomHeader builder with application/json body +func NewPatchV0EndpointsByIdIpCustomHeaderRequest(server string, id string, body PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdIpCustomHeaderRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdIpCustomHeaderRequestWithBody constructs an http.Request for the PatchV0EndpointsByIdIpCustomHeader method, with any body, and a specified content type +func NewPatchV0EndpointsByIdIpCustomHeaderRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/ip_custom_header", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetV0EndpointsByIdLogDetailsRequest constructs an http.Request for the GetV0EndpointsByIdLogDetails method +func NewGetV0EndpointsByIdLogDetailsRequest(server string, id string, params *GetV0EndpointsByIdLogDetailsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/log_details", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "request_id", params.RequestId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdLogsRequest constructs an http.Request for the GetV0EndpointsByIdLogs method +func NewGetV0EndpointsByIdLogsRequest(server string, id string, params *GetV0EndpointsByIdLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/logs", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "from", params.From, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "to", params.To, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.IncludeDetails != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include_details", *params.IncludeDetails, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.NextAt != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next_at", *params.NextAt, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdMethodRateLimitsRequest constructs an http.Request for the GetV0EndpointsByIdMethodRateLimits method +func NewGetV0EndpointsByIdMethodRateLimitsRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/method-rate-limits", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdMethodRateLimitsRequest calls the generic PostV0EndpointsByIdMethodRateLimits builder with application/json body +func NewPostV0EndpointsByIdMethodRateLimitsRequest(server string, id string, body PostV0EndpointsByIdMethodRateLimitsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdMethodRateLimitsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdMethodRateLimitsRequestWithBody constructs an http.Request for the PostV0EndpointsByIdMethodRateLimits method, with any body, and a specified content type +func NewPostV0EndpointsByIdMethodRateLimitsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/method-rate-limits", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest constructs an http.Request for the DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId method +func NewDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest(server string, id string, methodRateLimitId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "method_rate_limit_id", methodRateLimitId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/method-rate-limits/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest calls the generic PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId builder with application/json body +func NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequest(server string, id string, methodRateLimitId string, body PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequestWithBody(server, id, methodRateLimitId, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequestWithBody constructs an http.Request for the PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId method, with any body, and a specified content type +func NewPatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdRequestWithBody(server string, id string, methodRateLimitId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "method_rate_limit_id", methodRateLimitId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/method-rate-limits/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetV0EndpointsByIdMetricsRequest constructs an http.Request for the GetV0EndpointsByIdMetrics method +func NewGetV0EndpointsByIdMetricsRequest(server string, id string, params *GetV0EndpointsByIdMetricsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/metrics", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "period", params.Period, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "metric", params.Metric, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if params.Percentile != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "percentile", *params.Percentile, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdRateLimitsRequest constructs an http.Request for the GetV0EndpointsByIdRateLimits method +func NewGetV0EndpointsByIdRateLimitsRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/rate-limits", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsByIdRateLimitsRequest calls the generic PatchV0EndpointsByIdRateLimits builder with application/json body +func NewPatchV0EndpointsByIdRateLimitsRequest(server string, id string, body PatchV0EndpointsByIdRateLimitsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdRateLimitsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdRateLimitsRequestWithBody constructs an http.Request for the PatchV0EndpointsByIdRateLimits method, with any body, and a specified content type +func NewPatchV0EndpointsByIdRateLimitsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/rate-limits", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdRateLimitsByOverrideIdRequest constructs an http.Request for the DeleteV0EndpointsByIdRateLimitsByOverrideId method +func NewDeleteV0EndpointsByIdRateLimitsByOverrideIdRequest(server string, id string, overrideId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "override_id", overrideId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/rate-limits/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdSecurityRequest constructs an http.Request for the GetV0EndpointsByIdSecurity method +func NewGetV0EndpointsByIdSecurityRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityDomainMasksRequest calls the generic PostV0EndpointsByIdSecurityDomainMasks builder with application/json body +func NewPostV0EndpointsByIdSecurityDomainMasksRequest(server string, id string, body PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdSecurityDomainMasksRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdSecurityDomainMasksRequestWithBody constructs an http.Request for the PostV0EndpointsByIdSecurityDomainMasks method, with any body, and a specified content type +func NewPostV0EndpointsByIdSecurityDomainMasksRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/domain_masks", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId method +func NewDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdRequest(server string, id string, domainMaskId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "domain_mask_id", domainMaskId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/domain_masks/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityIpsRequest calls the generic PostV0EndpointsByIdSecurityIps builder with application/json body +func NewPostV0EndpointsByIdSecurityIpsRequest(server string, id string, body PostV0EndpointsByIdSecurityIpsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdSecurityIpsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdSecurityIpsRequestWithBody constructs an http.Request for the PostV0EndpointsByIdSecurityIps method, with any body, and a specified content type +func NewPostV0EndpointsByIdSecurityIpsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/ips", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityIpsByIpIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityIpsByIpId method +func NewDeleteV0EndpointsByIdSecurityIpsByIpIdRequest(server string, id string, ipId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "ip_id", ipId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/ips/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityJwtsRequest calls the generic PostV0EndpointsByIdSecurityJwts builder with application/json body +func NewPostV0EndpointsByIdSecurityJwtsRequest(server string, id string, body PostV0EndpointsByIdSecurityJwtsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdSecurityJwtsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdSecurityJwtsRequestWithBody constructs an http.Request for the PostV0EndpointsByIdSecurityJwts method, with any body, and a specified content type +func NewPostV0EndpointsByIdSecurityJwtsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/jwts", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityJwtsByJwtIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityJwtsByJwtId method +func NewDeleteV0EndpointsByIdSecurityJwtsByJwtIdRequest(server string, id string, jwtId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "jwt_id", jwtId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/jwts/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityReferrersRequest calls the generic PostV0EndpointsByIdSecurityReferrers builder with application/json body +func NewPostV0EndpointsByIdSecurityReferrersRequest(server string, id string, body PostV0EndpointsByIdSecurityReferrersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdSecurityReferrersRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdSecurityReferrersRequestWithBody constructs an http.Request for the PostV0EndpointsByIdSecurityReferrers method, with any body, and a specified content type +func NewPostV0EndpointsByIdSecurityReferrersRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/referrers", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityReferrersByReferrerIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityReferrersByReferrerId method +func NewDeleteV0EndpointsByIdSecurityReferrersByReferrerIdRequest(server string, id string, referrerId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "referrer_id", referrerId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/referrers/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityRequestFiltersRequest calls the generic PostV0EndpointsByIdSecurityRequestFilters builder with application/json body +func NewPostV0EndpointsByIdSecurityRequestFiltersRequest(server string, id string, body PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdSecurityRequestFiltersRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdSecurityRequestFiltersRequestWithBody constructs an http.Request for the PostV0EndpointsByIdSecurityRequestFilters method, with any body, and a specified content type +func NewPostV0EndpointsByIdSecurityRequestFiltersRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/request_filters", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId method +func NewDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest(server string, id string, requestFilterId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "request_filter_id", requestFilterId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/request_filters/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest calls the generic PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId builder with application/json body +func NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequest(server string, id string, requestFilterId string, body PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequestWithBody(server, id, requestFilterId, "application/json", bodyReader) +} + +// NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequestWithBody constructs an http.Request for the PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId method, with any body, and a specified content type +func NewPutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdRequestWithBody(server string, id string, requestFilterId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "request_filter_id", requestFilterId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/request_filters/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0EndpointsByIdSecurityTokensRequest constructs an http.Request for the PostV0EndpointsByIdSecurityTokens method +func NewPostV0EndpointsByIdSecurityTokensRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/tokens", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteV0EndpointsByIdSecurityTokensByTokenIdRequest constructs an http.Request for the DeleteV0EndpointsByIdSecurityTokensByTokenId method +func NewDeleteV0EndpointsByIdSecurityTokensByTokenIdRequest(server string, id string, tokenId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "token_id", tokenId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security/tokens/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdSecurityOptionsRequest constructs an http.Request for the GetV0EndpointsByIdSecurityOptions method +func NewGetV0EndpointsByIdSecurityOptionsRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security_options", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0EndpointsByIdSecurityOptionsRequest calls the generic PatchV0EndpointsByIdSecurityOptions builder with application/json body +func NewPatchV0EndpointsByIdSecurityOptionsRequest(server string, id string, body PatchV0EndpointsByIdSecurityOptionsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdSecurityOptionsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdSecurityOptionsRequestWithBody constructs an http.Request for the PatchV0EndpointsByIdSecurityOptions method, with any body, and a specified content type +func NewPatchV0EndpointsByIdSecurityOptionsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/security_options", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPatchV0EndpointsByIdStatusRequest calls the generic PatchV0EndpointsByIdStatus builder with application/json body +func NewPatchV0EndpointsByIdStatusRequest(server string, id string, body PatchV0EndpointsByIdStatusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0EndpointsByIdStatusRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0EndpointsByIdStatusRequestWithBody constructs an http.Request for the PatchV0EndpointsByIdStatus method, with any body, and a specified content type +func NewPatchV0EndpointsByIdStatusRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/status", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetV0EndpointsByIdTagsRequest constructs an http.Request for the GetV0EndpointsByIdTags method +func NewGetV0EndpointsByIdTagsRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/tags", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0EndpointsByIdTagsRequest calls the generic PostV0EndpointsByIdTags builder with application/json body +func NewPostV0EndpointsByIdTagsRequest(server string, id string, body PostV0EndpointsByIdTagsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0EndpointsByIdTagsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0EndpointsByIdTagsRequestWithBody constructs an http.Request for the PostV0EndpointsByIdTags method, with any body, and a specified content type +func NewPostV0EndpointsByIdTagsRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/tags", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0EndpointsByIdTagsByTagIdRequest constructs an http.Request for the DeleteV0EndpointsByIdTagsByTagId method +func NewDeleteV0EndpointsByIdTagsByTagIdRequest(server string, id string, tagId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "tag_id", tagId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/tags/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0EndpointsByIdUrlsRequest constructs an http.Request for the GetV0EndpointsByIdUrls method +func NewGetV0EndpointsByIdUrlsRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/endpoints/%s/urls", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0MetricsRequest constructs an http.Request for the GetV0Metrics method +func NewGetV0MetricsRequest(server string, params *GetV0MetricsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/metrics") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "period", params.Period, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "metric", params.Metric, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0TeamsRequest constructs an http.Request for the GetV0Teams method +func NewGetV0TeamsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0TeamsRequest calls the generic PostV0Teams builder with application/json body +func NewPostV0TeamsRequest(server string, body PostV0TeamsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0TeamsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostV0TeamsRequestWithBody constructs an http.Request for the PostV0Teams method, with any body, and a specified content type +func NewPostV0TeamsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0TeamsByIdRequest constructs an http.Request for the DeleteV0TeamsById method +func NewDeleteV0TeamsByIdRequest(server string, id int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0TeamsByIdRequest constructs an http.Request for the GetV0TeamsById method +func NewGetV0TeamsByIdRequest(server string, id int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0TeamsByIdEndpointsRequest constructs an http.Request for the GetV0TeamsByIdEndpoints method +func NewGetV0TeamsByIdEndpointsRequest(server string, id int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s/endpoints", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0TeamsByIdEndpointsRequest calls the generic PatchV0TeamsByIdEndpoints builder with application/json body +func NewPatchV0TeamsByIdEndpointsRequest(server string, id int, body PatchV0TeamsByIdEndpointsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0TeamsByIdEndpointsRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPatchV0TeamsByIdEndpointsRequestWithBody constructs an http.Request for the PatchV0TeamsByIdEndpoints method, with any body, and a specified content type +func NewPatchV0TeamsByIdEndpointsRequestWithBody(server string, id int, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s/endpoints", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0TeamsByIdMembersRequest calls the generic PostV0TeamsByIdMembers builder with application/json body +func NewPostV0TeamsByIdMembersRequest(server string, id int, body PostV0TeamsByIdMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostV0TeamsByIdMembersRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewPostV0TeamsByIdMembersRequestWithBody constructs an http.Request for the PostV0TeamsByIdMembers method, with any body, and a specified content type +func NewPostV0TeamsByIdMembersRequestWithBody(server string, id int, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s/members", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteV0TeamsByIdMembersByUserIdRequest constructs an http.Request for the DeleteV0TeamsByIdMembersByUserId method +func NewDeleteV0TeamsByIdMembersByUserIdRequest(server string, id int, userId int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "user_id", userId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s/members/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV0TeamsByIdMembersByUserIdResendInviteRequest constructs an http.Request for the PostV0TeamsByIdMembersByUserIdResendInvite method +func NewPostV0TeamsByIdMembersByUserIdResendInviteRequest(server string, id int, userId int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "user_id", userId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/teams/%s/members/%s/resend_invite", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0ToolingAccessRequest constructs an http.Request for the GetV0ToolingAccess method +func NewGetV0ToolingAccessRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/tooling-access") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchV0ToolingAccessRequest calls the generic PatchV0ToolingAccess builder with application/json body +func NewPatchV0ToolingAccessRequest(server string, body PatchV0ToolingAccessJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchV0ToolingAccessRequestWithBody(server, "application/json", bodyReader) +} + +// NewPatchV0ToolingAccessRequestWithBody constructs an http.Request for the PatchV0ToolingAccess method, with any body, and a specified content type +func NewPatchV0ToolingAccessRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/tooling-access") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostV0ToolingAccessTokenRequest constructs an http.Request for the PostV0ToolingAccessToken method +func NewPostV0ToolingAccessTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/tooling-access/token") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0UsageRpcRequest constructs an http.Request for the GetV0UsageRpc method +func NewGetV0UsageRpcRequest(server string, params *GetV0UsageRpcParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/usage/rpc") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start_time", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "end_time", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0UsageRpcByChainRequest constructs an http.Request for the GetV0UsageRpcByChain method +func NewGetV0UsageRpcByChainRequest(server string, params *GetV0UsageRpcByChainParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/usage/rpc/by-chain") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start_time", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "end_time", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0UsageRpcByEndpointRequest constructs an http.Request for the GetV0UsageRpcByEndpoint method +func NewGetV0UsageRpcByEndpointRequest(server string, params *GetV0UsageRpcByEndpointParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/usage/rpc/by-endpoint") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start_time", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "end_time", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0UsageRpcByMethodRequest constructs an http.Request for the GetV0UsageRpcByMethod method +func NewGetV0UsageRpcByMethodRequest(server string, params *GetV0UsageRpcByMethodParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/usage/rpc/by-method") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start_time", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "end_time", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV0UsageRpcByTagRequest constructs an http.Request for the GetV0UsageRpcByTag method +func NewGetV0UsageRpcByTagRequest(server string, params *GetV0UsageRpcByTagParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v0/usage/rpc/by-tag") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start_time", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "end_time", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + + // GetV0AccountInfoWithResponse Returns information about the account associated with the API key. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/account/info (the `GetV0AccountInfo` operationId). + GetV0AccountInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0AccountInfoResponse, error) + + // GetV0ApiCreditsByChainWithResponse Returns the API credit cost of each RPC method available on a chain. + // + // Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/api-credits/{chain} (the `GetV0ApiCreditsByChain` operationId). + GetV0ApiCreditsByChainWithResponse(ctx context.Context, chain string, reqEditors ...RequestEditorFn) (*GetV0ApiCreditsByChainResponse, error) + + // GetV0BillingInvoicesWithResponse Returns a list of invoices + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/billing/invoices (the `GetV0BillingInvoices` operationId). + GetV0BillingInvoicesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0BillingInvoicesResponse, error) + + // GetV0BillingPaymentsWithResponse Returns a list of payments. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/billing/payments (the `GetV0BillingPayments` operationId). + GetV0BillingPaymentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0BillingPaymentsResponse, error) + + // GetV0ChainsWithResponse Returns a list of chains. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/chains (the `GetV0Chains` operationId). + GetV0ChainsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0ChainsResponse, error) + + // GetV0EndpointsWithResponse Retrieves a list of endpoints. + // + // Retrieves a list of endpoints. Supports searching, filtering, and sorting. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints (the `GetV0Endpoints` operationId). + GetV0EndpointsWithResponse(ctx context.Context, params *GetV0EndpointsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsResponse, error) + + // PostV0EndpointsWithBodyWithResponse Creates a new endpoint. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). + PostV0EndpointsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsResponse, error) + + // PostV0EndpointsWithResponse Creates a new endpoint. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). + PostV0EndpointsWithResponse(ctx context.Context, body PostV0EndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsResponse, error) + + // PostV0EndpointsBulkStatusWithBodyWithResponse Pause or unpause multiple endpoints in a single call. + // + // Pause or unpause multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). + PostV0EndpointsBulkStatusWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkStatusResponse, error) + + // PostV0EndpointsBulkStatusWithResponse Pause or unpause multiple endpoints in a single call. + // + // Pause or unpause multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). + PostV0EndpointsBulkStatusWithResponse(ctx context.Context, body PostV0EndpointsBulkStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkStatusResponse, error) + + // DeleteV0EndpointsBulkTagsWithBodyWithResponse Remove a tag from multiple endpoints in a single call. + // + // Remove a tag from multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). + DeleteV0EndpointsBulkTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsBulkTagsResponse, error) + + // DeleteV0EndpointsBulkTagsWithResponse Remove a tag from multiple endpoints in a single call. + // + // Remove a tag from multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). + DeleteV0EndpointsBulkTagsWithResponse(ctx context.Context, body DeleteV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsBulkTagsResponse, error) + + // PostV0EndpointsBulkTagsWithBodyWithResponse Add a tag to multiple endpoints in a single call. + // + // Add a tag to multiple endpoints in a single call. Admin-only. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). + PostV0EndpointsBulkTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkTagsResponse, error) + + // PostV0EndpointsBulkTagsWithResponse Add a tag to multiple endpoints in a single call. + // + // Add a tag to multiple endpoints in a single call. Admin-only. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). + PostV0EndpointsBulkTagsWithResponse(ctx context.Context, body PostV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkTagsResponse, error) + + // GetV0EndpointsTagsWithResponse Returns all account-level tags including those with zero endpoints. + // + // Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/tags (the `GetV0EndpointsTags` operationId). + GetV0EndpointsTagsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0EndpointsTagsResponse, error) + + // DeleteV0EndpointsTagsByIdWithResponse Deletes an account tag. + // + // Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/tags/{id} (the `DeleteV0EndpointsTagsById` operationId). + DeleteV0EndpointsTagsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsTagsByIdResponse, error) + + // PatchV0EndpointsTagsByIdWithBodyWithResponse Renames an account tag. + // + // Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). + PatchV0EndpointsTagsByIdWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsTagsByIdResponse, error) + + // PatchV0EndpointsTagsByIdWithResponse Renames an account tag. + // + // Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). + PatchV0EndpointsTagsByIdWithResponse(ctx context.Context, id int, body PatchV0EndpointsTagsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsTagsByIdResponse, error) + + // DeleteV0EndpointsByIdWithResponse Deletes an endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id} (the `DeleteV0EndpointsById` operationId). + DeleteV0EndpointsByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdResponse, error) + + // GetV0EndpointsByIdWithResponse Returns info for a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id} (the `GetV0EndpointsById` operationId). + GetV0EndpointsByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdResponse, error) + + // PatchV0EndpointsByIdWithBodyWithResponse Updates an endpoint. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). + PatchV0EndpointsByIdWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdResponse, error) + + // PatchV0EndpointsByIdWithResponse Updates an endpoint. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). + PatchV0EndpointsByIdWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdResponse, error) + + // PostV0EndpointsByIdDisableMultichainWithResponse Disables multichain for a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/disable_multichain (the `PostV0EndpointsByIdDisableMultichain` operationId). + PostV0EndpointsByIdDisableMultichainWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdDisableMultichainResponse, error) + + // PostV0EndpointsByIdEnableMultichainWithResponse Enables multichain for a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/enable_multichain (the `PostV0EndpointsByIdEnableMultichain` operationId). + PostV0EndpointsByIdEnableMultichainWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdEnableMultichainResponse, error) + + // DeleteV0EndpointsByIdIpCustomHeaderWithResponse Deletes the IP custom header for a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/ip_custom_header (the `DeleteV0EndpointsByIdIpCustomHeader` operationId). + DeleteV0EndpointsByIdIpCustomHeaderWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdIpCustomHeaderResponse, error) + + // PatchV0EndpointsByIdIpCustomHeaderWithBodyWithResponse Creates or updates an IP custom header for a specific endpoint. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). + PatchV0EndpointsByIdIpCustomHeaderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdIpCustomHeaderResponse, error) + + // PatchV0EndpointsByIdIpCustomHeaderWithResponse Creates or updates an IP custom header for a specific endpoint. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). + PatchV0EndpointsByIdIpCustomHeaderWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdIpCustomHeaderResponse, error) + + // GetV0EndpointsByIdLogDetailsWithResponse Retrieves detailed request and response information for a specific log entry. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/log_details (the `GetV0EndpointsByIdLogDetails` operationId). + GetV0EndpointsByIdLogDetailsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdLogDetailsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdLogDetailsResponse, error) + + // GetV0EndpointsByIdLogsWithResponse Retrieves logs for a specific endpoint with filtering and pagination options. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/logs (the `GetV0EndpointsByIdLogs` operationId). + GetV0EndpointsByIdLogsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdLogsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdLogsResponse, error) + + // GetV0EndpointsByIdMethodRateLimitsWithResponse Gets method rate limits. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/method-rate-limits (the `GetV0EndpointsByIdMethodRateLimits` operationId). + GetV0EndpointsByIdMethodRateLimitsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdMethodRateLimitsResponse, error) + + // PostV0EndpointsByIdMethodRateLimitsWithBodyWithResponse Creates a method rate limit. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). + PostV0EndpointsByIdMethodRateLimitsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdMethodRateLimitsResponse, error) + + // PostV0EndpointsByIdMethodRateLimitsWithResponse Creates a method rate limit. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). + PostV0EndpointsByIdMethodRateLimitsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdMethodRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdMethodRateLimitsResponse, error) + + // DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse Deletes a method rate limit. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse(ctx context.Context, id string, methodRateLimitId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) + + // PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBodyWithResponse Updates a method rate limit. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBodyWithResponse(ctx context.Context, id string, methodRateLimitId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) + + // PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse Updates a method rate limit. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). + PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse(ctx context.Context, id string, methodRateLimitId string, body PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) + + // GetV0EndpointsByIdMetricsWithResponse Returns a single metric. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/metrics (the `GetV0EndpointsByIdMetrics` operationId). + GetV0EndpointsByIdMetricsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdMetricsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdMetricsResponse, error) + + // GetV0EndpointsByIdRateLimitsWithResponse Gets endpoint rate limits. + // + // Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/rate-limits (the `GetV0EndpointsByIdRateLimits` operationId). + GetV0EndpointsByIdRateLimitsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdRateLimitsResponse, error) + + // PatchV0EndpointsByIdRateLimitsWithBodyWithResponse Updates endpoint rate limits. + // + // Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). + PatchV0EndpointsByIdRateLimitsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdRateLimitsResponse, error) + + // PatchV0EndpointsByIdRateLimitsWithResponse Updates endpoint rate limits. + // + // Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). + PatchV0EndpointsByIdRateLimitsWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdRateLimitsResponse, error) + + // DeleteV0EndpointsByIdRateLimitsByOverrideIdWithResponse Deletes a user-set endpoint rate limit by UUID. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/rate-limits/{override_id} (the `DeleteV0EndpointsByIdRateLimitsByOverrideId` operationId). + DeleteV0EndpointsByIdRateLimitsByOverrideIdWithResponse(ctx context.Context, id string, overrideId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse, error) + + // GetV0EndpointsByIdSecurityWithResponse Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the + // + // Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/security (the `GetV0EndpointsByIdSecurity` operationId). + GetV0EndpointsByIdSecurityWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdSecurityResponse, error) + + // PostV0EndpointsByIdSecurityDomainMasksWithBodyWithResponse Create an endpoint domain mask. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). + PostV0EndpointsByIdSecurityDomainMasksWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityDomainMasksResponse, error) + + // PostV0EndpointsByIdSecurityDomainMasksWithResponse Create an endpoint domain mask. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). + PostV0EndpointsByIdSecurityDomainMasksWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityDomainMasksResponse, error) + + // DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdWithResponse Deletes an existing endpoint domain mask. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/domain_masks/{domain_mask_id} (the `DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId` operationId). + DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdWithResponse(ctx context.Context, id string, domainMaskId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse, error) + + // PostV0EndpointsByIdSecurityIpsWithBodyWithResponse Creates a new endpoint IP. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). + PostV0EndpointsByIdSecurityIpsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityIpsResponse, error) + + // PostV0EndpointsByIdSecurityIpsWithResponse Creates a new endpoint IP. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). + PostV0EndpointsByIdSecurityIpsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityIpsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityIpsResponse, error) + + // DeleteV0EndpointsByIdSecurityIpsByIpIdWithResponse Deletes an existing endpoint IP. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/ips/{ip_id} (the `DeleteV0EndpointsByIdSecurityIpsByIpId` operationId). + DeleteV0EndpointsByIdSecurityIpsByIpIdWithResponse(ctx context.Context, id string, ipId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityIpsByIpIdResponse, error) + + // PostV0EndpointsByIdSecurityJwtsWithBodyWithResponse Creates a new endpoint JWT. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). + PostV0EndpointsByIdSecurityJwtsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityJwtsResponse, error) + + // PostV0EndpointsByIdSecurityJwtsWithResponse Creates a new endpoint JWT. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). + PostV0EndpointsByIdSecurityJwtsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityJwtsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityJwtsResponse, error) + + // DeleteV0EndpointsByIdSecurityJwtsByJwtIdWithResponse Deletes an existing endpoint JWT. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/jwts/{jwt_id} (the `DeleteV0EndpointsByIdSecurityJwtsByJwtId` operationId). + DeleteV0EndpointsByIdSecurityJwtsByJwtIdWithResponse(ctx context.Context, id string, jwtId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse, error) + + // PostV0EndpointsByIdSecurityReferrersWithBodyWithResponse Creates a new endpoint referrer. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). + PostV0EndpointsByIdSecurityReferrersWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityReferrersResponse, error) + + // PostV0EndpointsByIdSecurityReferrersWithResponse Creates a new endpoint referrer. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). + PostV0EndpointsByIdSecurityReferrersWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityReferrersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityReferrersResponse, error) + + // DeleteV0EndpointsByIdSecurityReferrersByReferrerIdWithResponse Deletes an existing endpoint referrer. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/referrers/{referrer_id} (the `DeleteV0EndpointsByIdSecurityReferrersByReferrerId` operationId). + DeleteV0EndpointsByIdSecurityReferrersByReferrerIdWithResponse(ctx context.Context, id string, referrerId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse, error) + + // PostV0EndpointsByIdSecurityRequestFiltersWithBodyWithResponse Creates a new endpoint request filter for method whitelisting. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). + PostV0EndpointsByIdSecurityRequestFiltersWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityRequestFiltersResponse, error) + + // PostV0EndpointsByIdSecurityRequestFiltersWithResponse Creates a new endpoint request filter for method whitelisting. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). + PostV0EndpointsByIdSecurityRequestFiltersWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityRequestFiltersResponse, error) + + // DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse Deletes an existing endpoint request filter. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse(ctx context.Context, id string, requestFilterId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) + + // PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBodyWithResponse Updates an existing endpoint request filter. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBodyWithResponse(ctx context.Context, id string, requestFilterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) + + // PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse Updates an existing endpoint request filter. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). + PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse(ctx context.Context, id string, requestFilterId string, body PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) + + // PostV0EndpointsByIdSecurityTokensWithResponse Creates a new endpoint authentication token. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/security/tokens (the `PostV0EndpointsByIdSecurityTokens` operationId). + PostV0EndpointsByIdSecurityTokensWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityTokensResponse, error) + + // DeleteV0EndpointsByIdSecurityTokensByTokenIdWithResponse Deletes an existing endpoint token. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/security/tokens/{token_id} (the `DeleteV0EndpointsByIdSecurityTokensByTokenId` operationId). + DeleteV0EndpointsByIdSecurityTokensByTokenIdWithResponse(ctx context.Context, id string, tokenId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse, error) + + // GetV0EndpointsByIdSecurityOptionsWithResponse Gets security options for an endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/security_options (the `GetV0EndpointsByIdSecurityOptions` operationId). + GetV0EndpointsByIdSecurityOptionsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdSecurityOptionsResponse, error) + + // PatchV0EndpointsByIdSecurityOptionsWithBodyWithResponse Updates security options for an endpoint. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). + PatchV0EndpointsByIdSecurityOptionsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdSecurityOptionsResponse, error) + + // PatchV0EndpointsByIdSecurityOptionsWithResponse Updates security options for an endpoint. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). + PatchV0EndpointsByIdSecurityOptionsWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdSecurityOptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdSecurityOptionsResponse, error) + + // PatchV0EndpointsByIdStatusWithBodyWithResponse Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). + PatchV0EndpointsByIdStatusWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdStatusResponse, error) + + // PatchV0EndpointsByIdStatusWithResponse Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). + PatchV0EndpointsByIdStatusWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdStatusResponse, error) + + // GetV0EndpointsByIdTagsWithResponse Returns all tags for a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/tags (the `GetV0EndpointsByIdTags` operationId). + GetV0EndpointsByIdTagsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdTagsResponse, error) + + // PostV0EndpointsByIdTagsWithBodyWithResponse Creates a new tag for a specific endpoint. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). + PostV0EndpointsByIdTagsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdTagsResponse, error) + + // PostV0EndpointsByIdTagsWithResponse Creates a new tag for a specific endpoint. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). + PostV0EndpointsByIdTagsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdTagsResponse, error) + + // DeleteV0EndpointsByIdTagsByTagIdWithResponse Deletes a tag from a specific endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/endpoints/{id}/tags/{tag_id} (the `DeleteV0EndpointsByIdTagsByTagId` operationId). + DeleteV0EndpointsByIdTagsByTagIdWithResponse(ctx context.Context, id string, tagId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdTagsByTagIdResponse, error) + + // GetV0EndpointsByIdUrlsWithResponse Returns the URLs for a specific endpoint. + // + // Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/endpoints/{id}/urls (the `GetV0EndpointsByIdUrls` operationId). + GetV0EndpointsByIdUrlsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdUrlsResponse, error) + + // GetV0MetricsWithResponse Fetches metrics aggregated across all endpoints for an account. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/metrics (the `GetV0Metrics` operationId). + GetV0MetricsWithResponse(ctx context.Context, params *GetV0MetricsParams, reqEditors ...RequestEditorFn) (*GetV0MetricsResponse, error) + + // GetV0TeamsWithResponse Retrieves a list of all teams. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/teams (the `GetV0Teams` operationId). + GetV0TeamsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0TeamsResponse, error) + + // PostV0TeamsWithBodyWithResponse Creates a new team. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/teams (the `PostV0Teams` operationId). + PostV0TeamsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0TeamsResponse, error) + + // PostV0TeamsWithResponse Creates a new team. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/teams (the `PostV0Teams` operationId). + PostV0TeamsWithResponse(ctx context.Context, body PostV0TeamsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0TeamsResponse, error) + + // DeleteV0TeamsByIdWithResponse Deletes an empty team. + // + // Deletes an empty team. The team must have no members before it can be deleted. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/teams/{id} (the `DeleteV0TeamsById` operationId). + DeleteV0TeamsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteV0TeamsByIdResponse, error) + + // GetV0TeamsByIdWithResponse Retrieves details for a specific team. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/teams/{id} (the `GetV0TeamsById` operationId). + GetV0TeamsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetV0TeamsByIdResponse, error) + + // GetV0TeamsByIdEndpointsWithResponse Retrieves a list of endpoints accessible to a team. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/teams/{id}/endpoints (the `GetV0TeamsByIdEndpoints` operationId). + GetV0TeamsByIdEndpointsWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetV0TeamsByIdEndpointsResponse, error) + + // PatchV0TeamsByIdEndpointsWithBodyWithResponse Assigns or unassigns endpoints to a team. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). + PatchV0TeamsByIdEndpointsWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0TeamsByIdEndpointsResponse, error) + + // PatchV0TeamsByIdEndpointsWithResponse Assigns or unassigns endpoints to a team. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). + PatchV0TeamsByIdEndpointsWithResponse(ctx context.Context, id int, body PatchV0TeamsByIdEndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0TeamsByIdEndpointsResponse, error) + + // PostV0TeamsByIdMembersWithBodyWithResponse Invites a user to a team. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). + PostV0TeamsByIdMembersWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersResponse, error) + + // PostV0TeamsByIdMembersWithResponse Invites a user to a team. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). + PostV0TeamsByIdMembersWithResponse(ctx context.Context, id int, body PostV0TeamsByIdMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersResponse, error) + + // DeleteV0TeamsByIdMembersByUserIdWithResponse Removes a user from a team. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v0/teams/{id}/members/{user_id} (the `DeleteV0TeamsByIdMembersByUserId` operationId). + DeleteV0TeamsByIdMembersByUserIdWithResponse(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*DeleteV0TeamsByIdMembersByUserIdResponse, error) + + // PostV0TeamsByIdMembersByUserIdResendInviteWithResponse Resends an invitation email to a pending team member. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/teams/{id}/members/{user_id}/resend_invite (the `PostV0TeamsByIdMembersByUserIdResendInvite` operationId). + PostV0TeamsByIdMembersByUserIdResendInviteWithResponse(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersByUserIdResendInviteResponse, error) + + // GetV0ToolingAccessWithResponse Returns whether Tooling Access is enabled for the account. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/tooling-access (the `GetV0ToolingAccess` operationId). + GetV0ToolingAccessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0ToolingAccessResponse, error) + + // PatchV0ToolingAccessWithBodyWithResponse Enable (provision/reactivate) or disable Tooling Access for the account. + // + // Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). + PatchV0ToolingAccessWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0ToolingAccessResponse, error) + + // PatchV0ToolingAccessWithResponse Enable (provision/reactivate) or disable Tooling Access for the account. + // + // Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). + PatchV0ToolingAccessWithResponse(ctx context.Context, body PatchV0ToolingAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0ToolingAccessResponse, error) + + // PostV0ToolingAccessTokenWithResponse Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. + // + // Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v0/tooling-access/token (the `PostV0ToolingAccessToken` operationId). + PostV0ToolingAccessTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostV0ToolingAccessTokenResponse, error) + + // GetV0UsageRpcWithResponse Retrieves usage total for specified time range. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/usage/rpc (the `GetV0UsageRpc` operationId). + GetV0UsageRpcWithResponse(ctx context.Context, params *GetV0UsageRpcParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcResponse, error) + + // GetV0UsageRpcByChainWithResponse Retrieves usage data by chain. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/usage/rpc/by-chain (the `GetV0UsageRpcByChain` operationId). + GetV0UsageRpcByChainWithResponse(ctx context.Context, params *GetV0UsageRpcByChainParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByChainResponse, error) + + // GetV0UsageRpcByEndpointWithResponse Retrieves usage data by endpoint. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/usage/rpc/by-endpoint (the `GetV0UsageRpcByEndpoint` operationId). + GetV0UsageRpcByEndpointWithResponse(ctx context.Context, params *GetV0UsageRpcByEndpointParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByEndpointResponse, error) + + // GetV0UsageRpcByMethodWithResponse Retrieves usage data by method. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/usage/rpc/by-method (the `GetV0UsageRpcByMethod` operationId). + GetV0UsageRpcByMethodWithResponse(ctx context.Context, params *GetV0UsageRpcByMethodParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByMethodResponse, error) + + // GetV0UsageRpcByTagWithResponse Retrieves usage data grouped by tag. + // + // Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v0/usage/rpc/by-tag (the `GetV0UsageRpcByTag` operationId). + GetV0UsageRpcByTagWithResponse(ctx context.Context, params *GetV0UsageRpcByTagParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByTagResponse, error) +} + +type GetV0AccountInfoResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An object which contains the following fields: + Data *struct { + // BillingVersion The billing version associated with the account + BillingVersion *string `json:"billing_version,omitempty"` + + // CreatedAt The timestamp when the account was created + CreatedAt *string `json:"created_at,omitempty"` + + // Id The unique identifier for the account + Id *int `json:"id,omitempty"` + + // Name The name of the account + Name *string `json:"name,omitempty"` + + // Subscription An object containing the account's subscription details: + Subscription *struct { + // Interval The billing interval of the subscription + Interval *string `json:"interval,omitempty"` + + // PlanName The name of the subscription plan + PlanName *string `json:"plan_name,omitempty"` + + // Status The status of the subscription + Status *string `json:"status,omitempty"` + } `json:"subscription,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0AccountInfoResponse) GetJSON200() *struct { + // Data An object which contains the following fields: + Data *struct { + // BillingVersion The billing version associated with the account + BillingVersion *string `json:"billing_version,omitempty"` + + // CreatedAt The timestamp when the account was created + CreatedAt *string `json:"created_at,omitempty"` + + // Id The unique identifier for the account + Id *int `json:"id,omitempty"` + + // Name The name of the account + Name *string `json:"name,omitempty"` + + // Subscription An object containing the account's subscription details: + Subscription *struct { + // Interval The billing interval of the subscription + Interval *string `json:"interval,omitempty"` + + // PlanName The name of the subscription plan + PlanName *string `json:"plan_name,omitempty"` + + // Status The status of the subscription + Status *string `json:"status,omitempty"` + } `json:"subscription,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0AccountInfoResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0AccountInfoResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0AccountInfoResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0AccountInfoResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0ApiCreditsByChainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Credits The API credit cost of the method for the account's billing version + Credits *int `json:"credits,omitempty"` + + // Method The name of the RPC method + Method *string `json:"method,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0ApiCreditsByChainResponse) GetJSON200() *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Credits The API credit cost of the method for the account's billing version + Credits *int `json:"credits,omitempty"` + + // Method The name of the RPC method + Method *string `json:"method,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0ApiCreditsByChainResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0ApiCreditsByChainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0ApiCreditsByChainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0ApiCreditsByChainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0BillingInvoicesResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Invoices An array of invoices + Invoices *[]struct { + // AmountDue The total amount that is due on the invoice + AmountDue *int `json:"amount_due,omitempty"` + + // AmountPaid The total amount that has been paid for the invoice + AmountPaid *int `json:"amount_paid,omitempty"` + + // BillingReason The reason for generating the invoice + BillingReason *string `json:"billing_reason,omitempty"` + + // Created The timestamp when the invoice was created in second + Created *int `json:"created,omitempty"` + + // Id The unique identifier for the invoice + Id *string `json:"id,omitempty"` + + // Lines An array of lines which contains the following fields: + Lines *[]struct { + // Amount The cost associated with each line item + Amount *int `json:"amount,omitempty"` + + // Description A detailed description of each line item billed + Description *string `json:"description,omitempty"` + } `json:"lines,omitempty"` + + // PeriodEnd The end timestamp of the billing period for the invoice in second + PeriodEnd *int `json:"period_end,omitempty"` + + // PeriodStart The start timestamp of the billing period for the invoice in second + PeriodStart *int `json:"period_start,omitempty"` + + // Status The current state of the invoice + Status *string `json:"status,omitempty"` + + // Subtotal The total cost of the invoice + Subtotal *int `json:"subtotal,omitempty"` + } `json:"invoices,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0BillingInvoicesResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Invoices An array of invoices + Invoices *[]struct { + // AmountDue The total amount that is due on the invoice + AmountDue *int `json:"amount_due,omitempty"` + + // AmountPaid The total amount that has been paid for the invoice + AmountPaid *int `json:"amount_paid,omitempty"` + + // BillingReason The reason for generating the invoice + BillingReason *string `json:"billing_reason,omitempty"` + + // Created The timestamp when the invoice was created in second + Created *int `json:"created,omitempty"` + + // Id The unique identifier for the invoice + Id *string `json:"id,omitempty"` + + // Lines An array of lines which contains the following fields: + Lines *[]struct { + // Amount The cost associated with each line item + Amount *int `json:"amount,omitempty"` + + // Description A detailed description of each line item billed + Description *string `json:"description,omitempty"` + } `json:"lines,omitempty"` + + // PeriodEnd The end timestamp of the billing period for the invoice in second + PeriodEnd *int `json:"period_end,omitempty"` + + // PeriodStart The start timestamp of the billing period for the invoice in second + PeriodStart *int `json:"period_start,omitempty"` + + // Status The current state of the invoice + Status *string `json:"status,omitempty"` + + // Subtotal The total cost of the invoice + Subtotal *int `json:"subtotal,omitempty"` + } `json:"invoices,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0BillingInvoicesResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0BillingInvoicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0BillingInvoicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0BillingInvoicesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0BillingPaymentsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Payments An array of payments associated with the account + Payments *[]struct { + // Amount The total amount of the payment + Amount *string `json:"amount,omitempty"` + + // CardLast4 The last four digits of the card used for the payment (masked for security) + CardLast4 *string `json:"card_last_4,omitempty"` + + // CreatedAt The timestamp when the payment was created in second + CreatedAt *string `json:"created_at,omitempty"` + + // Currency The currency in which the payment was made + Currency *string `json:"currency,omitempty"` + + // MarketplaceAmount The total amount spent in the marketplace + MarketplaceAmount *string `json:"marketplace_amount,omitempty"` + + // Status The current status of the payment + Status *string `json:"status,omitempty"` + } `json:"payments,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0BillingPaymentsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Payments An array of payments associated with the account + Payments *[]struct { + // Amount The total amount of the payment + Amount *string `json:"amount,omitempty"` + + // CardLast4 The last four digits of the card used for the payment (masked for security) + CardLast4 *string `json:"card_last_4,omitempty"` + + // CreatedAt The timestamp when the payment was created in second + CreatedAt *string `json:"created_at,omitempty"` + + // Currency The currency in which the payment was made + Currency *string `json:"currency,omitempty"` + + // MarketplaceAmount The total amount spent in the marketplace + MarketplaceAmount *string `json:"marketplace_amount,omitempty"` + + // Status The current status of the payment + Status *string `json:"status,omitempty"` + } `json:"payments,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0BillingPaymentsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0BillingPaymentsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0BillingPaymentsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0BillingPaymentsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0ChainsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + IsSelectChain *bool `json:"is_select_chain,omitempty"` + + // Networks An array of networks + Networks *[]struct { + ChainId *int `json:"chain_id,omitempty"` + + // Name The name of the specific network + Name *string `json:"name,omitempty"` + + // Slug A short, unique identifier for the specific network + Slug *string `json:"slug,omitempty"` + } `json:"networks,omitempty"` + + // Slug A short, unique identifier for the blockchain network + Slug *string `json:"slug,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0ChainsResponse) GetJSON200() *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + IsSelectChain *bool `json:"is_select_chain,omitempty"` + + // Networks An array of networks + Networks *[]struct { + ChainId *int `json:"chain_id,omitempty"` + + // Name The name of the specific network + Name *string `json:"name,omitempty"` + + // Slug A short, unique identifier for the specific network + Slug *string `json:"slug,omitempty"` + } `json:"networks,omitempty"` + + // Slug A short, unique identifier for the blockchain network + Slug *string `json:"slug,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0ChainsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0ChainsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0ChainsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0ChainsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the specific endpoint + Id *string `json:"id,omitempty"` + + // IsDedicated Whether the endpoint is a dedicated endpoint + IsDedicated *bool `json:"is_dedicated,omitempty"` + + // IsFlatRate Whether the endpoint is a flat rate endpoint + IsFlatRate *bool `json:"is_flat_rate,omitempty"` + + // IsMultichain Whether the endpoint is a multichain endpoint + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Name The endpoint subdomain + Name *string `json:"name,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Status The current status of the endpoint (active or paused) + Status *string `json:"status,omitempty"` + + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + + // Pagination Pagination details for the response + Pagination *struct { + // Limit The maximum number of endpoints returned per page + Limit *int `json:"limit,omitempty"` + + // Offset The number of endpoints skipped + Offset *int `json:"offset,omitempty"` + + // Total The total number of endpoints matching the query + Total *int `json:"total,omitempty"` + } `json:"pagination,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsResponse) GetJSON200() *struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the specific endpoint + Id *string `json:"id,omitempty"` + + // IsDedicated Whether the endpoint is a dedicated endpoint + IsDedicated *bool `json:"is_dedicated,omitempty"` + + // IsFlatRate Whether the endpoint is a flat rate endpoint + IsFlatRate *bool `json:"is_flat_rate,omitempty"` + + // IsMultichain Whether the endpoint is a multichain endpoint + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Name The endpoint subdomain + Name *string `json:"name,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Status The current status of the endpoint (active or paused) + Status *string `json:"status,omitempty"` + + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + + // Pagination Pagination details for the response + Pagination *struct { + // Limit The maximum number of endpoints returned per page + Limit *int `json:"limit,omitempty"` + + // Offset The number of endpoints skipped + Offset *int `json:"offset,omitempty"` + + // Total The total number of endpoints matching the query + Total *int `json:"total,omitempty"` + } `json:"pagination,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + // DomainMasks An array of domain-based security configurations + DomainMasks *[]struct { + // Domain The allowed domain for accessing the endpoint + Domain *string `json:"domain,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"domainMasks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + + // Options A list of security options available for the endpoint + Options *struct { + // Cors Indicates whether Cross-Origin Resource Sharing (CORS) is enabled + Cors *bool `json:"cors,omitempty"` + + // DebugAuthErrors Indicates whether detailed authentication error debugging is enabled + DebugAuthErrors *bool `json:"debugAuthErrors,omitempty"` + + // DomainMasks Indicates whether domain mask security is enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // EnforceChainNetwork Indicates whether the specified chain and network are enforced for the endpoint + EnforceChainNetwork *bool `json:"enforceChainNetwork,omitempty"` + + // Hosts Indicates whether host-based security is enabled + Hosts *bool `json:"hosts,omitempty"` + + // Hsts Indicates whether HTTP Strict Transport Security (HSTS) is enforced + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader Indicates whether a custom IP header is applied + IpCustomHeader *bool `json:"ipCustomHeader,omitempty"` + + // Ips Indicates whether IP-based security is enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Indicates whether JWT-based security is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Indicates whether referrer-based security is enable + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Indicates whether request filters are applied + RequestFilters *bool `json:"requestFilters,omitempty"` + + // Tokens Indicates whether token-based security is enabled + Tokens *bool `json:"tokens,omitempty"` + + // ValidHosts Indicates whether only valid hosts are allowed + ValidHosts *bool `json:"validHosts,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + // DomainMasks An array of domain-based security configurations + DomainMasks *[]struct { + // Domain The allowed domain for accessing the endpoint + Domain *string `json:"domain,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"domainMasks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + + // Options A list of security options available for the endpoint + Options *struct { + // Cors Indicates whether Cross-Origin Resource Sharing (CORS) is enabled + Cors *bool `json:"cors,omitempty"` + + // DebugAuthErrors Indicates whether detailed authentication error debugging is enabled + DebugAuthErrors *bool `json:"debugAuthErrors,omitempty"` + + // DomainMasks Indicates whether domain mask security is enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // EnforceChainNetwork Indicates whether the specified chain and network are enforced for the endpoint + EnforceChainNetwork *bool `json:"enforceChainNetwork,omitempty"` + + // Hosts Indicates whether host-based security is enabled + Hosts *bool `json:"hosts,omitempty"` + + // Hsts Indicates whether HTTP Strict Transport Security (HSTS) is enforced + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader Indicates whether a custom IP header is applied + IpCustomHeader *bool `json:"ipCustomHeader,omitempty"` + + // Ips Indicates whether IP-based security is enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Indicates whether JWT-based security is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Indicates whether referrer-based security is enable + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Indicates whether request filters are applied + RequestFilters *bool `json:"requestFilters,omitempty"` + + // Tokens Indicates whether token-based security is enabled + Tokens *bool `json:"tokens,omitempty"` + + // ValidHosts Indicates whether only valid hosts are allowed + ValidHosts *bool `json:"validHosts,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsBulkStatusResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the result of the bulk status update + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the status update succeeded for this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsBulkStatusResponse) GetJSON200() *struct { + // Data Contains the result of the bulk status update + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the status update succeeded for this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsBulkStatusResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsBulkStatusResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsBulkStatusResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsBulkStatusResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsBulkTagsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the result of the bulk tag removal + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully removed from this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsBulkTagsResponse) GetJSON200() *struct { + // Data Contains the result of the bulk tag removal + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully removed from this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsBulkTagsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsBulkTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsBulkTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsBulkTagsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsBulkTagsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the result of the bulk tag operation + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully added to this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Tag The tag that was added to the endpoints + Tag *struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tag,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsBulkTagsResponse) GetJSON200() *struct { + // Data Contains the result of the bulk tag operation + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully added to this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Tag The tag that was added to the endpoints + Tag *struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tag,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsBulkTagsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsBulkTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsBulkTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsBulkTagsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsTagsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the tags data + Data *struct { + // Tags An array of tag objects + Tags *[]struct { + // Id The unique identifier for the tag + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints associated with this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsTagsResponse) GetJSON200() *struct { + // Data Contains the tags data + Data *struct { + // Tags An array of tag objects + Tags *[]struct { + // Id The unique identifier for the tag + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints associated with this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsTagsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsTagsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsTagsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the result of the deletion + Data *map[string]interface{} `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsTagsByIdResponse) GetJSON200() *struct { + // Data Contains the result of the deletion + Data *map[string]interface{} `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsTagsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsTagsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsTagsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsTagsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsTagsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the updated tag details + Data *struct { + // Id The unique identifier of the tag + Id *int `json:"id,omitempty"` + + // Label The updated label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints currently using this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsTagsByIdResponse) GetJSON200() *struct { + // Data Contains the updated tag details + Data *struct { + // Id The unique identifier of the tag + Id *int `json:"id,omitempty"` + + // Label The updated label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints currently using this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsTagsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsTagsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsTagsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsTagsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Result Indicates whether the endpoint was deleted + Result *bool `json:"result,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdResponse) GetJSON200() *struct { + // Result Indicates whether the endpoint was deleted + Result *bool `json:"result,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + DomainMasks *[]struct { + Domain *string `json:"domain,omitempty"` + Id *string `json:"id,omitempty"` + } `json:"domain_masks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + Options *struct { + Cors *bool `json:"cors,omitempty"` + DomainMasks *bool `json:"domainMasks,omitempty"` + Hsts *bool `json:"hsts,omitempty"` + IpCustomHeader *struct { + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + Ips *bool `json:"ips,omitempty"` + Jwts *bool `json:"jwts,omitempty"` + Referrers *bool `json:"referrers,omitempty"` + RequestFilters *bool `json:"requestFilters,omitempty"` + ResponseLogging *bool `json:"responseLogging,omitempty"` + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + RequestFilters *[]struct { + Id *string `json:"id,omitempty"` + Method *[]string `json:"method,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // Status Current state of the endpoint — either `active` or `paused` + Status *string `json:"status,omitempty"` + Tags *[]struct { + Label *string `json:"label,omitempty"` + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + DomainMasks *[]struct { + Domain *string `json:"domain,omitempty"` + Id *string `json:"id,omitempty"` + } `json:"domain_masks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + Options *struct { + Cors *bool `json:"cors,omitempty"` + DomainMasks *bool `json:"domainMasks,omitempty"` + Hsts *bool `json:"hsts,omitempty"` + IpCustomHeader *struct { + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + Ips *bool `json:"ips,omitempty"` + Jwts *bool `json:"jwts,omitempty"` + Referrers *bool `json:"referrers,omitempty"` + RequestFilters *bool `json:"requestFilters,omitempty"` + ResponseLogging *bool `json:"responseLogging,omitempty"` + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + RequestFilters *[]struct { + Id *string `json:"id,omitempty"` + Method *[]string `json:"method,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // Status Current state of the endpoint — either `active` or `paused` + Status *string `json:"status,omitempty"` + Tags *[]struct { + Label *string `json:"label,omitempty"` + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Indicates whether the updation is done or not + Data *bool `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdResponse) GetJSON200() *struct { + // Data Indicates whether the updation is done or not + Data *bool `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdDisableMultichainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Returns true when multichain is successfully disabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdDisableMultichainResponse) GetJSON200() *struct { + // Data Returns true when multichain is successfully disabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdDisableMultichainResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdDisableMultichainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdDisableMultichainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdDisableMultichainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdEnableMultichainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Returns true when multichain is successfully enabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdEnableMultichainResponse) GetJSON200() *struct { + // Data Returns true when multichain is successfully enabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdEnableMultichainResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdEnableMultichainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdEnableMultichainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdEnableMultichainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdIpCustomHeaderResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Returns true when the IP custom header is successfully deleted + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdIpCustomHeaderResponse) GetJSON200() *struct { + // Data Returns true when the IP custom header is successfully deleted + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdIpCustomHeaderResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdIpCustomHeaderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdIpCustomHeaderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdIpCustomHeaderResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdIpCustomHeaderResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the updated IP custom header details + Data *struct { + // HeaderName The name of the IP custom header that was set + HeaderName *string `json:"header_name,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdIpCustomHeaderResponse) GetJSON200() *struct { + // Data Contains the updated IP custom header details + Data *struct { + // HeaderName The name of the IP custom header that was set + HeaderName *string `json:"header_name,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdIpCustomHeaderResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdIpCustomHeaderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdIpCustomHeaderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdIpCustomHeaderResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdLogDetailsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains detailed information about a specific log entry, including the raw request that was sent and the response that was received. + Data *struct { + // Request A JSON-encoded string representing the request payload that was sent in the original log entry. The logs are truncated after 2KB. + Request *string `json:"request,omitempty"` + + // Response A JSON-encoded string containing the full response returned by the API or aggregator for the logged request. The logs are truncated after 2KB. + Response *string `json:"response,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdLogDetailsResponse) GetJSON200() *struct { + // Data Contains detailed information about a specific log entry, including the raw request that was sent and the response that was received. + Data *struct { + // Request A JSON-encoded string representing the request payload that was sent in the original log entry. The logs are truncated after 2KB. + Request *string `json:"request,omitempty"` + + // Response A JSON-encoded string containing the full response returned by the API or aggregator for the logged request. The logs are truncated after 2KB. + Response *string `json:"response,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdLogDetailsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdLogDetailsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdLogDetailsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdLogDetailsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdLogsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of log entries which contains the following fields: + Data *[]struct { + // Details Additional error details if available (nullable) + Details *string `json:"details,omitempty"` + + // ErrorCode The application-specific error code returned + ErrorCode *int `json:"error_code,omitempty"` + + // HttpMethod The HTTP method used for the request + HttpMethod *string `json:"http_method,omitempty"` + + // Method The name of the method invoked + Method *string `json:"method,omitempty"` + + // Network The name of the network on which the method was called + Network *string `json:"network,omitempty"` + + // RequestId The unique identifier for the request + RequestId *string `json:"request_id,omitempty"` + + // Status The HTTP status code returned by the request + Status *int `json:"status,omitempty"` + + // Timestamp The timestamp when the log was recorded + Timestamp *string `json:"timestamp,omitempty"` + + // Url The request URL + Url *string `json:"url,omitempty"` + } `json:"data,omitempty"` + + // NextAt A cursor string used for pagination to fetch the next set of logs + NextAt *string `json:"next_at,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdLogsResponse) GetJSON200() *struct { + // Data An array of log entries which contains the following fields: + Data *[]struct { + // Details Additional error details if available (nullable) + Details *string `json:"details,omitempty"` + + // ErrorCode The application-specific error code returned + ErrorCode *int `json:"error_code,omitempty"` + + // HttpMethod The HTTP method used for the request + HttpMethod *string `json:"http_method,omitempty"` + + // Method The name of the method invoked + Method *string `json:"method,omitempty"` + + // Network The name of the network on which the method was called + Network *string `json:"network,omitempty"` + + // RequestId The unique identifier for the request + RequestId *string `json:"request_id,omitempty"` + + // Status The HTTP status code returned by the request + Status *int `json:"status,omitempty"` + + // Timestamp The timestamp when the log was recorded + Timestamp *string `json:"timestamp,omitempty"` + + // Url The request URL + Url *string `json:"url,omitempty"` + } `json:"data,omitempty"` + + // NextAt A cursor string used for pagination to fetch the next set of logs + NextAt *string `json:"next_at,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdLogsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdLogsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdMethodRateLimitsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // RateLimiters An array of rate limiter configurations + RateLimiters *[]struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of method names to which the rate limiter applies + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The number of allowed requests within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"rate_limiters,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdMethodRateLimitsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // RateLimiters An array of rate limiter configurations + RateLimiters *[]struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of method names to which the rate limiter applies + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The number of allowed requests within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"rate_limiters,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdMethodRateLimitsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdMethodRateLimitsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdMethodRateLimitsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdMethodRateLimitsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdMethodRateLimitsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdMethodRateLimitsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdMethodRateLimitsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdMethodRateLimitsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdMethodRateLimitsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdMethodRateLimitsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data A message indicating the result of the operation + Data *string `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) GetJSON200() *struct { + // Data A message indicating the result of the operation + Data *string `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdMetricsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of data + Data *[]struct { + // Data A nested list of numerical values representing the metric fetched for the endpoint + Data *[]interface{} `json:"data,omitempty"` + + // Tag A string label that identifies or categorizes the specific metric + Tag *string `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message if the request to fetch the metric fails + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdMetricsResponse) GetJSON200() *struct { + // Data An array of data + Data *[]struct { + // Data A nested list of numerical values representing the metric fetched for the endpoint + Data *[]interface{} `json:"data,omitempty"` + + // Tag A string label that identifies or categorizes the specific metric + Tag *string `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message if the request to fetch the metric fails + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdMetricsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdMetricsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdMetricsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdMetricsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdRateLimitsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the endpoint rate limit configuration + Data *struct { + // RateLimits An array of endpoint rate limit configurations + RateLimits *[]struct { + // Bucket The rate limit bucket, such as rps, rpm, or rpd + Bucket *string `json:"bucket,omitempty"` + + // Id The unique identifier for a user-set endpoint rate limit override. This field is returned for user_override rate limits and can be used to delete a specific endpoint rate limit. + Id *string `json:"id,omitempty"` + + // RateLimit The rate limit value for the bucket + RateLimit *int `json:"rate_limit,omitempty"` + + // Source The source of the rate limit, such as plan_default or user_override + Source *string `json:"source,omitempty"` + } `json:"rate_limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdRateLimitsResponse) GetJSON200() *struct { + // Data The data object which contains the endpoint rate limit configuration + Data *struct { + // RateLimits An array of endpoint rate limit configurations + RateLimits *[]struct { + // Bucket The rate limit bucket, such as rps, rpm, or rpd + Bucket *string `json:"bucket,omitempty"` + + // Id The unique identifier for a user-set endpoint rate limit override. This field is returned for user_override rate limits and can be used to delete a specific endpoint rate limit. + Id *string `json:"id,omitempty"` + + // RateLimit The rate limit value for the bucket + RateLimit *int `json:"rate_limit,omitempty"` + + // Source The source of the rate limit, such as plan_default or user_override + Source *string `json:"source,omitempty"` + } `json:"rate_limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdRateLimitsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdRateLimitsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdRateLimitsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdRateLimitsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdRateLimitsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Limits The limits object which contains the following fields: + Limits *struct { + // Rpd The maximum number of requests allowed per day. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpd *int `json:"rpd,omitempty"` + + // Rpm The maximum number of requests allowed per minute. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpm *int `json:"rpm,omitempty"` + + // Rps The maximum number of requests allowed per second. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rps *int `json:"rps,omitempty"` + } `json:"limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdRateLimitsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Limits The limits object which contains the following fields: + Limits *struct { + // Rpd The maximum number of requests allowed per day. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpd *int `json:"rpd,omitempty"` + + // Rpm The maximum number of requests allowed per minute. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpm *int `json:"rpm,omitempty"` + + // Rps The maximum number of requests allowed per second. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rps *int `json:"rps,omitempty"` + } `json:"limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdRateLimitsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdRateLimitsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdRateLimitsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdRateLimitsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the result of the operation + Data *struct { + // Success Indicates whether the endpoint rate limit was deleted + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse) GetJSON200() *struct { + // Data The data object which contains the result of the operation + Data *struct { + // Success Indicates whether the endpoint rate limit was deleted + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdSecurityResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the security state of the endpoint + Data *struct { + // DomainMasks An array of domain mask entries; null if none configured + DomainMasks *[]interface{} `json:"domain_masks,omitempty"` + + // Ips An array of allowed IP entries; null if none configured + Ips *[]interface{} `json:"ips,omitempty"` + + // Jwts An array of JWT configuration objects; null if none configured + Jwts *[]interface{} `json:"jwts,omitempty"` + + // Options Security feature toggles for the endpoint + Options *struct { + // Cors Whether CORS is enabled + Cors *bool `json:"cors,omitempty"` + + // DomainMasks Whether domain mask restrictions are enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // Hsts Whether HSTS is enabled + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader IP custom header configuration + IpCustomHeader *struct { + // Value The IP custom header value; null if not set + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + + // Ips Whether IP-based restrictions are enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Whether JWT-based authentication is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Whether referrer-based restrictions are enabled + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Whether request filters are enabled + RequestFilters *bool `json:"requestFilters,omitempty"` + + // ResponseLogging Whether response logging is enabled + ResponseLogging *bool `json:"responseLogging,omitempty"` + + // Tokens Whether token-based authentication is enabled + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of allowed referrer entries; null if none configured + Referrers *[]interface{} `json:"referrers,omitempty"` + + // RequestFilters An array of request filter objects; null if none configured + RequestFilters *[]struct { + // Id The unique identifier (UUID) of the request filter + Id *string `json:"id,omitempty"` + + // Method An array of whitelisted method names + Method *[]interface{} `json:"method,omitempty"` + + // Params Parameter constraints for the filter + Params *map[string]interface{} `json:"params,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of authentication token objects; null if none configured + Tokens *[]struct { + // Id The unique identifier (UUID) of the token + Id *string `json:"id,omitempty"` + + // Token The authentication token value + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdSecurityResponse) GetJSON200() *struct { + // Data Contains the security state of the endpoint + Data *struct { + // DomainMasks An array of domain mask entries; null if none configured + DomainMasks *[]interface{} `json:"domain_masks,omitempty"` + + // Ips An array of allowed IP entries; null if none configured + Ips *[]interface{} `json:"ips,omitempty"` + + // Jwts An array of JWT configuration objects; null if none configured + Jwts *[]interface{} `json:"jwts,omitempty"` + + // Options Security feature toggles for the endpoint + Options *struct { + // Cors Whether CORS is enabled + Cors *bool `json:"cors,omitempty"` + + // DomainMasks Whether domain mask restrictions are enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // Hsts Whether HSTS is enabled + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader IP custom header configuration + IpCustomHeader *struct { + // Value The IP custom header value; null if not set + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + + // Ips Whether IP-based restrictions are enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Whether JWT-based authentication is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Whether referrer-based restrictions are enabled + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Whether request filters are enabled + RequestFilters *bool `json:"requestFilters,omitempty"` + + // ResponseLogging Whether response logging is enabled + ResponseLogging *bool `json:"responseLogging,omitempty"` + + // Tokens Whether token-based authentication is enabled + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of allowed referrer entries; null if none configured + Referrers *[]interface{} `json:"referrers,omitempty"` + + // RequestFilters An array of request filter objects; null if none configured + RequestFilters *[]struct { + // Id The unique identifier (UUID) of the request filter + Id *string `json:"id,omitempty"` + + // Method An array of whitelisted method names + Method *[]interface{} `json:"method,omitempty"` + + // Params Parameter constraints for the filter + Params *map[string]interface{} `json:"params,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of authentication token objects; null if none configured + Tokens *[]struct { + // Id The unique identifier (UUID) of the token + Id *string `json:"id,omitempty"` + + // Token The authentication token value + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdSecurityResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdSecurityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdSecurityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdSecurityResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityDomainMasksResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // DomainMask The domain mask that you used to mask your endpoint + DomainMask *string `json:"domain_mask,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityDomainMasksResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // DomainMask The domain mask that you used to mask your endpoint + DomainMask *string `json:"domain_mask,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityDomainMasksResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityDomainMasksResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityDomainMasksResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityDomainMasksResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Represent successfully deleted the existing endpoint domain mask + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse) GetJSON200() *struct { + // Data Represent successfully deleted the existing endpoint domain mask + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityIpsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the IP rule + Id *string `json:"id,omitempty"` + + // Ip The IP address that is allowed to access the API endpoint + Ip *string `json:"ip,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityIpsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the IP rule + Id *string `json:"id,omitempty"` + + // Ip The IP address that is allowed to access the API endpoint + Ip *string `json:"ip,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityIpsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityIpsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityIpsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityIpsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityIpsByIpIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Represent successfully deleted the existing endpoint IP + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdSecurityIpsByIpIdResponse) GetJSON200() *struct { + // Data Represent successfully deleted the existing endpoint IP + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityIpsByIpIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityIpsByIpIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityIpsByIpIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityIpsByIpIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityJwtsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the JWT configuration + Id *string `json:"id,omitempty"` + + // Kid The key identifier (KID) associated with the public key + Kid *string `json:"kid,omitempty"` + + // Name A human-readable name for the JWT configuration + Name *string `json:"name,omitempty"` + + // PublicKey The public key used to verify the JWT token + PublicKey *string `json:"public_key,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityJwtsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the JWT configuration + Id *string `json:"id,omitempty"` + + // Kid The key identifier (KID) associated with the public key + Kid *string `json:"kid,omitempty"` + + // Name A human-readable name for the JWT configuration + Name *string `json:"name,omitempty"` + + // PublicKey The public key used to verify the JWT token + PublicKey *string `json:"public_key,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityJwtsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityJwtsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityJwtsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityJwtsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Represent successfully deleted the existing endpoint jwt + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse) GetJSON200() *struct { + // Data Represent successfully deleted the existing endpoint jwt + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityReferrersResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the referrer + Id *string `json:"id,omitempty"` + + // Referrer The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted + Referrer *string `json:"referrer,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityReferrersResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the referrer + Id *string `json:"id,omitempty"` + + // Referrer The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted + Referrer *string `json:"referrer,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityReferrersResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityReferrersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityReferrersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityReferrersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Represent successfully deleted the existing endpoint referrer + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse) GetJSON200() *struct { + // Data Represent successfully deleted the existing endpoint referrer + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityRequestFiltersResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the created request filter details + Data *struct { + // Id The unique identifier (UUID) of the newly created request filter + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityRequestFiltersResponse) GetJSON200() *struct { + // Data Contains the created request filter details + Data *struct { + // Id The unique identifier (UUID) of the newly created request filter + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityRequestFiltersResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityRequestFiltersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityRequestFiltersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityRequestFiltersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// GetBody returns the raw response body bytes +func (r PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdSecurityTokensResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The generated token string used for authentication + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdSecurityTokensResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The generated token string used for authentication + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdSecurityTokensResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdSecurityTokensResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdSecurityTokensResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdSecurityTokensResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Represent successfully deleted the existing endpoint token + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse) GetJSON200() *struct { + // Data Represent successfully deleted the existing endpoint token + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdSecurityOptionsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdSecurityOptionsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdSecurityOptionsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdSecurityOptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdSecurityOptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdSecurityOptionsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdSecurityOptionsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdSecurityOptionsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdSecurityOptionsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdSecurityOptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdSecurityOptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdSecurityOptionsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0EndpointsByIdStatusResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The updated status of the endpoint (either 'active' or 'paused') + Data *string `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0EndpointsByIdStatusResponse) GetJSON200() *struct { + // Data The updated status of the endpoint (either 'active' or 'paused') + Data *string `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0EndpointsByIdStatusResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0EndpointsByIdStatusResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0EndpointsByIdStatusResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0EndpointsByIdStatusResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdTagsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdTagsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdTagsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdTagsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0EndpointsByIdTagsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array containing the newly created tag + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the newly created tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the newly created tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0EndpointsByIdTagsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array containing the newly created tag + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the newly created tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the newly created tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0EndpointsByIdTagsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0EndpointsByIdTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0EndpointsByIdTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0EndpointsByIdTagsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0EndpointsByIdTagsByTagIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains the result of the tag deletion + Data *struct { + // Success Whether the tag was successfully deleted from the endpoint + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0EndpointsByIdTagsByTagIdResponse) GetJSON200() *struct { + // Data Contains the result of the tag deletion + Data *struct { + // Success Whether the tag was successfully deleted from the endpoint + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0EndpointsByIdTagsByTagIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0EndpointsByIdTagsByTagIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0EndpointsByIdTagsByTagIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0EndpointsByIdTagsByTagIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0EndpointsByIdUrlsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // MultichainUrls Only present for multichain endpoints. An object keyed by network identifier (e.g. `avalanche-mainnet`), where each value contains the HTTP and WebSocket URLs for that network. + MultichainUrls *struct { + // Network Per-network URL entry. The key is the network identifier (e.g. `avalanche-mainnet`). + Network *struct { + // HttpUrl The HTTP URL to access the endpoint on this network + HttpUrl *string `json:"http_url,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint on this network + WssUrl *string `json:"wss_url,omitempty"` + } `json:"{network},omitempty"` + } `json:"multichain_urls,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0EndpointsByIdUrlsResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // MultichainUrls Only present for multichain endpoints. An object keyed by network identifier (e.g. `avalanche-mainnet`), where each value contains the HTTP and WebSocket URLs for that network. + MultichainUrls *struct { + // Network Per-network URL entry. The key is the network identifier (e.g. `avalanche-mainnet`). + Network *struct { + // HttpUrl The HTTP URL to access the endpoint on this network + HttpUrl *string `json:"http_url,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint on this network + WssUrl *string `json:"wss_url,omitempty"` + } `json:"{network},omitempty"` + } `json:"multichain_urls,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0EndpointsByIdUrlsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0EndpointsByIdUrlsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0EndpointsByIdUrlsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0EndpointsByIdUrlsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0MetricsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of metric objects, each containing a tag and its associated data points + Data *[]struct { + // Data An array of [timestamp, value] pairs representing the metric data points + Data *[]interface{} `json:"data,omitempty"` + + // Tag An array of strings identifying the metric group (e.g., network name) + Tag *[]interface{} `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0MetricsResponse) GetJSON200() *struct { + // Data An array of metric objects, each containing a tag and its associated data points + Data *[]struct { + // Data An array of [timestamp, value] pairs representing the metric data points + Data *[]interface{} `json:"data,omitempty"` + + // Tag An array of strings identifying the metric group (e.g., network name) + Tag *[]interface{} `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0MetricsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0MetricsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0MetricsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0MetricsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0TeamsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of team objects containing the following fields: + Data *[]struct { + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // Users An array of user objects in the team + Users *[]struct { + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0TeamsResponse) GetJSON200() *struct { + // Data An array of team objects containing the following fields: + Data *[]struct { + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // Users An array of user objects in the team + Users *[]struct { + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0TeamsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0TeamsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0TeamsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0TeamsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0TeamsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The created team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the created team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the created team + Name *string `json:"name,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0TeamsResponse) GetJSON200() *struct { + // Data The created team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the created team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the created team + Name *string `json:"name,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0TeamsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0TeamsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0TeamsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0TeamsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0TeamsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the team was deleted successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0TeamsByIdResponse) GetJSON200() *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the team was deleted successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0TeamsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0TeamsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0TeamsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0TeamsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0TeamsByIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // PendingInvites An array of pending invite objects + PendingInvites *[]struct { + // AccountPrimaryUser Indicates if the invited user will be the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the invite was created + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the pending invite + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the invited user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invite (e.g., Pending) + Status *string `json:"status,omitempty"` + } `json:"pending_invites,omitempty"` + + // Users An array of active user objects in the team + Users *[]struct { + // AccountPrimaryUser Indicates if the user is the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0TeamsByIdResponse) GetJSON200() *struct { + // Data The team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // PendingInvites An array of pending invite objects + PendingInvites *[]struct { + // AccountPrimaryUser Indicates if the invited user will be the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the invite was created + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the pending invite + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the invited user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invite (e.g., Pending) + Status *string `json:"status,omitempty"` + } `json:"pending_invites,omitempty"` + + // Users An array of active user objects in the team + Users *[]struct { + // AccountPrimaryUser Indicates if the user is the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0TeamsByIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0TeamsByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0TeamsByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0TeamsByIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0TeamsByIdEndpointsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An array of endpoint objects containing the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // Id A unique identifier for the endpoint + Id *int `json:"id,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Subdomain The subdomain name of the endpoint + Subdomain *string `json:"subdomain,omitempty"` + } `json:"data,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0TeamsByIdEndpointsResponse) GetJSON200() *struct { + // Data An array of endpoint objects containing the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // Id A unique identifier for the endpoint + Id *int `json:"id,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Subdomain The subdomain name of the endpoint + Subdomain *string `json:"subdomain,omitempty"` + } `json:"data,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0TeamsByIdEndpointsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0TeamsByIdEndpointsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0TeamsByIdEndpointsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0TeamsByIdEndpointsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0TeamsByIdEndpointsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The response object containing the following fields: + Data *struct { + // Success Indicates whether the operation was successful + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0TeamsByIdEndpointsResponse) GetJSON200() *struct { + // Data The response object containing the following fields: + Data *struct { + // Success Indicates whether the operation was successful + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0TeamsByIdEndpointsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0TeamsByIdEndpointsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0TeamsByIdEndpointsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0TeamsByIdEndpointsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0TeamsByIdMembersResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The invited user object containing the following fields: + Data *struct { + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the invited user + Id *int `json:"id,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invitation (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0TeamsByIdMembersResponse) GetJSON200() *struct { + // Data The invited user object containing the following fields: + Data *struct { + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the invited user + Id *int `json:"id,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invitation (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0TeamsByIdMembersResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0TeamsByIdMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0TeamsByIdMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0TeamsByIdMembersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteV0TeamsByIdMembersByUserIdResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the user was removed successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DeleteV0TeamsByIdMembersByUserIdResponse) GetJSON200() *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the user was removed successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DeleteV0TeamsByIdMembersByUserIdResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteV0TeamsByIdMembersByUserIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteV0TeamsByIdMembersByUserIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteV0TeamsByIdMembersByUserIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0TeamsByIdMembersByUserIdResendInviteResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the invitation was resent successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0TeamsByIdMembersByUserIdResendInviteResponse) GetJSON200() *struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the invitation was resent successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0TeamsByIdMembersByUserIdResendInviteResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0TeamsByIdMembersByUserIdResendInviteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0TeamsByIdMembersByUserIdResendInviteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0TeamsByIdMembersByUserIdResendInviteResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0ToolingAccessResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is currently enabled for the account + Enabled *bool `json:"enabled,omitempty"` + + // EnabledAt The timestamp when Tooling Access was enabled + EnabledAt *string `json:"enabled_at,omitempty"` + + // EndpointId The unique identifier of the endpoint provisioned for Tooling Access + EndpointId *int `json:"endpoint_id,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access. May be present even when disabled if the account was previously provisioned + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0ToolingAccessResponse) GetJSON200() *struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is currently enabled for the account + Enabled *bool `json:"enabled,omitempty"` + + // EnabledAt The timestamp when Tooling Access was enabled + EnabledAt *string `json:"enabled_at,omitempty"` + + // EndpointId The unique identifier of the endpoint provisioned for Tooling Access + EndpointId *int `json:"endpoint_id,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access. May be present even when disabled if the account was previously provisioned + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0ToolingAccessResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0ToolingAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0ToolingAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0ToolingAccessResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PatchV0ToolingAccessResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is enabled after the update + Enabled *bool `json:"enabled,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PatchV0ToolingAccessResponse) GetJSON200() *struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is enabled after the update + Enabled *bool `json:"enabled,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PatchV0ToolingAccessResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PatchV0ToolingAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchV0ToolingAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchV0ToolingAccessResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PostV0ToolingAccessTokenResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data An object which contains the following fields: + Data *struct { + // EndpointUrl The URL of the Tooling Access endpoint the token authenticates against + EndpointUrl *string `json:"endpoint_url,omitempty"` + + // ExpiresAt The timestamp when the token expires + ExpiresAt *string `json:"expires_at,omitempty"` + + // Token The short-lived ES256 JWT used to authenticate RPC calls + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PostV0ToolingAccessTokenResponse) GetJSON200() *struct { + // Data An object which contains the following fields: + Data *struct { + // EndpointUrl The URL of the Tooling Access endpoint the token authenticates against + EndpointUrl *string `json:"endpoint_url,omitempty"` + + // ExpiresAt The timestamp when the token expires + ExpiresAt *string `json:"expires_at,omitempty"` + + // Token The short-lived ES256 JWT used to authenticate RPC calls + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r PostV0ToolingAccessTokenResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PostV0ToolingAccessTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV0ToolingAccessTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostV0ToolingAccessTokenResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0UsageRpcResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // CreditsRemaining The number of credits remaining in the account + CreditsRemaining *int `json:"credits_remaining,omitempty"` + + // CreditsUsed The number of credits used within the specified time period + CreditsUsed *int `json:"credits_used,omitempty"` + + // EndTime The end timestamp for the usage data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Limit The maximum number of credits available + Limit *int `json:"limit,omitempty"` + + // Overages The number of credits used beyond the limit + Overages *int `json:"overages,omitempty"` + + // StartTime The start timestamp for the usage data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message, if any issues occur during the request + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0UsageRpcResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // CreditsRemaining The number of credits remaining in the account + CreditsRemaining *int `json:"credits_remaining,omitempty"` + + // CreditsUsed The number of credits used within the specified time period + CreditsUsed *int `json:"credits_used,omitempty"` + + // EndTime The end timestamp for the usage data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Limit The maximum number of credits available + Limit *int `json:"limit,omitempty"` + + // Overages The number of credits used beyond the limit + Overages *int `json:"overages,omitempty"` + + // StartTime The start timestamp for the usage data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message, if any issues occur during the request + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0UsageRpcResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0UsageRpcResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0UsageRpcResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0UsageRpcResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0UsageRpcByChainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chains An array of blockchains and their corresponding credit usage + Chains *[]struct { + // Bytes The total number of data bytes transferred on the specified blockchain (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the specified blockchain (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Name The name of the blockchain + Name *string `json:"name,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + } `json:"chains,omitempty"` + + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0UsageRpcByChainResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // Chains An array of blockchains and their corresponding credit usage + Chains *[]struct { + // Bytes The total number of data bytes transferred on the specified blockchain (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the specified blockchain (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Name The name of the blockchain + Name *string `json:"name,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + } `json:"chains,omitempty"` + + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0UsageRpcByChainResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0UsageRpcByChainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0UsageRpcByChainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0UsageRpcByChainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0UsageRpcByEndpointResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Endpoints An array of endpoints which contains the following fields: + Endpoints *[]struct { + // Bytes The total number of data bytes transferred by the endpoint (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // Chain The blockchain associated with the endpoint + Chain *string `json:"chain,omitempty"` + + // CreditsUsed The total number of credits used by the endpoint (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label A custom label for the endpoint + Label *string `json:"label,omitempty"` + + // MethodsBreakdown An array of methods_breakdown + MethodsBreakdown *[]struct { + // Archive Indicates whether the request is using archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods_breakdown,omitempty"` + + // Name The name of the endpoint + Name *string `json:"name,omitempty"` + + // Network The specific network on the blockchain + Network *string `json:"network,omitempty"` + + // Requests The total number of requests made to the endpoint + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // Status The current state of the RPC endpoint. Possible values include: active, archived, paused or terminated + Status *string `json:"status,omitempty"` + } `json:"endpoints,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0UsageRpcByEndpointResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Endpoints An array of endpoints which contains the following fields: + Endpoints *[]struct { + // Bytes The total number of data bytes transferred by the endpoint (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // Chain The blockchain associated with the endpoint + Chain *string `json:"chain,omitempty"` + + // CreditsUsed The total number of credits used by the endpoint (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label A custom label for the endpoint + Label *string `json:"label,omitempty"` + + // MethodsBreakdown An array of methods_breakdown + MethodsBreakdown *[]struct { + // Archive Indicates whether the request is using archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods_breakdown,omitempty"` + + // Name The name of the endpoint + Name *string `json:"name,omitempty"` + + // Network The specific network on the blockchain + Network *string `json:"network,omitempty"` + + // Requests The total number of requests made to the endpoint + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // Status The current state of the RPC endpoint. Possible values include: active, archived, paused or terminated + Status *string `json:"status,omitempty"` + } `json:"endpoints,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0UsageRpcByEndpointResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0UsageRpcByEndpointResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0UsageRpcByEndpointResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0UsageRpcByEndpointResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0UsageRpcByMethodResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second + EndTime *int `json:"end_time,omitempty"` + + // Methods An array of method calls and their corresponding credit usage + Methods *[]struct { + // Archive Indicates whether the request used archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods,omitempty"` + + // StartTime The start timestamp for the data in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0UsageRpcByMethodResponse) GetJSON200() *struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second + EndTime *int `json:"end_time,omitempty"` + + // Methods An array of method calls and their corresponding credit usage + Methods *[]struct { + // Archive Indicates whether the request used archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods,omitempty"` + + // StartTime The start timestamp for the data in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0UsageRpcByMethodResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0UsageRpcByMethodResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0UsageRpcByMethodResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0UsageRpcByMethodResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetV0UsageRpcByTagResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + // Data Contains usage data grouped by tag + Data *struct { + // EndTime The end time of the usage period as a unix timestamp + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start time of the usage period as a unix timestamp + StartTime *int `json:"start_time,omitempty"` + + // Tags An array of usage data objects, one per tag + Tags *[]struct { + // Bytes The total number of data bytes transferred by endpoints with this tag (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The total number of credits used by endpoints with this tag (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // Requests The total number of requests made by endpoints with this tag + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetV0UsageRpcByTagResponse) GetJSON200() *struct { + // Data Contains usage data grouped by tag + Data *struct { + // EndTime The end time of the usage period as a unix timestamp + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start time of the usage period as a unix timestamp + StartTime *int `json:"start_time,omitempty"` + + // Tags An array of usage data objects, one per tag + Tags *[]struct { + // Bytes The total number of data bytes transferred by endpoints with this tag (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The total number of credits used by endpoints with this tag (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // Requests The total number of requests made by endpoints with this tag + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` +} { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GetV0UsageRpcByTagResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetV0UsageRpcByTagResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV0UsageRpcByTagResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetV0UsageRpcByTagResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// GetV0AccountInfoWithResponse Returns information about the account associated with the API key. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/account/info (the `GetV0AccountInfo` operationId). +func (c *ClientWithResponses) GetV0AccountInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0AccountInfoResponse, error) { + rsp, err := c.GetV0AccountInfo(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0AccountInfoResponse(rsp) +} + +// GetV0ApiCreditsByChainWithResponse Returns the API credit cost of each RPC method available on a chain. +// +// Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/api-credits/{chain} (the `GetV0ApiCreditsByChain` operationId). +func (c *ClientWithResponses) GetV0ApiCreditsByChainWithResponse(ctx context.Context, chain string, reqEditors ...RequestEditorFn) (*GetV0ApiCreditsByChainResponse, error) { + rsp, err := c.GetV0ApiCreditsByChain(ctx, chain, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0ApiCreditsByChainResponse(rsp) +} + +// GetV0BillingInvoicesWithResponse Returns a list of invoices +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/billing/invoices (the `GetV0BillingInvoices` operationId). +func (c *ClientWithResponses) GetV0BillingInvoicesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0BillingInvoicesResponse, error) { + rsp, err := c.GetV0BillingInvoices(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0BillingInvoicesResponse(rsp) +} + +// GetV0BillingPaymentsWithResponse Returns a list of payments. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/billing/payments (the `GetV0BillingPayments` operationId). +func (c *ClientWithResponses) GetV0BillingPaymentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0BillingPaymentsResponse, error) { + rsp, err := c.GetV0BillingPayments(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0BillingPaymentsResponse(rsp) +} + +// GetV0ChainsWithResponse Returns a list of chains. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/chains (the `GetV0Chains` operationId). +func (c *ClientWithResponses) GetV0ChainsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0ChainsResponse, error) { + rsp, err := c.GetV0Chains(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0ChainsResponse(rsp) +} + +// GetV0EndpointsWithResponse Retrieves a list of endpoints. +// +// Retrieves a list of endpoints. Supports searching, filtering, and sorting. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints (the `GetV0Endpoints` operationId). +func (c *ClientWithResponses) GetV0EndpointsWithResponse(ctx context.Context, params *GetV0EndpointsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsResponse, error) { + rsp, err := c.GetV0Endpoints(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsResponse(rsp) +} + +// PostV0EndpointsWithBodyWithResponse Creates a new endpoint. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). +func (c *ClientWithResponses) PostV0EndpointsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsResponse, error) { + rsp, err := c.PostV0EndpointsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsResponse(rsp) +} + +// PostV0EndpointsWithResponse Creates a new endpoint. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints (the `PostV0Endpoints` operationId). +func (c *ClientWithResponses) PostV0EndpointsWithResponse(ctx context.Context, body PostV0EndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsResponse, error) { + rsp, err := c.PostV0Endpoints(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsResponse(rsp) +} + +// PostV0EndpointsBulkStatusWithBodyWithResponse Pause or unpause multiple endpoints in a single call. +// +// Pause or unpause multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). +func (c *ClientWithResponses) PostV0EndpointsBulkStatusWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkStatusResponse, error) { + rsp, err := c.PostV0EndpointsBulkStatusWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsBulkStatusResponse(rsp) +} + +// PostV0EndpointsBulkStatusWithResponse Pause or unpause multiple endpoints in a single call. +// +// Pause or unpause multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/bulk/status (the `PostV0EndpointsBulkStatus` operationId). +func (c *ClientWithResponses) PostV0EndpointsBulkStatusWithResponse(ctx context.Context, body PostV0EndpointsBulkStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkStatusResponse, error) { + rsp, err := c.PostV0EndpointsBulkStatus(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsBulkStatusResponse(rsp) +} + +// DeleteV0EndpointsBulkTagsWithBodyWithResponse Remove a tag from multiple endpoints in a single call. +// +// Remove a tag from multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsBulkTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsBulkTagsResponse, error) { + rsp, err := c.DeleteV0EndpointsBulkTagsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsBulkTagsResponse(rsp) +} + +// DeleteV0EndpointsBulkTagsWithResponse Remove a tag from multiple endpoints in a single call. +// +// Remove a tag from multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/bulk/tags (the `DeleteV0EndpointsBulkTags` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsBulkTagsWithResponse(ctx context.Context, body DeleteV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsBulkTagsResponse, error) { + rsp, err := c.DeleteV0EndpointsBulkTags(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsBulkTagsResponse(rsp) +} + +// PostV0EndpointsBulkTagsWithBodyWithResponse Add a tag to multiple endpoints in a single call. +// +// Add a tag to multiple endpoints in a single call. Admin-only. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). +func (c *ClientWithResponses) PostV0EndpointsBulkTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkTagsResponse, error) { + rsp, err := c.PostV0EndpointsBulkTagsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsBulkTagsResponse(rsp) +} + +// PostV0EndpointsBulkTagsWithResponse Add a tag to multiple endpoints in a single call. +// +// Add a tag to multiple endpoints in a single call. Admin-only. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/bulk/tags (the `PostV0EndpointsBulkTags` operationId). +func (c *ClientWithResponses) PostV0EndpointsBulkTagsWithResponse(ctx context.Context, body PostV0EndpointsBulkTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsBulkTagsResponse, error) { + rsp, err := c.PostV0EndpointsBulkTags(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsBulkTagsResponse(rsp) +} + +// GetV0EndpointsTagsWithResponse Returns all account-level tags including those with zero endpoints. +// +// Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/tags (the `GetV0EndpointsTags` operationId). +func (c *ClientWithResponses) GetV0EndpointsTagsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0EndpointsTagsResponse, error) { + rsp, err := c.GetV0EndpointsTags(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsTagsResponse(rsp) +} + +// DeleteV0EndpointsTagsByIdWithResponse Deletes an account tag. +// +// Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/tags/{id} (the `DeleteV0EndpointsTagsById` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsTagsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsTagsByIdResponse, error) { + rsp, err := c.DeleteV0EndpointsTagsById(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsTagsByIdResponse(rsp) +} + +// PatchV0EndpointsTagsByIdWithBodyWithResponse Renames an account tag. +// +// Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). +func (c *ClientWithResponses) PatchV0EndpointsTagsByIdWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsTagsByIdResponse, error) { + rsp, err := c.PatchV0EndpointsTagsByIdWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsTagsByIdResponse(rsp) +} + +// PatchV0EndpointsTagsByIdWithResponse Renames an account tag. +// +// Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/tags/{id} (the `PatchV0EndpointsTagsById` operationId). +func (c *ClientWithResponses) PatchV0EndpointsTagsByIdWithResponse(ctx context.Context, id int, body PatchV0EndpointsTagsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsTagsByIdResponse, error) { + rsp, err := c.PatchV0EndpointsTagsById(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsTagsByIdResponse(rsp) +} + +// DeleteV0EndpointsByIdWithResponse Deletes an endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id} (the `DeleteV0EndpointsById` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdResponse, error) { + rsp, err := c.DeleteV0EndpointsById(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdResponse(rsp) +} + +// GetV0EndpointsByIdWithResponse Returns info for a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id} (the `GetV0EndpointsById` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdResponse, error) { + rsp, err := c.GetV0EndpointsById(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdResponse(rsp) +} + +// PatchV0EndpointsByIdWithBodyWithResponse Updates an endpoint. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdResponse, error) { + rsp, err := c.PatchV0EndpointsByIdWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdResponse(rsp) +} + +// PatchV0EndpointsByIdWithResponse Updates an endpoint. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id} (the `PatchV0EndpointsById` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdResponse, error) { + rsp, err := c.PatchV0EndpointsById(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdResponse(rsp) +} + +// PostV0EndpointsByIdDisableMultichainWithResponse Disables multichain for a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/disable_multichain (the `PostV0EndpointsByIdDisableMultichain` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdDisableMultichainWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdDisableMultichainResponse, error) { + rsp, err := c.PostV0EndpointsByIdDisableMultichain(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdDisableMultichainResponse(rsp) +} + +// PostV0EndpointsByIdEnableMultichainWithResponse Enables multichain for a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/enable_multichain (the `PostV0EndpointsByIdEnableMultichain` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdEnableMultichainWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdEnableMultichainResponse, error) { + rsp, err := c.PostV0EndpointsByIdEnableMultichain(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdEnableMultichainResponse(rsp) +} + +// DeleteV0EndpointsByIdIpCustomHeaderWithResponse Deletes the IP custom header for a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/ip_custom_header (the `DeleteV0EndpointsByIdIpCustomHeader` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdIpCustomHeaderWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdIpCustomHeaderResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdIpCustomHeader(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdIpCustomHeaderResponse(rsp) +} + +// PatchV0EndpointsByIdIpCustomHeaderWithBodyWithResponse Creates or updates an IP custom header for a specific endpoint. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdIpCustomHeaderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdIpCustomHeaderResponse, error) { + rsp, err := c.PatchV0EndpointsByIdIpCustomHeaderWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdIpCustomHeaderResponse(rsp) +} + +// PatchV0EndpointsByIdIpCustomHeaderWithResponse Creates or updates an IP custom header for a specific endpoint. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/ip_custom_header (the `PatchV0EndpointsByIdIpCustomHeader` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdIpCustomHeaderWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdIpCustomHeaderJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdIpCustomHeaderResponse, error) { + rsp, err := c.PatchV0EndpointsByIdIpCustomHeader(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdIpCustomHeaderResponse(rsp) +} + +// GetV0EndpointsByIdLogDetailsWithResponse Retrieves detailed request and response information for a specific log entry. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/log_details (the `GetV0EndpointsByIdLogDetails` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdLogDetailsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdLogDetailsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdLogDetailsResponse, error) { + rsp, err := c.GetV0EndpointsByIdLogDetails(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdLogDetailsResponse(rsp) +} + +// GetV0EndpointsByIdLogsWithResponse Retrieves logs for a specific endpoint with filtering and pagination options. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/logs (the `GetV0EndpointsByIdLogs` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdLogsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdLogsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdLogsResponse, error) { + rsp, err := c.GetV0EndpointsByIdLogs(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdLogsResponse(rsp) +} + +// GetV0EndpointsByIdMethodRateLimitsWithResponse Gets method rate limits. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/method-rate-limits (the `GetV0EndpointsByIdMethodRateLimits` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdMethodRateLimitsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdMethodRateLimitsResponse, error) { + rsp, err := c.GetV0EndpointsByIdMethodRateLimits(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdMethodRateLimitsResponse(rsp) +} + +// PostV0EndpointsByIdMethodRateLimitsWithBodyWithResponse Creates a method rate limit. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdMethodRateLimitsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdMethodRateLimitsResponse, error) { + rsp, err := c.PostV0EndpointsByIdMethodRateLimitsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdMethodRateLimitsResponse(rsp) +} + +// PostV0EndpointsByIdMethodRateLimitsWithResponse Creates a method rate limit. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/method-rate-limits (the `PostV0EndpointsByIdMethodRateLimits` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdMethodRateLimitsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdMethodRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdMethodRateLimitsResponse, error) { + rsp, err := c.PostV0EndpointsByIdMethodRateLimits(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdMethodRateLimitsResponse(rsp) +} + +// DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse Deletes a method rate limit. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse(ctx context.Context, id string, methodRateLimitId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx, id, methodRateLimitId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse(rsp) +} + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBodyWithResponse Updates a method rate limit. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBodyWithResponse(ctx context.Context, id string, methodRateLimitId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) { + rsp, err := c.PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithBody(ctx, id, methodRateLimitId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse(rsp) +} + +// PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse Updates a method rate limit. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id} (the `PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse(ctx context.Context, id string, methodRateLimitId string, body PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) { + rsp, err := c.PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitId(ctx, id, methodRateLimitId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse(rsp) +} + +// GetV0EndpointsByIdMetricsWithResponse Returns a single metric. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/metrics (the `GetV0EndpointsByIdMetrics` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdMetricsWithResponse(ctx context.Context, id string, params *GetV0EndpointsByIdMetricsParams, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdMetricsResponse, error) { + rsp, err := c.GetV0EndpointsByIdMetrics(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdMetricsResponse(rsp) +} + +// GetV0EndpointsByIdRateLimitsWithResponse Gets endpoint rate limits. +// +// Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/rate-limits (the `GetV0EndpointsByIdRateLimits` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdRateLimitsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdRateLimitsResponse, error) { + rsp, err := c.GetV0EndpointsByIdRateLimits(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdRateLimitsResponse(rsp) +} + +// PatchV0EndpointsByIdRateLimitsWithBodyWithResponse Updates endpoint rate limits. +// +// Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdRateLimitsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdRateLimitsResponse, error) { + rsp, err := c.PatchV0EndpointsByIdRateLimitsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdRateLimitsResponse(rsp) +} + +// PatchV0EndpointsByIdRateLimitsWithResponse Updates endpoint rate limits. +// +// Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/rate-limits (the `PatchV0EndpointsByIdRateLimits` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdRateLimitsWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdRateLimitsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdRateLimitsResponse, error) { + rsp, err := c.PatchV0EndpointsByIdRateLimits(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdRateLimitsResponse(rsp) +} + +// DeleteV0EndpointsByIdRateLimitsByOverrideIdWithResponse Deletes a user-set endpoint rate limit by UUID. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/rate-limits/{override_id} (the `DeleteV0EndpointsByIdRateLimitsByOverrideId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdRateLimitsByOverrideIdWithResponse(ctx context.Context, id string, overrideId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdRateLimitsByOverrideId(ctx, id, overrideId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdRateLimitsByOverrideIdResponse(rsp) +} + +// GetV0EndpointsByIdSecurityWithResponse Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the +// +// Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/security (the `GetV0EndpointsByIdSecurity` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdSecurityWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdSecurityResponse, error) { + rsp, err := c.GetV0EndpointsByIdSecurity(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdSecurityResponse(rsp) +} + +// PostV0EndpointsByIdSecurityDomainMasksWithBodyWithResponse Create an endpoint domain mask. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityDomainMasksWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityDomainMasksResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityDomainMasksWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityDomainMasksResponse(rsp) +} + +// PostV0EndpointsByIdSecurityDomainMasksWithResponse Create an endpoint domain mask. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/domain_masks (the `PostV0EndpointsByIdSecurityDomainMasks` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityDomainMasksWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityDomainMasksJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityDomainMasksResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityDomainMasks(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityDomainMasksResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdWithResponse Deletes an existing endpoint domain mask. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/domain_masks/{domain_mask_id} (the `DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdWithResponse(ctx context.Context, id string, domainMaskId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskId(ctx, id, domainMaskId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse(rsp) +} + +// PostV0EndpointsByIdSecurityIpsWithBodyWithResponse Creates a new endpoint IP. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityIpsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityIpsResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityIpsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityIpsResponse(rsp) +} + +// PostV0EndpointsByIdSecurityIpsWithResponse Creates a new endpoint IP. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/ips (the `PostV0EndpointsByIdSecurityIps` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityIpsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityIpsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityIpsResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityIps(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityIpsResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityIpsByIpIdWithResponse Deletes an existing endpoint IP. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/ips/{ip_id} (the `DeleteV0EndpointsByIdSecurityIpsByIpId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityIpsByIpIdWithResponse(ctx context.Context, id string, ipId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityIpsByIpIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityIpsByIpId(ctx, id, ipId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityIpsByIpIdResponse(rsp) +} + +// PostV0EndpointsByIdSecurityJwtsWithBodyWithResponse Creates a new endpoint JWT. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityJwtsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityJwtsResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityJwtsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityJwtsResponse(rsp) +} + +// PostV0EndpointsByIdSecurityJwtsWithResponse Creates a new endpoint JWT. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/jwts (the `PostV0EndpointsByIdSecurityJwts` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityJwtsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityJwtsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityJwtsResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityJwts(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityJwtsResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityJwtsByJwtIdWithResponse Deletes an existing endpoint JWT. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/jwts/{jwt_id} (the `DeleteV0EndpointsByIdSecurityJwtsByJwtId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityJwtsByJwtIdWithResponse(ctx context.Context, id string, jwtId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityJwtsByJwtId(ctx, id, jwtId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse(rsp) +} + +// PostV0EndpointsByIdSecurityReferrersWithBodyWithResponse Creates a new endpoint referrer. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityReferrersWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityReferrersResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityReferrersWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityReferrersResponse(rsp) +} + +// PostV0EndpointsByIdSecurityReferrersWithResponse Creates a new endpoint referrer. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/referrers (the `PostV0EndpointsByIdSecurityReferrers` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityReferrersWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityReferrersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityReferrersResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityReferrers(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityReferrersResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityReferrersByReferrerIdWithResponse Deletes an existing endpoint referrer. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/referrers/{referrer_id} (the `DeleteV0EndpointsByIdSecurityReferrersByReferrerId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityReferrersByReferrerIdWithResponse(ctx context.Context, id string, referrerId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityReferrersByReferrerId(ctx, id, referrerId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse(rsp) +} + +// PostV0EndpointsByIdSecurityRequestFiltersWithBodyWithResponse Creates a new endpoint request filter for method whitelisting. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityRequestFiltersWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityRequestFiltersResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityRequestFiltersWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityRequestFiltersResponse(rsp) +} + +// PostV0EndpointsByIdSecurityRequestFiltersWithResponse Creates a new endpoint request filter for method whitelisting. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/request_filters (the `PostV0EndpointsByIdSecurityRequestFilters` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityRequestFiltersWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdSecurityRequestFiltersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityRequestFiltersResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityRequestFilters(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityRequestFiltersResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse Deletes an existing endpoint request filter. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse(ctx context.Context, id string, requestFilterId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx, id, requestFilterId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse(rsp) +} + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBodyWithResponse Updates an existing endpoint request filter. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *ClientWithResponses) PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBodyWithResponse(ctx context.Context, id string, requestFilterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) { + rsp, err := c.PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithBody(ctx, id, requestFilterId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse(rsp) +} + +// PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse Updates an existing endpoint request filter. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v0/endpoints/{id}/security/request_filters/{request_filter_id} (the `PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId` operationId). +func (c *ClientWithResponses) PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse(ctx context.Context, id string, requestFilterId string, body PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) { + rsp, err := c.PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterId(ctx, id, requestFilterId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse(rsp) +} + +// PostV0EndpointsByIdSecurityTokensWithResponse Creates a new endpoint authentication token. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/security/tokens (the `PostV0EndpointsByIdSecurityTokens` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdSecurityTokensWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdSecurityTokensResponse, error) { + rsp, err := c.PostV0EndpointsByIdSecurityTokens(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdSecurityTokensResponse(rsp) +} + +// DeleteV0EndpointsByIdSecurityTokensByTokenIdWithResponse Deletes an existing endpoint token. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/security/tokens/{token_id} (the `DeleteV0EndpointsByIdSecurityTokensByTokenId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdSecurityTokensByTokenIdWithResponse(ctx context.Context, id string, tokenId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdSecurityTokensByTokenId(ctx, id, tokenId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdSecurityTokensByTokenIdResponse(rsp) +} + +// GetV0EndpointsByIdSecurityOptionsWithResponse Gets security options for an endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/security_options (the `GetV0EndpointsByIdSecurityOptions` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdSecurityOptionsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdSecurityOptionsResponse, error) { + rsp, err := c.GetV0EndpointsByIdSecurityOptions(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdSecurityOptionsResponse(rsp) +} + +// PatchV0EndpointsByIdSecurityOptionsWithBodyWithResponse Updates security options for an endpoint. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdSecurityOptionsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdSecurityOptionsResponse, error) { + rsp, err := c.PatchV0EndpointsByIdSecurityOptionsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdSecurityOptionsResponse(rsp) +} + +// PatchV0EndpointsByIdSecurityOptionsWithResponse Updates security options for an endpoint. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/security_options (the `PatchV0EndpointsByIdSecurityOptions` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdSecurityOptionsWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdSecurityOptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdSecurityOptionsResponse, error) { + rsp, err := c.PatchV0EndpointsByIdSecurityOptions(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdSecurityOptionsResponse(rsp) +} + +// PatchV0EndpointsByIdStatusWithBodyWithResponse Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdStatusWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdStatusResponse, error) { + rsp, err := c.PatchV0EndpointsByIdStatusWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdStatusResponse(rsp) +} + +// PatchV0EndpointsByIdStatusWithResponse Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused' +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/endpoints/{id}/status (the `PatchV0EndpointsByIdStatus` operationId). +func (c *ClientWithResponses) PatchV0EndpointsByIdStatusWithResponse(ctx context.Context, id string, body PatchV0EndpointsByIdStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0EndpointsByIdStatusResponse, error) { + rsp, err := c.PatchV0EndpointsByIdStatus(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0EndpointsByIdStatusResponse(rsp) +} + +// GetV0EndpointsByIdTagsWithResponse Returns all tags for a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/tags (the `GetV0EndpointsByIdTags` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdTagsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdTagsResponse, error) { + rsp, err := c.GetV0EndpointsByIdTags(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdTagsResponse(rsp) +} + +// PostV0EndpointsByIdTagsWithBodyWithResponse Creates a new tag for a specific endpoint. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdTagsWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdTagsResponse, error) { + rsp, err := c.PostV0EndpointsByIdTagsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdTagsResponse(rsp) +} + +// PostV0EndpointsByIdTagsWithResponse Creates a new tag for a specific endpoint. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/endpoints/{id}/tags (the `PostV0EndpointsByIdTags` operationId). +func (c *ClientWithResponses) PostV0EndpointsByIdTagsWithResponse(ctx context.Context, id string, body PostV0EndpointsByIdTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0EndpointsByIdTagsResponse, error) { + rsp, err := c.PostV0EndpointsByIdTags(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0EndpointsByIdTagsResponse(rsp) +} + +// DeleteV0EndpointsByIdTagsByTagIdWithResponse Deletes a tag from a specific endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/endpoints/{id}/tags/{tag_id} (the `DeleteV0EndpointsByIdTagsByTagId` operationId). +func (c *ClientWithResponses) DeleteV0EndpointsByIdTagsByTagIdWithResponse(ctx context.Context, id string, tagId string, reqEditors ...RequestEditorFn) (*DeleteV0EndpointsByIdTagsByTagIdResponse, error) { + rsp, err := c.DeleteV0EndpointsByIdTagsByTagId(ctx, id, tagId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0EndpointsByIdTagsByTagIdResponse(rsp) +} + +// GetV0EndpointsByIdUrlsWithResponse Returns the URLs for a specific endpoint. +// +// Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/endpoints/{id}/urls (the `GetV0EndpointsByIdUrls` operationId). +func (c *ClientWithResponses) GetV0EndpointsByIdUrlsWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetV0EndpointsByIdUrlsResponse, error) { + rsp, err := c.GetV0EndpointsByIdUrls(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0EndpointsByIdUrlsResponse(rsp) +} + +// GetV0MetricsWithResponse Fetches metrics aggregated across all endpoints for an account. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/metrics (the `GetV0Metrics` operationId). +func (c *ClientWithResponses) GetV0MetricsWithResponse(ctx context.Context, params *GetV0MetricsParams, reqEditors ...RequestEditorFn) (*GetV0MetricsResponse, error) { + rsp, err := c.GetV0Metrics(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0MetricsResponse(rsp) +} + +// GetV0TeamsWithResponse Retrieves a list of all teams. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/teams (the `GetV0Teams` operationId). +func (c *ClientWithResponses) GetV0TeamsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0TeamsResponse, error) { + rsp, err := c.GetV0Teams(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0TeamsResponse(rsp) +} + +// PostV0TeamsWithBodyWithResponse Creates a new team. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/teams (the `PostV0Teams` operationId). +func (c *ClientWithResponses) PostV0TeamsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0TeamsResponse, error) { + rsp, err := c.PostV0TeamsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0TeamsResponse(rsp) +} + +// PostV0TeamsWithResponse Creates a new team. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/teams (the `PostV0Teams` operationId). +func (c *ClientWithResponses) PostV0TeamsWithResponse(ctx context.Context, body PostV0TeamsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0TeamsResponse, error) { + rsp, err := c.PostV0Teams(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0TeamsResponse(rsp) +} + +// DeleteV0TeamsByIdWithResponse Deletes an empty team. +// +// Deletes an empty team. The team must have no members before it can be deleted. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/teams/{id} (the `DeleteV0TeamsById` operationId). +func (c *ClientWithResponses) DeleteV0TeamsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteV0TeamsByIdResponse, error) { + rsp, err := c.DeleteV0TeamsById(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0TeamsByIdResponse(rsp) +} + +// GetV0TeamsByIdWithResponse Retrieves details for a specific team. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/teams/{id} (the `GetV0TeamsById` operationId). +func (c *ClientWithResponses) GetV0TeamsByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetV0TeamsByIdResponse, error) { + rsp, err := c.GetV0TeamsById(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0TeamsByIdResponse(rsp) +} + +// GetV0TeamsByIdEndpointsWithResponse Retrieves a list of endpoints accessible to a team. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/teams/{id}/endpoints (the `GetV0TeamsByIdEndpoints` operationId). +func (c *ClientWithResponses) GetV0TeamsByIdEndpointsWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetV0TeamsByIdEndpointsResponse, error) { + rsp, err := c.GetV0TeamsByIdEndpoints(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0TeamsByIdEndpointsResponse(rsp) +} + +// PatchV0TeamsByIdEndpointsWithBodyWithResponse Assigns or unassigns endpoints to a team. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). +func (c *ClientWithResponses) PatchV0TeamsByIdEndpointsWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0TeamsByIdEndpointsResponse, error) { + rsp, err := c.PatchV0TeamsByIdEndpointsWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0TeamsByIdEndpointsResponse(rsp) +} + +// PatchV0TeamsByIdEndpointsWithResponse Assigns or unassigns endpoints to a team. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/teams/{id}/endpoints (the `PatchV0TeamsByIdEndpoints` operationId). +func (c *ClientWithResponses) PatchV0TeamsByIdEndpointsWithResponse(ctx context.Context, id int, body PatchV0TeamsByIdEndpointsJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0TeamsByIdEndpointsResponse, error) { + rsp, err := c.PatchV0TeamsByIdEndpoints(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0TeamsByIdEndpointsResponse(rsp) +} + +// PostV0TeamsByIdMembersWithBodyWithResponse Invites a user to a team. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). +func (c *ClientWithResponses) PostV0TeamsByIdMembersWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersResponse, error) { + rsp, err := c.PostV0TeamsByIdMembersWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0TeamsByIdMembersResponse(rsp) +} + +// PostV0TeamsByIdMembersWithResponse Invites a user to a team. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/teams/{id}/members (the `PostV0TeamsByIdMembers` operationId). +func (c *ClientWithResponses) PostV0TeamsByIdMembersWithResponse(ctx context.Context, id int, body PostV0TeamsByIdMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersResponse, error) { + rsp, err := c.PostV0TeamsByIdMembers(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0TeamsByIdMembersResponse(rsp) +} + +// DeleteV0TeamsByIdMembersByUserIdWithResponse Removes a user from a team. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v0/teams/{id}/members/{user_id} (the `DeleteV0TeamsByIdMembersByUserId` operationId). +func (c *ClientWithResponses) DeleteV0TeamsByIdMembersByUserIdWithResponse(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*DeleteV0TeamsByIdMembersByUserIdResponse, error) { + rsp, err := c.DeleteV0TeamsByIdMembersByUserId(ctx, id, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteV0TeamsByIdMembersByUserIdResponse(rsp) +} + +// PostV0TeamsByIdMembersByUserIdResendInviteWithResponse Resends an invitation email to a pending team member. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/teams/{id}/members/{user_id}/resend_invite (the `PostV0TeamsByIdMembersByUserIdResendInvite` operationId). +func (c *ClientWithResponses) PostV0TeamsByIdMembersByUserIdResendInviteWithResponse(ctx context.Context, id int, userId int, reqEditors ...RequestEditorFn) (*PostV0TeamsByIdMembersByUserIdResendInviteResponse, error) { + rsp, err := c.PostV0TeamsByIdMembersByUserIdResendInvite(ctx, id, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0TeamsByIdMembersByUserIdResendInviteResponse(rsp) +} + +// GetV0ToolingAccessWithResponse Returns whether Tooling Access is enabled for the account. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/tooling-access (the `GetV0ToolingAccess` operationId). +func (c *ClientWithResponses) GetV0ToolingAccessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV0ToolingAccessResponse, error) { + rsp, err := c.GetV0ToolingAccess(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0ToolingAccessResponse(rsp) +} + +// PatchV0ToolingAccessWithBodyWithResponse Enable (provision/reactivate) or disable Tooling Access for the account. +// +// Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). +func (c *ClientWithResponses) PatchV0ToolingAccessWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchV0ToolingAccessResponse, error) { + rsp, err := c.PatchV0ToolingAccessWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0ToolingAccessResponse(rsp) +} + +// PatchV0ToolingAccessWithResponse Enable (provision/reactivate) or disable Tooling Access for the account. +// +// Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v0/tooling-access (the `PatchV0ToolingAccess` operationId). +func (c *ClientWithResponses) PatchV0ToolingAccessWithResponse(ctx context.Context, body PatchV0ToolingAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchV0ToolingAccessResponse, error) { + rsp, err := c.PatchV0ToolingAccess(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchV0ToolingAccessResponse(rsp) +} + +// PostV0ToolingAccessTokenWithResponse Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. +// +// Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v0/tooling-access/token (the `PostV0ToolingAccessToken` operationId). +func (c *ClientWithResponses) PostV0ToolingAccessTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostV0ToolingAccessTokenResponse, error) { + rsp, err := c.PostV0ToolingAccessToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV0ToolingAccessTokenResponse(rsp) +} + +// GetV0UsageRpcWithResponse Retrieves usage total for specified time range. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/usage/rpc (the `GetV0UsageRpc` operationId). +func (c *ClientWithResponses) GetV0UsageRpcWithResponse(ctx context.Context, params *GetV0UsageRpcParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcResponse, error) { + rsp, err := c.GetV0UsageRpc(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0UsageRpcResponse(rsp) +} + +// GetV0UsageRpcByChainWithResponse Retrieves usage data by chain. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/usage/rpc/by-chain (the `GetV0UsageRpcByChain` operationId). +func (c *ClientWithResponses) GetV0UsageRpcByChainWithResponse(ctx context.Context, params *GetV0UsageRpcByChainParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByChainResponse, error) { + rsp, err := c.GetV0UsageRpcByChain(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0UsageRpcByChainResponse(rsp) +} + +// GetV0UsageRpcByEndpointWithResponse Retrieves usage data by endpoint. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/usage/rpc/by-endpoint (the `GetV0UsageRpcByEndpoint` operationId). +func (c *ClientWithResponses) GetV0UsageRpcByEndpointWithResponse(ctx context.Context, params *GetV0UsageRpcByEndpointParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByEndpointResponse, error) { + rsp, err := c.GetV0UsageRpcByEndpoint(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0UsageRpcByEndpointResponse(rsp) +} + +// GetV0UsageRpcByMethodWithResponse Retrieves usage data by method. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/usage/rpc/by-method (the `GetV0UsageRpcByMethod` operationId). +func (c *ClientWithResponses) GetV0UsageRpcByMethodWithResponse(ctx context.Context, params *GetV0UsageRpcByMethodParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByMethodResponse, error) { + rsp, err := c.GetV0UsageRpcByMethod(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0UsageRpcByMethodResponse(rsp) +} + +// GetV0UsageRpcByTagWithResponse Retrieves usage data grouped by tag. +// +// Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v0/usage/rpc/by-tag (the `GetV0UsageRpcByTag` operationId). +func (c *ClientWithResponses) GetV0UsageRpcByTagWithResponse(ctx context.Context, params *GetV0UsageRpcByTagParams, reqEditors ...RequestEditorFn) (*GetV0UsageRpcByTagResponse, error) { + rsp, err := c.GetV0UsageRpcByTag(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV0UsageRpcByTagResponse(rsp) +} + +// ParseGetV0AccountInfoResponse parses an HTTP response from a GetV0AccountInfoWithResponse call +func ParseGetV0AccountInfoResponse(rsp *http.Response) (*GetV0AccountInfoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0AccountInfoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An object which contains the following fields: + Data *struct { + // BillingVersion The billing version associated with the account + BillingVersion *string `json:"billing_version,omitempty"` + + // CreatedAt The timestamp when the account was created + CreatedAt *string `json:"created_at,omitempty"` + + // Id The unique identifier for the account + Id *int `json:"id,omitempty"` + + // Name The name of the account + Name *string `json:"name,omitempty"` + + // Subscription An object containing the account's subscription details: + Subscription *struct { + // Interval The billing interval of the subscription + Interval *string `json:"interval,omitempty"` + + // PlanName The name of the subscription plan + PlanName *string `json:"plan_name,omitempty"` + + // Status The status of the subscription + Status *string `json:"status,omitempty"` + } `json:"subscription,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0ApiCreditsByChainResponse parses an HTTP response from a GetV0ApiCreditsByChainWithResponse call +func ParseGetV0ApiCreditsByChainResponse(rsp *http.Response) (*GetV0ApiCreditsByChainResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0ApiCreditsByChainResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Credits The API credit cost of the method for the account's billing version + Credits *int `json:"credits,omitempty"` + + // Method The name of the RPC method + Method *string `json:"method,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0BillingInvoicesResponse parses an HTTP response from a GetV0BillingInvoicesWithResponse call +func ParseGetV0BillingInvoicesResponse(rsp *http.Response) (*GetV0BillingInvoicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0BillingInvoicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Invoices An array of invoices + Invoices *[]struct { + // AmountDue The total amount that is due on the invoice + AmountDue *int `json:"amount_due,omitempty"` + + // AmountPaid The total amount that has been paid for the invoice + AmountPaid *int `json:"amount_paid,omitempty"` + + // BillingReason The reason for generating the invoice + BillingReason *string `json:"billing_reason,omitempty"` + + // Created The timestamp when the invoice was created in second + Created *int `json:"created,omitempty"` + + // Id The unique identifier for the invoice + Id *string `json:"id,omitempty"` + + // Lines An array of lines which contains the following fields: + Lines *[]struct { + // Amount The cost associated with each line item + Amount *int `json:"amount,omitempty"` + + // Description A detailed description of each line item billed + Description *string `json:"description,omitempty"` + } `json:"lines,omitempty"` + + // PeriodEnd The end timestamp of the billing period for the invoice in second + PeriodEnd *int `json:"period_end,omitempty"` + + // PeriodStart The start timestamp of the billing period for the invoice in second + PeriodStart *int `json:"period_start,omitempty"` + + // Status The current state of the invoice + Status *string `json:"status,omitempty"` + + // Subtotal The total cost of the invoice + Subtotal *int `json:"subtotal,omitempty"` + } `json:"invoices,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0BillingPaymentsResponse parses an HTTP response from a GetV0BillingPaymentsWithResponse call +func ParseGetV0BillingPaymentsResponse(rsp *http.Response) (*GetV0BillingPaymentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0BillingPaymentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Payments An array of payments associated with the account + Payments *[]struct { + // Amount The total amount of the payment + Amount *string `json:"amount,omitempty"` + + // CardLast4 The last four digits of the card used for the payment (masked for security) + CardLast4 *string `json:"card_last_4,omitempty"` + + // CreatedAt The timestamp when the payment was created in second + CreatedAt *string `json:"created_at,omitempty"` + + // Currency The currency in which the payment was made + Currency *string `json:"currency,omitempty"` + + // MarketplaceAmount The total amount spent in the marketplace + MarketplaceAmount *string `json:"marketplace_amount,omitempty"` + + // Status The current status of the payment + Status *string `json:"status,omitempty"` + } `json:"payments,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0ChainsResponse parses an HTTP response from a GetV0ChainsWithResponse call +func ParseGetV0ChainsResponse(rsp *http.Response) (*GetV0ChainsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0ChainsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of data which contains the following fields: + Data *[]struct { + IsSelectChain *bool `json:"is_select_chain,omitempty"` + + // Networks An array of networks + Networks *[]struct { + ChainId *int `json:"chain_id,omitempty"` + + // Name The name of the specific network + Name *string `json:"name,omitempty"` + + // Slug A short, unique identifier for the specific network + Slug *string `json:"slug,omitempty"` + } `json:"networks,omitempty"` + + // Slug A short, unique identifier for the blockchain network + Slug *string `json:"slug,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsResponse parses an HTTP response from a GetV0EndpointsWithResponse call +func ParseGetV0EndpointsResponse(rsp *http.Response) (*GetV0EndpointsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of data which contains the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the specific endpoint + Id *string `json:"id,omitempty"` + + // IsDedicated Whether the endpoint is a dedicated endpoint + IsDedicated *bool `json:"is_dedicated,omitempty"` + + // IsFlatRate Whether the endpoint is a flat rate endpoint + IsFlatRate *bool `json:"is_flat_rate,omitempty"` + + // IsMultichain Whether the endpoint is a multichain endpoint + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Name The endpoint subdomain + Name *string `json:"name,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Status The current status of the endpoint (active or paused) + Status *string `json:"status,omitempty"` + + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + + // Pagination Pagination details for the response + Pagination *struct { + // Limit The maximum number of endpoints returned per page + Limit *int `json:"limit,omitempty"` + + // Offset The number of endpoints skipped + Offset *int `json:"offset,omitempty"` + + // Total The total number of endpoints matching the query + Total *int `json:"total,omitempty"` + } `json:"pagination,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsResponse parses an HTTP response from a PostV0EndpointsWithResponse call +func ParsePostV0EndpointsResponse(rsp *http.Response) (*PostV0EndpointsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + // DomainMasks An array of domain-based security configurations + DomainMasks *[]struct { + // Domain The allowed domain for accessing the endpoint + Domain *string `json:"domain,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"domainMasks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + + // Options A list of security options available for the endpoint + Options *struct { + // Cors Indicates whether Cross-Origin Resource Sharing (CORS) is enabled + Cors *bool `json:"cors,omitempty"` + + // DebugAuthErrors Indicates whether detailed authentication error debugging is enabled + DebugAuthErrors *bool `json:"debugAuthErrors,omitempty"` + + // DomainMasks Indicates whether domain mask security is enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // EnforceChainNetwork Indicates whether the specified chain and network are enforced for the endpoint + EnforceChainNetwork *bool `json:"enforceChainNetwork,omitempty"` + + // Hosts Indicates whether host-based security is enabled + Hosts *bool `json:"hosts,omitempty"` + + // Hsts Indicates whether HTTP Strict Transport Security (HSTS) is enforced + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader Indicates whether a custom IP header is applied + IpCustomHeader *bool `json:"ipCustomHeader,omitempty"` + + // Ips Indicates whether IP-based security is enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Indicates whether JWT-based security is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Indicates whether referrer-based security is enable + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Indicates whether request filters are applied + RequestFilters *bool `json:"requestFilters,omitempty"` + + // Tokens Indicates whether token-based security is enabled + Tokens *bool `json:"tokens,omitempty"` + + // ValidHosts Indicates whether only valid hosts are allowed + ValidHosts *bool `json:"validHosts,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsBulkStatusResponse parses an HTTP response from a PostV0EndpointsBulkStatusWithResponse call +func ParsePostV0EndpointsBulkStatusResponse(rsp *http.Response) (*PostV0EndpointsBulkStatusResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsBulkStatusResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the result of the bulk status update + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the status update succeeded for this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsBulkTagsResponse parses an HTTP response from a DeleteV0EndpointsBulkTagsWithResponse call +func ParseDeleteV0EndpointsBulkTagsResponse(rsp *http.Response) (*DeleteV0EndpointsBulkTagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsBulkTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the result of the bulk tag removal + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully removed from this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsBulkTagsResponse parses an HTTP response from a PostV0EndpointsBulkTagsWithResponse call +func ParsePostV0EndpointsBulkTagsResponse(rsp *http.Response) (*PostV0EndpointsBulkTagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsBulkTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the result of the bulk tag operation + Data *struct { + // FailedCount The number of endpoints that failed to update + FailedCount *int `json:"failed_count,omitempty"` + + // Results An array of result objects for each endpoint + Results *[]struct { + // Id The endpoint ID + Id *string `json:"id,omitempty"` + + // Success Whether the tag was successfully added to this endpoint + Success *bool `json:"success,omitempty"` + } `json:"results,omitempty"` + + // Tag The tag that was added to the endpoints + Tag *struct { + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tag,omitempty"` + + // Total The total number of endpoints in the request + Total *int `json:"total,omitempty"` + + // UpdatedCount The number of endpoints successfully updated + UpdatedCount *int `json:"updated_count,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsTagsResponse parses an HTTP response from a GetV0EndpointsTagsWithResponse call +func ParseGetV0EndpointsTagsResponse(rsp *http.Response) (*GetV0EndpointsTagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the tags data + Data *struct { + // Tags An array of tag objects + Tags *[]struct { + // Id The unique identifier for the tag + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints associated with this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsTagsByIdResponse parses an HTTP response from a DeleteV0EndpointsTagsByIdWithResponse call +func ParseDeleteV0EndpointsTagsByIdResponse(rsp *http.Response) (*DeleteV0EndpointsTagsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsTagsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the result of the deletion + Data *map[string]interface{} `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsTagsByIdResponse parses an HTTP response from a PatchV0EndpointsTagsByIdWithResponse call +func ParsePatchV0EndpointsTagsByIdResponse(rsp *http.Response) (*PatchV0EndpointsTagsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsTagsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the updated tag details + Data *struct { + // Id The unique identifier of the tag + Id *int `json:"id,omitempty"` + + // Label The updated label/name of the tag + Label *string `json:"label,omitempty"` + + // UsageCount The number of endpoints currently using this tag + UsageCount *int `json:"usage_count,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdResponse parses an HTTP response from a DeleteV0EndpointsByIdWithResponse call +func ParseDeleteV0EndpointsByIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Result Indicates whether the endpoint was deleted + Result *bool `json:"result,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdResponse parses an HTTP response from a GetV0EndpointsByIdWithResponse call +func ParseGetV0EndpointsByIdResponse(rsp *http.Response) (*GetV0EndpointsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // HttpUrl The HTTP URL to access the newly created endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // Id A unique identifier for the created endpoint + Id *string `json:"id,omitempty"` + IsMultichain *bool `json:"is_multichain,omitempty"` + + // Label A descriptive label for the endpoint + Label *string `json:"label,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // RateLimits The rate_limits object which contains the following fields: + RateLimits *struct { + // Account The account-level rate limit + Account *int `json:"account,omitempty"` + + // RateLimitByIp Specifies if rate limiting is applied per IP + RateLimitByIp *bool `json:"rate_limit_by_ip,omitempty"` + + // Rpd Requests per day limit + Rpd *int `json:"rpd,omitempty"` + + // Rpm Requests per minute limit + Rpm *int `json:"rpm,omitempty"` + + // Rps Requests per second limit + Rps *int `json:"rps,omitempty"` + } `json:"rate_limits,omitempty"` + + // Security The security object which contains the following fields: + Security *struct { + DomainMasks *[]struct { + Domain *string `json:"domain,omitempty"` + Id *string `json:"id,omitempty"` + } `json:"domain_masks,omitempty"` + + // Ips An array of IP-based security configurations + Ips *[]struct { + // Id A unique identifier for the IP configuration + Id *string `json:"id,omitempty"` + + // Ip The allowed IP address for accessing the endpoint + Ip *string `json:"ip,omitempty"` + } `json:"ips,omitempty"` + + // Jwts An array of JSON Web Token (JWT) configurations + Jwts *[]struct { + // Id A unique identifier for the JWT + Id *string `json:"id,omitempty"` + + // Kid A unique key identifier for the JWT public key + Kid *string `json:"kid,omitempty"` + + // Name The name of the JWT + Name *string `json:"name,omitempty"` + + // PublicKey The public key used in the JWT + PublicKey *string `json:"public_key,omitempty"` + } `json:"jwts,omitempty"` + Options *struct { + Cors *bool `json:"cors,omitempty"` + DomainMasks *bool `json:"domainMasks,omitempty"` + Hsts *bool `json:"hsts,omitempty"` + IpCustomHeader *struct { + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + Ips *bool `json:"ips,omitempty"` + Jwts *bool `json:"jwts,omitempty"` + Referrers *bool `json:"referrers,omitempty"` + RequestFilters *bool `json:"requestFilters,omitempty"` + ResponseLogging *bool `json:"responseLogging,omitempty"` + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of referrer-based security configurations + Referrers *[]struct { + // Id A unique identifier for the referrer. + Id *string `json:"id,omitempty"` + + // Referrer The referrer URL allowed to access the endpoint + Referrer *string `json:"referrer,omitempty"` + } `json:"referrers,omitempty"` + RequestFilters *[]struct { + Id *string `json:"id,omitempty"` + Method *[]string `json:"method,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of token-based security configurations + Tokens *[]struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The actual token value used for authentication + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"security,omitempty"` + + // Status Current state of the endpoint — either `active` or `paused` + Status *string `json:"status,omitempty"` + Tags *[]struct { + Label *string `json:"label,omitempty"` + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + + // WssUrl The WebSocket URL to access the newly created endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdResponse parses an HTTP response from a PatchV0EndpointsByIdWithResponse call +func ParsePatchV0EndpointsByIdResponse(rsp *http.Response) (*PatchV0EndpointsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Indicates whether the updation is done or not + Data *bool `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdDisableMultichainResponse parses an HTTP response from a PostV0EndpointsByIdDisableMultichainWithResponse call +func ParsePostV0EndpointsByIdDisableMultichainResponse(rsp *http.Response) (*PostV0EndpointsByIdDisableMultichainResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdDisableMultichainResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Returns true when multichain is successfully disabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdEnableMultichainResponse parses an HTTP response from a PostV0EndpointsByIdEnableMultichainWithResponse call +func ParsePostV0EndpointsByIdEnableMultichainResponse(rsp *http.Response) (*PostV0EndpointsByIdEnableMultichainResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdEnableMultichainResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Returns true when multichain is successfully enabled + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdIpCustomHeaderResponse parses an HTTP response from a DeleteV0EndpointsByIdIpCustomHeaderWithResponse call +func ParseDeleteV0EndpointsByIdIpCustomHeaderResponse(rsp *http.Response) (*DeleteV0EndpointsByIdIpCustomHeaderResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdIpCustomHeaderResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Returns true when the IP custom header is successfully deleted + Data *bool `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdIpCustomHeaderResponse parses an HTTP response from a PatchV0EndpointsByIdIpCustomHeaderWithResponse call +func ParsePatchV0EndpointsByIdIpCustomHeaderResponse(rsp *http.Response) (*PatchV0EndpointsByIdIpCustomHeaderResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdIpCustomHeaderResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the updated IP custom header details + Data *struct { + // HeaderName The name of the IP custom header that was set + HeaderName *string `json:"header_name,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdLogDetailsResponse parses an HTTP response from a GetV0EndpointsByIdLogDetailsWithResponse call +func ParseGetV0EndpointsByIdLogDetailsResponse(rsp *http.Response) (*GetV0EndpointsByIdLogDetailsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdLogDetailsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains detailed information about a specific log entry, including the raw request that was sent and the response that was received. + Data *struct { + // Request A JSON-encoded string representing the request payload that was sent in the original log entry. The logs are truncated after 2KB. + Request *string `json:"request,omitempty"` + + // Response A JSON-encoded string containing the full response returned by the API or aggregator for the logged request. The logs are truncated after 2KB. + Response *string `json:"response,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdLogsResponse parses an HTTP response from a GetV0EndpointsByIdLogsWithResponse call +func ParseGetV0EndpointsByIdLogsResponse(rsp *http.Response) (*GetV0EndpointsByIdLogsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of log entries which contains the following fields: + Data *[]struct { + // Details Additional error details if available (nullable) + Details *string `json:"details,omitempty"` + + // ErrorCode The application-specific error code returned + ErrorCode *int `json:"error_code,omitempty"` + + // HttpMethod The HTTP method used for the request + HttpMethod *string `json:"http_method,omitempty"` + + // Method The name of the method invoked + Method *string `json:"method,omitempty"` + + // Network The name of the network on which the method was called + Network *string `json:"network,omitempty"` + + // RequestId The unique identifier for the request + RequestId *string `json:"request_id,omitempty"` + + // Status The HTTP status code returned by the request + Status *int `json:"status,omitempty"` + + // Timestamp The timestamp when the log was recorded + Timestamp *string `json:"timestamp,omitempty"` + + // Url The request URL + Url *string `json:"url,omitempty"` + } `json:"data,omitempty"` + + // NextAt A cursor string used for pagination to fetch the next set of logs + NextAt *string `json:"next_at,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdMethodRateLimitsResponse parses an HTTP response from a GetV0EndpointsByIdMethodRateLimitsWithResponse call +func ParseGetV0EndpointsByIdMethodRateLimitsResponse(rsp *http.Response) (*GetV0EndpointsByIdMethodRateLimitsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdMethodRateLimitsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // RateLimiters An array of rate limiter configurations + RateLimiters *[]struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of method names to which the rate limiter applies + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The number of allowed requests within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"rate_limiters,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdMethodRateLimitsResponse parses an HTTP response from a PostV0EndpointsByIdMethodRateLimitsWithResponse call +func ParsePostV0EndpointsByIdMethodRateLimitsResponse(rsp *http.Response) (*PostV0EndpointsByIdMethodRateLimitsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdMethodRateLimitsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse parses an HTTP response from a DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse call +func ParseDeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data A message indicating the result of the operation + Data *string `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse parses an HTTP response from a PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdWithResponse call +func ParsePatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse(rsp *http.Response) (*PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdMethodRateLimitsByMethodRateLimitIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Created The timestamp when the rate limiter was created in second + Created *string `json:"created,omitempty"` + + // Id A unique identifier for the rate limiter + Id *string `json:"id,omitempty"` + + // Interval The time interval for the rate limit + Interval *string `json:"interval,omitempty"` + + // Methods A list of methods the rate limiter applies to + Methods *[]interface{} `json:"methods,omitempty"` + + // Rate The maximum number of requests allowed within the specified interval + Rate *int `json:"rate,omitempty"` + + // Status The current status of the rate limiter + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdMetricsResponse parses an HTTP response from a GetV0EndpointsByIdMetricsWithResponse call +func ParseGetV0EndpointsByIdMetricsResponse(rsp *http.Response) (*GetV0EndpointsByIdMetricsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdMetricsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of data + Data *[]struct { + // Data A nested list of numerical values representing the metric fetched for the endpoint + Data *[]interface{} `json:"data,omitempty"` + + // Tag A string label that identifies or categorizes the specific metric + Tag *string `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message if the request to fetch the metric fails + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdRateLimitsResponse parses an HTTP response from a GetV0EndpointsByIdRateLimitsWithResponse call +func ParseGetV0EndpointsByIdRateLimitsResponse(rsp *http.Response) (*GetV0EndpointsByIdRateLimitsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdRateLimitsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the endpoint rate limit configuration + Data *struct { + // RateLimits An array of endpoint rate limit configurations + RateLimits *[]struct { + // Bucket The rate limit bucket, such as rps, rpm, or rpd + Bucket *string `json:"bucket,omitempty"` + + // Id The unique identifier for a user-set endpoint rate limit override. This field is returned for user_override rate limits and can be used to delete a specific endpoint rate limit. + Id *string `json:"id,omitempty"` + + // RateLimit The rate limit value for the bucket + RateLimit *int `json:"rate_limit,omitempty"` + + // Source The source of the rate limit, such as plan_default or user_override + Source *string `json:"source,omitempty"` + } `json:"rate_limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdRateLimitsResponse parses an HTTP response from a PatchV0EndpointsByIdRateLimitsWithResponse call +func ParsePatchV0EndpointsByIdRateLimitsResponse(rsp *http.Response) (*PatchV0EndpointsByIdRateLimitsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdRateLimitsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Limits The limits object which contains the following fields: + Limits *struct { + // Rpd The maximum number of requests allowed per day. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpd *int `json:"rpd,omitempty"` + + // Rpm The maximum number of requests allowed per minute. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rpm *int `json:"rpm,omitempty"` + + // Rps The maximum number of requests allowed per second. A value of -1 indicates that no endpoint-level override is set for this bucket. + Rps *int `json:"rps,omitempty"` + } `json:"limits,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdRateLimitsByOverrideIdResponse parses an HTTP response from a DeleteV0EndpointsByIdRateLimitsByOverrideIdWithResponse call +func ParseDeleteV0EndpointsByIdRateLimitsByOverrideIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdRateLimitsByOverrideIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the result of the operation + Data *struct { + // Success Indicates whether the endpoint rate limit was deleted + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdSecurityResponse parses an HTTP response from a GetV0EndpointsByIdSecurityWithResponse call +func ParseGetV0EndpointsByIdSecurityResponse(rsp *http.Response) (*GetV0EndpointsByIdSecurityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdSecurityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the security state of the endpoint + Data *struct { + // DomainMasks An array of domain mask entries; null if none configured + DomainMasks *[]interface{} `json:"domain_masks,omitempty"` + + // Ips An array of allowed IP entries; null if none configured + Ips *[]interface{} `json:"ips,omitempty"` + + // Jwts An array of JWT configuration objects; null if none configured + Jwts *[]interface{} `json:"jwts,omitempty"` + + // Options Security feature toggles for the endpoint + Options *struct { + // Cors Whether CORS is enabled + Cors *bool `json:"cors,omitempty"` + + // DomainMasks Whether domain mask restrictions are enabled + DomainMasks *bool `json:"domainMasks,omitempty"` + + // Hsts Whether HSTS is enabled + Hsts *bool `json:"hsts,omitempty"` + + // IpCustomHeader IP custom header configuration + IpCustomHeader *struct { + // Value The IP custom header value; null if not set + Value *string `json:"value,omitempty"` + } `json:"ipCustomHeader,omitempty"` + + // Ips Whether IP-based restrictions are enabled + Ips *bool `json:"ips,omitempty"` + + // Jwts Whether JWT-based authentication is enabled + Jwts *bool `json:"jwts,omitempty"` + + // Referrers Whether referrer-based restrictions are enabled + Referrers *bool `json:"referrers,omitempty"` + + // RequestFilters Whether request filters are enabled + RequestFilters *bool `json:"requestFilters,omitempty"` + + // ResponseLogging Whether response logging is enabled + ResponseLogging *bool `json:"responseLogging,omitempty"` + + // Tokens Whether token-based authentication is enabled + Tokens *bool `json:"tokens,omitempty"` + } `json:"options,omitempty"` + + // Referrers An array of allowed referrer entries; null if none configured + Referrers *[]interface{} `json:"referrers,omitempty"` + + // RequestFilters An array of request filter objects; null if none configured + RequestFilters *[]struct { + // Id The unique identifier (UUID) of the request filter + Id *string `json:"id,omitempty"` + + // Method An array of whitelisted method names + Method *[]interface{} `json:"method,omitempty"` + + // Params Parameter constraints for the filter + Params *map[string]interface{} `json:"params,omitempty"` + } `json:"request_filters,omitempty"` + + // Tokens An array of authentication token objects; null if none configured + Tokens *[]struct { + // Id The unique identifier (UUID) of the token + Id *string `json:"id,omitempty"` + + // Token The authentication token value + Token *string `json:"token,omitempty"` + } `json:"tokens,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityDomainMasksResponse parses an HTTP response from a PostV0EndpointsByIdSecurityDomainMasksWithResponse call +func ParsePostV0EndpointsByIdSecurityDomainMasksResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityDomainMasksResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityDomainMasksResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // DomainMask The domain mask that you used to mask your endpoint + DomainMask *string `json:"domain_mask,omitempty"` + + // Id A unique identifier for the domain mask + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityDomainMasksByDomainMaskIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Represent successfully deleted the existing endpoint domain mask + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityIpsResponse parses an HTTP response from a PostV0EndpointsByIdSecurityIpsWithResponse call +func ParsePostV0EndpointsByIdSecurityIpsResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityIpsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityIpsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the IP rule + Id *string `json:"id,omitempty"` + + // Ip The IP address that is allowed to access the API endpoint + Ip *string `json:"ip,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityIpsByIpIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityIpsByIpIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityIpsByIpIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityIpsByIpIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityIpsByIpIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Represent successfully deleted the existing endpoint IP + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityJwtsResponse parses an HTTP response from a PostV0EndpointsByIdSecurityJwtsWithResponse call +func ParsePostV0EndpointsByIdSecurityJwtsResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityJwtsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityJwtsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the JWT configuration + Id *string `json:"id,omitempty"` + + // Kid The key identifier (KID) associated with the public key + Kid *string `json:"kid,omitempty"` + + // Name A human-readable name for the JWT configuration + Name *string `json:"name,omitempty"` + + // PublicKey The public key used to verify the JWT token + PublicKey *string `json:"public_key,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityJwtsByJwtIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityJwtsByJwtIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Represent successfully deleted the existing endpoint jwt + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityReferrersResponse parses an HTTP response from a PostV0EndpointsByIdSecurityReferrersWithResponse call +func ParsePostV0EndpointsByIdSecurityReferrersResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityReferrersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityReferrersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the referrer + Id *string `json:"id,omitempty"` + + // Referrer The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted + Referrer *string `json:"referrer,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityReferrersByReferrerIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityReferrersByReferrerIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Represent successfully deleted the existing endpoint referrer + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityRequestFiltersResponse parses an HTTP response from a PostV0EndpointsByIdSecurityRequestFiltersWithResponse call +func ParsePostV0EndpointsByIdSecurityRequestFiltersResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityRequestFiltersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityRequestFiltersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the created request filter details + Data *struct { + // Id The unique identifier (UUID) of the newly created request filter + Id *string `json:"id,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParsePutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse parses an HTTP response from a PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdWithResponse call +func ParsePutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse(rsp *http.Response) (*PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutV0EndpointsByIdSecurityRequestFiltersByRequestFilterIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParsePostV0EndpointsByIdSecurityTokensResponse parses an HTTP response from a PostV0EndpointsByIdSecurityTokensWithResponse call +func ParsePostV0EndpointsByIdSecurityTokensResponse(rsp *http.Response) (*PostV0EndpointsByIdSecurityTokensResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdSecurityTokensResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Id A unique identifier for the token + Id *string `json:"id,omitempty"` + + // Token The generated token string used for authentication + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdSecurityTokensByTokenIdResponse parses an HTTP response from a DeleteV0EndpointsByIdSecurityTokensByTokenIdWithResponse call +func ParseDeleteV0EndpointsByIdSecurityTokensByTokenIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdSecurityTokensByTokenIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Represent successfully deleted the existing endpoint token + Data *bool `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdSecurityOptionsResponse parses an HTTP response from a GetV0EndpointsByIdSecurityOptionsWithResponse call +func ParseGetV0EndpointsByIdSecurityOptionsResponse(rsp *http.Response) (*GetV0EndpointsByIdSecurityOptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdSecurityOptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdSecurityOptionsResponse parses an HTTP response from a PatchV0EndpointsByIdSecurityOptionsWithResponse call +func ParsePatchV0EndpointsByIdSecurityOptionsResponse(rsp *http.Response) (*PatchV0EndpointsByIdSecurityOptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdSecurityOptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Option Represents the security options + Option *string `json:"option,omitempty"` + + // Status Indicates the status of the option. Possible values: enabled, disabled + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0EndpointsByIdStatusResponse parses an HTTP response from a PatchV0EndpointsByIdStatusWithResponse call +func ParsePatchV0EndpointsByIdStatusResponse(rsp *http.Response) (*PatchV0EndpointsByIdStatusResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0EndpointsByIdStatusResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The updated status of the endpoint (either 'active' or 'paused') + Data *string `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdTagsResponse parses an HTTP response from a GetV0EndpointsByIdTagsWithResponse call +func ParseGetV0EndpointsByIdTagsResponse(rsp *http.Response) (*GetV0EndpointsByIdTagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array of tags associated with the endpoint + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0EndpointsByIdTagsResponse parses an HTTP response from a PostV0EndpointsByIdTagsWithResponse call +func ParsePostV0EndpointsByIdTagsResponse(rsp *http.Response) (*PostV0EndpointsByIdTagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0EndpointsByIdTagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Tags An array containing the newly created tag + Tags *[]struct { + // AccountId The account identifier associated with the tag + AccountId *int `json:"account_id,omitempty"` + + // CreatedAt The timestamp when the tag was created + CreatedAt *string `json:"created_at,omitempty"` + + // EndpointId The endpoint identifier associated with the tag + EndpointId *int `json:"endpoint_id,omitempty"` + + // Id The unique identifier for the endpoint-tag relationship + Id *int `json:"id,omitempty"` + + // Label The label/name of the newly created tag + Label *string `json:"label,omitempty"` + + // TagId The unique identifier for the newly created tag + TagId *int `json:"tag_id,omitempty"` + + // UpdatedAt The timestamp when the tag was last updated + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0EndpointsByIdTagsByTagIdResponse parses an HTTP response from a DeleteV0EndpointsByIdTagsByTagIdWithResponse call +func ParseDeleteV0EndpointsByIdTagsByTagIdResponse(rsp *http.Response) (*DeleteV0EndpointsByIdTagsByTagIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0EndpointsByIdTagsByTagIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains the result of the tag deletion + Data *struct { + // Success Whether the tag was successfully deleted from the endpoint + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0EndpointsByIdUrlsResponse parses an HTTP response from a GetV0EndpointsByIdUrlsWithResponse call +func ParseGetV0EndpointsByIdUrlsResponse(rsp *http.Response) (*GetV0EndpointsByIdUrlsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0EndpointsByIdUrlsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // HttpUrl The HTTP URL to access the endpoint + HttpUrl *string `json:"http_url,omitempty"` + + // MultichainUrls Only present for multichain endpoints. An object keyed by network identifier (e.g. `avalanche-mainnet`), where each value contains the HTTP and WebSocket URLs for that network. + MultichainUrls *struct { + // Network Per-network URL entry. The key is the network identifier (e.g. `avalanche-mainnet`). + Network *struct { + // HttpUrl The HTTP URL to access the endpoint on this network + HttpUrl *string `json:"http_url,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint on this network + WssUrl *string `json:"wss_url,omitempty"` + } `json:"{network},omitempty"` + } `json:"multichain_urls,omitempty"` + + // WssUrl The WebSocket URL to access the endpoint + WssUrl *string `json:"wss_url,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error information, if any + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0MetricsResponse parses an HTTP response from a GetV0MetricsWithResponse call +func ParseGetV0MetricsResponse(rsp *http.Response) (*GetV0MetricsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0MetricsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of metric objects, each containing a tag and its associated data points + Data *[]struct { + // Data An array of [timestamp, value] pairs representing the metric data points + Data *[]interface{} `json:"data,omitempty"` + + // Tag An array of strings identifying the metric group (e.g., network name) + Tag *[]interface{} `json:"tag,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0TeamsResponse parses an HTTP response from a GetV0TeamsWithResponse call +func ParseGetV0TeamsResponse(rsp *http.Response) (*GetV0TeamsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0TeamsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of team objects containing the following fields: + Data *[]struct { + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // Users An array of user objects in the team + Users *[]struct { + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0TeamsResponse parses an HTTP response from a PostV0TeamsWithResponse call +func ParsePostV0TeamsResponse(rsp *http.Response) (*PostV0TeamsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0TeamsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The created team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the created team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the created team + Name *string `json:"name,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0TeamsByIdResponse parses an HTTP response from a DeleteV0TeamsByIdWithResponse call +func ParseDeleteV0TeamsByIdResponse(rsp *http.Response) (*DeleteV0TeamsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0TeamsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the team was deleted successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0TeamsByIdResponse parses an HTTP response from a GetV0TeamsByIdWithResponse call +func ParseGetV0TeamsByIdResponse(rsp *http.Response) (*GetV0TeamsByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0TeamsByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The team object containing the following fields: + Data *struct { + // DefaultRole The default role assigned to new team members (admin, viewer, or billing) + DefaultRole *string `json:"default_role,omitempty"` + + // Id A unique identifier for the team + Id *int `json:"id,omitempty"` + + // MembersCount The number of members in the team + MembersCount *int `json:"members_count,omitempty"` + + // Name The name of the team + Name *string `json:"name,omitempty"` + + // PendingInvites An array of pending invite objects + PendingInvites *[]struct { + // AccountPrimaryUser Indicates if the invited user will be the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the invite was created + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the pending invite + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the invited user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invite (e.g., Pending) + Status *string `json:"status,omitempty"` + } `json:"pending_invites,omitempty"` + + // Users An array of active user objects in the team + Users *[]struct { + // AccountPrimaryUser Indicates if the user is the primary account user + AccountPrimaryUser *bool `json:"account_primary_user,omitempty"` + + // CreatedAt The timestamp when the user was added to the team + CreatedAt *string `json:"created_at,omitempty"` + + // Email The email address of the user + Email *string `json:"email,omitempty"` + + // FullName The full name of the user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the user + Id *int `json:"id,omitempty"` + + // PhotoUrl The URL of the user's profile photo + PhotoUrl *string `json:"photo_url,omitempty"` + + // Role The role of the user in the team (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the user (e.g., Active) + Status *string `json:"status,omitempty"` + } `json:"users,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0TeamsByIdEndpointsResponse parses an HTTP response from a GetV0TeamsByIdEndpointsWithResponse call +func ParseGetV0TeamsByIdEndpointsResponse(rsp *http.Response) (*GetV0TeamsByIdEndpointsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0TeamsByIdEndpointsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An array of endpoint objects containing the following fields: + Data *[]struct { + // Chain The blockchain the endpoint is associated with + Chain *string `json:"chain,omitempty"` + + // Id A unique identifier for the endpoint + Id *int `json:"id,omitempty"` + + // Network The specific network of the blockchain + Network *string `json:"network,omitempty"` + + // Subdomain The subdomain name of the endpoint + Subdomain *string `json:"subdomain,omitempty"` + } `json:"data,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0TeamsByIdEndpointsResponse parses an HTTP response from a PatchV0TeamsByIdEndpointsWithResponse call +func ParsePatchV0TeamsByIdEndpointsResponse(rsp *http.Response) (*PatchV0TeamsByIdEndpointsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0TeamsByIdEndpointsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The response object containing the following fields: + Data *struct { + // Success Indicates whether the operation was successful + Success *bool `json:"success,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0TeamsByIdMembersResponse parses an HTTP response from a PostV0TeamsByIdMembersWithResponse call +func ParsePostV0TeamsByIdMembersResponse(rsp *http.Response) (*PostV0TeamsByIdMembersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0TeamsByIdMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The invited user object containing the following fields: + Data *struct { + // Email The email address of the invited user + Email *string `json:"email,omitempty"` + + // FullName The full name of the invited user + FullName *string `json:"full_name,omitempty"` + + // Id A unique identifier for the invited user + Id *int `json:"id,omitempty"` + + // Role The role assigned to the invited user (admin, viewer, or billing) + Role *string `json:"role,omitempty"` + + // Status The status of the invitation (e.g., Active, Pending) + Status *string `json:"status,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteV0TeamsByIdMembersByUserIdResponse parses an HTTP response from a DeleteV0TeamsByIdMembersByUserIdWithResponse call +func ParseDeleteV0TeamsByIdMembersByUserIdResponse(rsp *http.Response) (*DeleteV0TeamsByIdMembersByUserIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteV0TeamsByIdMembersByUserIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the user was removed successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0TeamsByIdMembersByUserIdResendInviteResponse parses an HTTP response from a PostV0TeamsByIdMembersByUserIdResendInviteWithResponse call +func ParsePostV0TeamsByIdMembersByUserIdResendInviteResponse(rsp *http.Response) (*PostV0TeamsByIdMembersByUserIdResendInviteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0TeamsByIdMembersByUserIdResendInviteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The response object containing the following fields: + Data *struct { + // Message A message confirming the invitation was resent successfully + Message *string `json:"message,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0ToolingAccessResponse parses an HTTP response from a GetV0ToolingAccessWithResponse call +func ParseGetV0ToolingAccessResponse(rsp *http.Response) (*GetV0ToolingAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0ToolingAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is currently enabled for the account + Enabled *bool `json:"enabled,omitempty"` + + // EnabledAt The timestamp when Tooling Access was enabled + EnabledAt *string `json:"enabled_at,omitempty"` + + // EndpointId The unique identifier of the endpoint provisioned for Tooling Access + EndpointId *int `json:"endpoint_id,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access. May be present even when disabled if the account was previously provisioned + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePatchV0ToolingAccessResponse parses an HTTP response from a PatchV0ToolingAccessWithResponse call +func ParsePatchV0ToolingAccessResponse(rsp *http.Response) (*PatchV0ToolingAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchV0ToolingAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An object which contains the following fields: + Data *struct { + // Enabled Whether Tooling Access is enabled after the update + Enabled *bool `json:"enabled,omitempty"` + + // EndpointUrl The URL of the endpoint provisioned for Tooling Access + EndpointUrl *string `json:"endpoint_url,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostV0ToolingAccessTokenResponse parses an HTTP response from a PostV0ToolingAccessTokenWithResponse call +func ParsePostV0ToolingAccessTokenResponse(rsp *http.Response) (*PostV0ToolingAccessTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV0ToolingAccessTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data An object which contains the following fields: + Data *struct { + // EndpointUrl The URL of the Tooling Access endpoint the token authenticates against + EndpointUrl *string `json:"endpoint_url,omitempty"` + + // ExpiresAt The timestamp when the token expires + ExpiresAt *string `json:"expires_at,omitempty"` + + // Token The short-lived ES256 JWT used to authenticate RPC calls + Token *string `json:"token,omitempty"` + } `json:"data,omitempty"` + + // Error An error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0UsageRpcResponse parses an HTTP response from a GetV0UsageRpcWithResponse call +func ParseGetV0UsageRpcResponse(rsp *http.Response) (*GetV0UsageRpcResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0UsageRpcResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // CreditsRemaining The number of credits remaining in the account + CreditsRemaining *int `json:"credits_remaining,omitempty"` + + // CreditsUsed The number of credits used within the specified time period + CreditsUsed *int `json:"credits_used,omitempty"` + + // EndTime The end timestamp for the usage data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Limit The maximum number of credits available + Limit *int `json:"limit,omitempty"` + + // Overages The number of credits used beyond the limit + Overages *int `json:"overages,omitempty"` + + // StartTime The start timestamp for the usage data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A string containing an error message, if any issues occur during the request + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0UsageRpcByChainResponse parses an HTTP response from a GetV0UsageRpcByChainWithResponse call +func ParseGetV0UsageRpcByChainResponse(rsp *http.Response) (*GetV0UsageRpcByChainResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0UsageRpcByChainResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // Chains An array of blockchains and their corresponding credit usage + Chains *[]struct { + // Bytes The total number of data bytes transferred on the specified blockchain (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the specified blockchain (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Name The name of the blockchain + Name *string `json:"name,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + } `json:"chains,omitempty"` + + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0UsageRpcByEndpointResponse parses an HTTP response from a GetV0UsageRpcByEndpointWithResponse call +func ParseGetV0UsageRpcByEndpointResponse(rsp *http.Response) (*GetV0UsageRpcByEndpointResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0UsageRpcByEndpointResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second in second + EndTime *int `json:"end_time,omitempty"` + + // Endpoints An array of endpoints which contains the following fields: + Endpoints *[]struct { + // Bytes The total number of data bytes transferred by the endpoint (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // Chain The blockchain associated with the endpoint + Chain *string `json:"chain,omitempty"` + + // CreditsUsed The total number of credits used by the endpoint (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label A custom label for the endpoint + Label *string `json:"label,omitempty"` + + // MethodsBreakdown An array of methods_breakdown + MethodsBreakdown *[]struct { + // Archive Indicates whether the request is using archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods_breakdown,omitempty"` + + // Name The name of the endpoint + Name *string `json:"name,omitempty"` + + // Network The specific network on the blockchain + Network *string `json:"network,omitempty"` + + // Requests The total number of requests made to the endpoint + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // Status The current state of the RPC endpoint. Possible values include: active, archived, paused or terminated + Status *string `json:"status,omitempty"` + } `json:"endpoints,omitempty"` + + // StartTime The start timestamp for the data in second in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0UsageRpcByMethodResponse parses an HTTP response from a GetV0UsageRpcByMethodWithResponse call +func ParseGetV0UsageRpcByMethodResponse(rsp *http.Response) (*GetV0UsageRpcByMethodResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0UsageRpcByMethodResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data The data object which contains the following fields: + Data *struct { + // EndTime The end timestamp for the data in second + EndTime *int `json:"end_time,omitempty"` + + // Methods An array of method calls and their corresponding credit usage + Methods *[]struct { + // Archive Indicates whether the request used archived data + Archive *bool `json:"archive,omitempty"` + + // Bytes The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe) + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The number of credits used by the method (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // MethodName The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer + MethodName *string `json:"method_name,omitempty"` + } `json:"methods,omitempty"` + + // StartTime The start timestamp for the data in second + StartTime *int `json:"start_time,omitempty"` + } `json:"data,omitempty"` + + // Error A field containing an error message if any issue occurs + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV0UsageRpcByTagResponse parses an HTTP response from a GetV0UsageRpcByTagWithResponse call +func ParseGetV0UsageRpcByTagResponse(rsp *http.Response) (*GetV0UsageRpcByTagResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV0UsageRpcByTagResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + // Data Contains usage data grouped by tag + Data *struct { + // EndTime The end time of the usage period as a unix timestamp + EndTime *int `json:"end_time,omitempty"` + + // StartTime The start time of the usage period as a unix timestamp + StartTime *int `json:"start_time,omitempty"` + + // Tags An array of usage data objects, one per tag + Tags *[]struct { + // Bytes The total number of data bytes transferred by endpoints with this tag (for example, Streams and Yellowstone gRPC data). Contributes to data_credits + Bytes *int `json:"bytes,omitempty"` + + // CreditsUsed The total number of credits used by endpoints with this tag (RPC credits and data credits combined) + CreditsUsed *int `json:"credits_used,omitempty"` + + // DataCredits The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred + DataCredits *int `json:"data_credits,omitempty"` + + // Label The label/name of the tag + Label *string `json:"label,omitempty"` + + // Requests The total number of requests made by endpoints with this tag + Requests *int `json:"requests,omitempty"` + + // RpcCredits The portion of credits_used consumed by RPC requests + RpcCredits *int `json:"rpc_credits,omitempty"` + + // TagId The unique identifier of the tag + TagId *int `json:"tag_id,omitempty"` + } `json:"tags,omitempty"` + } `json:"data,omitempty"` + + // Error Contains error details if the request failed; null if successful + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} diff --git a/api/admin/config.yaml b/api/admin/config.yaml new file mode 100644 index 0000000..67a0c28 --- /dev/null +++ b/api/admin/config.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json +package: admin +output: admin.gen.go +generate: + models: true + client: true +output-options: + skip-prune: true diff --git a/api/admin/gen/main.go b/api/admin/gen/main.go new file mode 100644 index 0000000..4ad5fff --- /dev/null +++ b/api/admin/gen/main.go @@ -0,0 +1,170 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" +) + +type patch struct { + Op string `json:"op"` + Path string `json:"path"` + Value json.RawMessage `json:"value"` +} + +func main() { + dir := "api/admin" + if len(os.Args) > 1 { + dir = os.Args[1] + } + + spec, err := readJSON(filepath.Join(dir, "openapi.upstream.json")) + if err != nil { + fail(err) + } + + raw, err := os.ReadFile(filepath.Join(dir, "patches.json")) + if err != nil { + fail(err) + } + var patches []patch + if err := json.Unmarshal(raw, &patches); err != nil { + fail(err) + } + + for index, p := range patches { + if err := apply(spec, p); err != nil { + fail(fmt.Errorf("patch %d (%s): %w", index, p.Path, err)) + } + } + + out, err := json.MarshalIndent(spec, "", " ") + if err != nil { + fail(err) + } + if err := os.WriteFile(filepath.Join(dir, "openapi.json"), append(out, '\n'), 0o644); err != nil { + fail(err) + } + fmt.Printf("applied %d patches to %s/openapi.json\n", len(patches), dir) +} + +func apply(spec map[string]any, p patch) error { + tokens, err := pointer(p.Path) + if err != nil { + return err + } + if len(tokens) == 0 { + return fmt.Errorf("empty path") + } + + parent, err := resolve(spec, tokens[:len(tokens)-1], p.Op == "set") + if err != nil { + return err + } + leaf := tokens[len(tokens)-1] + + switch p.Op { + case "set": + var value any + if err := json.Unmarshal(p.Value, &value); err != nil { + return err + } + return set(parent, leaf, value) + case "remove": + asObject, ok := parent.(map[string]any) + if !ok { + return fmt.Errorf("cannot remove %q from a non-object", leaf) + } + if _, ok := asObject[leaf]; !ok { + return fmt.Errorf("nothing to remove at %q", p.Path) + } + delete(asObject, leaf) + return nil + default: + return fmt.Errorf("unknown op %q", p.Op) + } +} + +func set(parent any, leaf string, value any) error { + switch container := parent.(type) { + case map[string]any: + container[leaf] = value + return nil + case []any: + index, err := strconv.Atoi(leaf) + if err != nil { + return fmt.Errorf("index %q into an array is not a number", leaf) + } + if index < 0 || index >= len(container) { + return fmt.Errorf("index %d is out of range for an array of %d", index, len(container)) + } + container[index] = value + return nil + default: + return fmt.Errorf("cannot set %q on %T", leaf, parent) + } +} + +func resolve(node any, tokens []string, create bool) (any, error) { + for i, token := range tokens { + switch container := node.(type) { + case map[string]any: + next, ok := container[token] + if !ok { + if !create { + return nil, fmt.Errorf("no such key %q at /%s", token, strings.Join(tokens[:i+1], "/")) + } + next = map[string]any{} + container[token] = next + } + node = next + case []any: + index, err := strconv.Atoi(token) + if err != nil { + return nil, fmt.Errorf("index %q at /%s is not a number", token, strings.Join(tokens[:i+1], "/")) + } + if index < 0 || index >= len(container) { + return nil, fmt.Errorf("index %d at /%s is out of range", index, strings.Join(tokens[:i+1], "/")) + } + node = container[index] + default: + return nil, fmt.Errorf("cannot descend into %T at /%s", node, strings.Join(tokens[:i+1], "/")) + } + } + return node, nil +} + +func pointer(path string) ([]string, error) { + if path == "" { + return nil, nil + } + if !strings.HasPrefix(path, "/") { + return nil, fmt.Errorf("path %q must start with /", path) + } + parts := strings.Split(strings.TrimPrefix(path, "/"), "/") + for i, part := range parts { + part = strings.ReplaceAll(part, "~1", "/") + parts[i] = strings.ReplaceAll(part, "~0", "~") + } + return parts, nil +} + +func readJSON(path string) (map[string]any, error) { + raw, err := os.ReadFile(path) + if err != nil { + return nil, err + } + var out map[string]any + if err := json.Unmarshal(raw, &out); err != nil { + return nil, err + } + return out, nil +} + +func fail(err error) { + fmt.Fprintln(os.Stderr, "spec patch failed:", err) + os.Exit(1) +} diff --git a/api/admin/openapi.json b/api/admin/openapi.json new file mode 100644 index 0000000..2946610 --- /dev/null +++ b/api/admin/openapi.json @@ -0,0 +1,5829 @@ +{ + "components": { + "securitySchemes": { + "apiKeyAuth": { + "in": "header", + "name": "x-api-key", + "type": "apiKey" + } + } + }, + "info": { + "description": "Quicknode Admin API reference", + "title": "Admin API", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "paths": { + "/v0/account/info": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/account/v0-account-info" + }, + "operationId": "get_v0_account_info", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An object which contains the following fields:", + "properties": { + "billing_version": { + "description": "The billing version associated with the account", + "type": "string" + }, + "created_at": { + "description": "The timestamp when the account was created", + "type": "string" + }, + "id": { + "description": "The unique identifier for the account", + "type": "integer" + }, + "name": { + "description": "The name of the account", + "type": "string" + }, + "subscription": { + "description": "An object containing the account's subscription details:", + "properties": { + "interval": { + "description": "The billing interval of the subscription", + "type": "string" + }, + "plan_name": { + "description": "The name of the subscription plan", + "type": "string" + }, + "status": { + "description": "The status of the subscription", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns information about the account associated with the API key.", + "tags": [ + "account" + ] + } + }, + "/v0/api-credits/{chain}": { + "get": { + "description": "Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/api-credits/v0-api-credits-chain" + }, + "operationId": "get_v0_api_credits_by_chain", + "parameters": [ + { + "description": "The chain slug from the GET /v0/chains response", + "in": "path", + "name": "chain", + "required": true, + "schema": { + "description": "The chain slug from the GET /v0/chains response", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of data which contains the following fields:", + "items": { + "properties": { + "credits": { + "description": "The API credit cost of the method for the account's billing version", + "type": "integer" + }, + "method": { + "description": "The name of the RPC method", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns the API credit cost of each RPC method available on a chain.", + "tags": [ + "api-credits" + ] + } + }, + "/v0/billing/invoices": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/billing/v0-billing-invoices" + }, + "operationId": "get_v0_billing_invoices", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "invoices": { + "description": "An array of invoices", + "items": { + "properties": { + "amount_due": { + "description": "The total amount that is due on the invoice", + "type": "integer" + }, + "amount_paid": { + "description": "The total amount that has been paid for the invoice", + "type": "integer" + }, + "billing_reason": { + "description": "The reason for generating the invoice", + "type": "string" + }, + "created": { + "description": "The timestamp when the invoice was created in second", + "type": "integer" + }, + "id": { + "description": "The unique identifier for the invoice", + "type": "string" + }, + "lines": { + "description": "An array of lines which contains the following fields:", + "items": { + "properties": { + "amount": { + "description": "The cost associated with each line item", + "type": "integer" + }, + "description": { + "description": "A detailed description of each line item billed", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "period_end": { + "description": "The end timestamp of the billing period for the invoice in second", + "type": "integer" + }, + "period_start": { + "description": "The start timestamp of the billing period for the invoice in second", + "type": "integer" + }, + "status": { + "description": "The current state of the invoice", + "type": "string" + }, + "subtotal": { + "description": "The total cost of the invoice", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns a list of invoices", + "tags": [ + "billing" + ] + } + }, + "/v0/billing/payments": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/billing/v0-billing-payments" + }, + "operationId": "get_v0_billing_payments", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "payments": { + "description": "An array of payments associated with the account", + "items": { + "properties": { + "amount": { + "description": "The total amount of the payment", + "type": "string" + }, + "card_last_4": { + "description": "The last four digits of the card used for the payment (masked for security)", + "type": "string" + }, + "created_at": { + "description": "The timestamp when the payment was created in second", + "type": "string" + }, + "currency": { + "description": "The currency in which the payment was made", + "type": "string" + }, + "marketplace_amount": { + "description": "The total amount spent in the marketplace", + "type": "string" + }, + "status": { + "description": "The current status of the payment", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns a list of payments.", + "tags": [ + "billing" + ] + } + }, + "/v0/chains": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/chains/v0-chains" + }, + "operationId": "get_v0_chains", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of data which contains the following fields:", + "items": { + "properties": { + "is_select_chain": { + "type": "boolean" + }, + "networks": { + "description": "An array of networks", + "items": { + "properties": { + "chain_id": { + "type": "integer" + }, + "name": { + "description": "The name of the specific network", + "type": "string" + }, + "slug": { + "description": "A short, unique identifier for the specific network", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "slug": { + "description": "A short, unique identifier for the blockchain network", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns a list of chains.", + "tags": [ + "chains" + ] + } + }, + "/v0/endpoints": { + "get": { + "description": "Retrieves a list of endpoints. Supports searching, filtering, and sorting.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints" + }, + "operationId": "get_v0_endpoints", + "parameters": [ + { + "description": "Specifies the maximum number of endpoints to retrieve in the response. The default value is set to 20", + "in": "query", + "name": "limit", + "schema": { + "description": "Specifies the maximum number of endpoints to retrieve in the response. The default value is set to 20", + "type": "integer" + } + }, + { + "description": "Specifies the number of endpoints to skip before starting to retrieve the list", + "in": "query", + "name": "offset", + "schema": { + "description": "Specifies the number of endpoints to skip before starting to retrieve the list", + "type": "integer" + } + }, + { + "description": "Search endpoints by subdomain or label", + "in": "query", + "name": "search", + "schema": { + "description": "Search endpoints by subdomain or label", + "type": "string" + } + }, + { + "description": "Sort field. Accepted values: name, status, network, label, tags, usage, created_at. Default value: created_at", + "in": "query", + "name": "sort_by", + "schema": { + "description": "Sort field. Accepted values: name, status, network, label, tags, usage, created_at. Default value: created_at", + "type": "string" + } + }, + { + "description": "Sort direction. Accepted values: asc, desc. Default value: ASC", + "in": "query", + "name": "sort_direction", + "schema": { + "description": "Sort direction. Accepted values: asc, desc. Default value: ASC", + "type": "string" + } + }, + { + "description": "Filter by network name(s)", + "in": "query", + "name": "networks", + "schema": { + "description": "Filter by network name(s)", + "items": {}, + "type": "array" + } + }, + { + "description": "Filter by endpoint status. Accepted values: active, paused", + "in": "query", + "name": "statuses", + "schema": { + "description": "Filter by endpoint status. Accepted values: active, paused", + "items": {}, + "type": "array" + } + }, + { + "description": "Filter by endpoint label(s)", + "in": "query", + "name": "labels", + "schema": { + "description": "Filter by endpoint label(s)", + "items": {}, + "type": "array" + } + }, + { + "description": "Filter for dedicated endpoints only", + "in": "query", + "name": "dedicated", + "schema": { + "description": "Filter for dedicated endpoints only", + "type": "boolean" + } + }, + { + "description": "Filter for flat rate endpoints only", + "in": "query", + "name": "is_flat_rate", + "schema": { + "description": "Filter for flat rate endpoints only", + "type": "boolean" + } + }, + { + "description": "Filter endpoints by tag IDs. Can be a single integer or an array of integers. Optional. Cannot be used together with tag_labels", + "in": "query", + "name": "tag_ids", + "schema": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + { + "description": "Filter endpoints by tag labels. Can be a single string or an array of strings. Optional. Cannot be used together with tag_ids", + "in": "query", + "name": "tag_labels", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of data which contains the following fields:", + "items": { + "properties": { + "chain": { + "description": "The blockchain the endpoint is associated with", + "type": "string" + }, + "http_url": { + "description": "The HTTP URL to access the endpoint", + "type": "string" + }, + "id": { + "description": "A unique identifier for the specific endpoint", + "type": "string" + }, + "is_dedicated": { + "description": "Whether the endpoint is a dedicated endpoint", + "type": "boolean" + }, + "is_flat_rate": { + "description": "Whether the endpoint is a flat rate endpoint", + "type": "boolean" + }, + "is_multichain": { + "description": "Whether the endpoint is a multichain endpoint", + "type": "boolean" + }, + "label": { + "description": "A descriptive label for the endpoint", + "type": "string" + }, + "name": { + "description": "The endpoint subdomain", + "type": "string" + }, + "network": { + "description": "The specific network of the blockchain", + "type": "string" + }, + "status": { + "description": "The current status of the endpoint (active or paused)", + "type": "string" + }, + "tags": { + "description": "An array of tags associated with the endpoint", + "items": { + "properties": { + "label": { + "description": "The label/name of the tag", + "type": "string" + }, + "tag_id": { + "description": "The unique identifier for the tag", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "wss_url": { + "description": "The WebSocket URL to access the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + }, + "pagination": { + "description": "Pagination details for the response", + "properties": { + "limit": { + "description": "The maximum number of endpoints returned per page", + "type": "integer" + }, + "offset": { + "description": "The number of endpoints skipped", + "type": "integer" + }, + "total": { + "description": "The total number of endpoints matching the query", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves a list of endpoints.", + "tags": [ + "endpoints" + ] + }, + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-post" + }, + "operationId": "post_v0_endpoints", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "chain": { + "description": "The chain name for which the endpoint is to be created", + "type": "string" + }, + "network": { + "description": "The chain network for which the endpoint is to be created", + "type": "string" + } + }, + "required": [ + "chain", + "network" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "chain": { + "description": "The blockchain the endpoint is associated with", + "type": "string" + }, + "http_url": { + "description": "The HTTP URL to access the newly created endpoint", + "type": "string" + }, + "id": { + "description": "A unique identifier for the created endpoint", + "type": "string" + }, + "label": { + "description": "A descriptive label for the endpoint", + "type": "string" + }, + "network": { + "description": "The specific network of the blockchain", + "type": "string" + }, + "rate_limits": { + "description": "The rate_limits object which contains the following fields:", + "properties": { + "account": { + "description": "The account-level rate limit", + "type": "integer" + }, + "rate_limit_by_ip": { + "description": "Specifies if rate limiting is applied per IP", + "type": "boolean" + }, + "rpd": { + "description": "Requests per day limit", + "type": "integer" + }, + "rpm": { + "description": "Requests per minute limit", + "type": "integer" + }, + "rps": { + "description": "Requests per second limit", + "type": "integer" + } + }, + "type": "object" + }, + "security": { + "description": "The security object which contains the following fields:", + "properties": { + "domainMasks": { + "description": "An array of domain-based security configurations", + "items": { + "properties": { + "domain": { + "description": "The allowed domain for accessing the endpoint", + "type": "string" + }, + "id": { + "description": "A unique identifier for the domain mask", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "ips": { + "description": "An array of IP-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the IP configuration", + "type": "string" + }, + "ip": { + "description": "The allowed IP address for accessing the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "jwts": { + "description": "An array of JSON Web Token (JWT) configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the JWT", + "type": "string" + }, + "kid": { + "description": "A unique key identifier for the JWT public key", + "type": "string" + }, + "name": { + "description": "The name of the JWT", + "type": "string" + }, + "public_key": { + "description": "The public key used in the JWT", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "options": { + "description": "A list of security options available for the endpoint ", + "properties": { + "cors": { + "description": "Indicates whether Cross-Origin Resource Sharing (CORS) is enabled", + "type": "boolean" + }, + "debugAuthErrors": { + "description": "Indicates whether detailed authentication error debugging is enabled", + "type": "boolean" + }, + "domainMasks": { + "description": "Indicates whether domain mask security is enabled", + "type": "boolean" + }, + "enforceChainNetwork": { + "description": "Indicates whether the specified chain and network are enforced for the endpoint", + "type": "boolean" + }, + "hosts": { + "description": "Indicates whether host-based security is enabled", + "type": "boolean" + }, + "hsts": { + "description": "Indicates whether HTTP Strict Transport Security (HSTS) is enforced", + "type": "boolean" + }, + "ipCustomHeader": { + "description": "Indicates whether a custom IP header is applied", + "type": "boolean" + }, + "ips": { + "description": "Indicates whether IP-based security is enabled", + "type": "boolean" + }, + "jwts": { + "description": "Indicates whether JWT-based security is enabled", + "type": "boolean" + }, + "referrers": { + "description": "Indicates whether referrer-based security is enable", + "type": "boolean" + }, + "requestFilters": { + "description": "Indicates whether request filters are applied", + "type": "boolean" + }, + "tokens": { + "description": "Indicates whether token-based security is enabled", + "type": "boolean" + }, + "validHosts": { + "description": "Indicates whether only valid hosts are allowed", + "type": "boolean" + } + }, + "type": "object" + }, + "referrers": { + "description": "An array of referrer-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the referrer.", + "type": "string" + }, + "referrer": { + "description": "The referrer URL allowed to access the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "tokens": { + "description": "An array of token-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the token", + "type": "string" + }, + "token": { + "description": "The actual token value used for authentication", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "wss_url": { + "description": "The WebSocket URL to access the newly created endpoint", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/bulk/status": { + "post": { + "description": "Pause or unpause multiple endpoints in a single call. Admin-only.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-status" + }, + "operationId": "post_v0_endpoints_bulk_status", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "description": "An array of endpoint IDs to update", + "items": {}, + "type": "array" + }, + "status": { + "description": "The status to apply. Accepted values: active, paused", + "type": "string" + } + }, + "required": [ + "ids", + "status" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the result of the bulk status update", + "properties": { + "failed_count": { + "description": "The number of endpoints that failed to update", + "type": "integer" + }, + "results": { + "description": "An array of result objects for each endpoint", + "items": { + "properties": { + "id": { + "description": "The endpoint ID", + "type": "string" + }, + "success": { + "description": "Whether the status update succeeded for this endpoint", + "type": "boolean" + } + }, + "type": "object" + }, + "type": "array" + }, + "total": { + "description": "The total number of endpoints in the request", + "type": "integer" + }, + "updated_count": { + "description": "The number of endpoints successfully updated", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Pause or unpause multiple endpoints in a single call.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/bulk/tags": { + "delete": { + "description": "Remove a tag from multiple endpoints in a single call. Admin-only.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-tags-delete" + }, + "operationId": "delete_v0_endpoints_bulk_tags", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "description": "An array of endpoint IDs to remove the tag from", + "items": {}, + "type": "array" + }, + "tag_id": { + "description": "The ID of the tag to remove from the endpoints", + "type": "integer" + } + }, + "required": [ + "ids", + "tag_id" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the result of the bulk tag removal", + "properties": { + "failed_count": { + "description": "The number of endpoints that failed to update", + "type": "integer" + }, + "results": { + "description": "An array of result objects for each endpoint", + "items": { + "properties": { + "id": { + "description": "The endpoint ID", + "type": "string" + }, + "success": { + "description": "Whether the tag was successfully removed from this endpoint", + "type": "boolean" + } + }, + "type": "object" + }, + "type": "array" + }, + "total": { + "description": "The total number of endpoints in the request", + "type": "integer" + }, + "updated_count": { + "description": "The number of endpoints successfully updated", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Remove a tag from multiple endpoints in a single call.", + "tags": [ + "endpoints" + ] + }, + "post": { + "description": "Add a tag to multiple endpoints in a single call. Admin-only.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-tags-post" + }, + "operationId": "post_v0_endpoints_bulk_tags", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "description": "An array of endpoint IDs to tag", + "items": {}, + "type": "array" + }, + "label": { + "description": "The tag label to add to the endpoints", + "type": "string" + } + }, + "required": [ + "ids", + "label" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the result of the bulk tag operation", + "properties": { + "failed_count": { + "description": "The number of endpoints that failed to update", + "type": "integer" + }, + "results": { + "description": "An array of result objects for each endpoint", + "items": { + "properties": { + "id": { + "description": "The endpoint ID", + "type": "string" + }, + "success": { + "description": "Whether the tag was successfully added to this endpoint", + "type": "boolean" + } + }, + "type": "object" + }, + "type": "array" + }, + "tag": { + "description": "The tag that was added to the endpoints", + "properties": { + "label": { + "description": "The label/name of the tag", + "type": "string" + }, + "tag_id": { + "description": "The unique identifier of the tag", + "type": "integer" + } + }, + "type": "object" + }, + "total": { + "description": "The total number of endpoints in the request", + "type": "integer" + }, + "updated_count": { + "description": "The number of endpoints successfully updated", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Add a tag to multiple endpoints in a single call.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/tags": { + "get": { + "description": "Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags" + }, + "operationId": "get_v0_endpoints_tags", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the tags data", + "properties": { + "tags": { + "description": "An array of tag objects", + "items": { + "properties": { + "id": { + "description": "The unique identifier for the tag", + "type": "integer" + }, + "label": { + "description": "The label/name of the tag", + "type": "string" + }, + "usage_count": { + "description": "The number of endpoints associated with this tag", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns all account-level tags including those with zero endpoints.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/tags/{id}": { + "delete": { + "description": "Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags-id-delete" + }, + "operationId": "delete_v0_endpoints_tags_by_id", + "parameters": [ + { + "description": "The unique identifier for the tag to delete", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the tag to delete", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the result of the deletion", + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an account tag.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "description": "Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags-id-patch" + }, + "operationId": "patch_v0_endpoints_tags_by_id", + "parameters": [ + { + "description": "The unique identifier for the tag to rename", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the tag to rename", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "label": { + "description": "The new label for the tag", + "type": "string" + } + }, + "required": [ + "label" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the updated tag details", + "properties": { + "id": { + "description": "The unique identifier of the tag", + "type": "integer" + }, + "label": { + "description": "The updated label/name of the tag", + "type": "string" + }, + "usage_count": { + "description": "The number of endpoints currently using this tag", + "type": "integer" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Renames an account tag.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-delete" + }, + "operationId": "delete_v0_endpoints_by_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint that you want to delete", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint that you want to delete", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "description": "Indicates whether the endpoint was deleted", + "type": "boolean" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an endpoint.", + "tags": [ + "endpoints" + ] + }, + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id" + }, + "operationId": "get_v0_endpoints_by_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "chain": { + "description": "The blockchain the endpoint is associated with", + "type": "string" + }, + "http_url": { + "description": "The HTTP URL to access the newly created endpoint", + "type": "string" + }, + "id": { + "description": "A unique identifier for the created endpoint", + "type": "string" + }, + "is_multichain": { + "type": "boolean" + }, + "label": { + "description": "A descriptive label for the endpoint", + "type": "string" + }, + "network": { + "description": "The specific network of the blockchain", + "type": "string" + }, + "rate_limits": { + "description": "The rate_limits object which contains the following fields:", + "properties": { + "account": { + "description": "The account-level rate limit", + "type": "integer" + }, + "rate_limit_by_ip": { + "description": "Specifies if rate limiting is applied per IP", + "type": "boolean" + }, + "rpd": { + "description": "Requests per day limit", + "type": "integer" + }, + "rpm": { + "description": "Requests per minute limit", + "type": "integer" + }, + "rps": { + "description": "Requests per second limit", + "type": "integer" + } + }, + "type": "object" + }, + "security": { + "description": "The security object which contains the following fields:", + "properties": { + "domain_masks": { + "items": { + "properties": { + "domain": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "ips": { + "description": "An array of IP-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the IP configuration", + "type": "string" + }, + "ip": { + "description": "The allowed IP address for accessing the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "jwts": { + "description": "An array of JSON Web Token (JWT) configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the JWT", + "type": "string" + }, + "kid": { + "description": "A unique key identifier for the JWT public key", + "type": "string" + }, + "name": { + "description": "The name of the JWT", + "type": "string" + }, + "public_key": { + "description": "The public key used in the JWT", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "options": { + "properties": { + "cors": { + "type": "boolean" + }, + "domainMasks": { + "type": "boolean" + }, + "hsts": { + "type": "boolean" + }, + "ipCustomHeader": { + "properties": { + "value": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "ips": { + "type": "boolean" + }, + "jwts": { + "type": "boolean" + }, + "referrers": { + "type": "boolean" + }, + "requestFilters": { + "type": "boolean" + }, + "responseLogging": { + "type": "boolean" + }, + "tokens": { + "type": "boolean" + } + }, + "type": "object" + }, + "referrers": { + "description": "An array of referrer-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the referrer.", + "type": "string" + }, + "referrer": { + "description": "The referrer URL allowed to access the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "request_filters": { + "items": { + "properties": { + "id": { + "type": "string" + }, + "method": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "tokens": { + "description": "An array of token-based security configurations", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the token", + "type": "string" + }, + "token": { + "description": "The actual token value used for authentication", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "status": { + "description": "Current state of the endpoint — either `active` or `paused`", + "type": "string" + }, + "tags": { + "items": { + "properties": { + "label": { + "type": "string" + }, + "tag_id": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "wss_url": { + "description": "The WebSocket URL to access the newly created endpoint", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns info for a specific endpoint.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-patch" + }, + "operationId": "patch_v0_endpoints_by_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "label": { + "description": "A descriptive label for the endpoint which you need to update to", + "type": "string" + } + }, + "required": [ + "label" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Indicates whether the updation is done or not", + "type": "boolean" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Updates an endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/disable_multichain": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-disable_multichain" + }, + "operationId": "post_v0_endpoints_by_id_disable_multichain", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Returns true when multichain is successfully disabled", + "type": "boolean" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Disables multichain for a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/enable_multichain": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-enable_multichain" + }, + "operationId": "post_v0_endpoints_by_id_enable_multichain", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Returns true when multichain is successfully enabled", + "type": "boolean" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Enables multichain for a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/ip_custom_header": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-ip_custom_header-delete" + }, + "operationId": "delete_v0_endpoints_by_id_ip_custom_header", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Returns true when the IP custom header is successfully deleted", + "type": "boolean" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes the IP custom header for a specific endpoint.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-ip_custom_header-patch" + }, + "operationId": "patch_v0_endpoints_by_id_ip_custom_header", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "header_name": { + "description": "The name of the IP custom header", + "type": "string" + } + }, + "required": [ + "header_name" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the updated IP custom header details", + "properties": { + "header_name": { + "description": "The name of the IP custom header that was set", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates or updates an IP custom header for a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/log_details": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/logs/v0-endpoints-id-logs_details" + }, + "operationId": "get_v0_endpoints_by_id_log_details", + "parameters": [ + { + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)", + "type": "string" + } + }, + { + "description": "The UUID of the log entry", + "in": "query", + "name": "request_id", + "required": true, + "schema": { + "description": "The UUID of the log entry", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains detailed information about a specific log entry, including the raw request that was sent and the response that was received.", + "properties": { + "request": { + "description": "A JSON-encoded string representing the request payload that was sent in the original log entry. The logs are truncated after 2KB.", + "type": "string" + }, + "response": { + "description": "A JSON-encoded string containing the full response returned by the API or aggregator for the logged request. The logs are truncated after 2KB.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves detailed request and response information for a specific log entry.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/logs": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/logs/v0-endpoints-id-logs" + }, + "operationId": "get_v0_endpoints_by_id_logs", + "parameters": [ + { + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)", + "type": "string" + } + }, + { + "description": "The start timestamp encoded in ISO8601 format", + "in": "query", + "name": "from", + "required": true, + "schema": { + "description": "The start timestamp encoded in ISO8601 format", + "type": "string" + } + }, + { + "description": "The end timestamp encoded in ISO8601 format", + "in": "query", + "name": "to", + "required": true, + "schema": { + "description": "The end timestamp encoded in ISO8601 format", + "type": "string" + } + }, + { + "description": "Number of logs (1-100, default: 20)", + "in": "query", + "name": "limit", + "schema": { + "description": "Number of logs (1-100, default: 20)", + "type": "integer" + } + }, + { + "description": "Includes request/response details. The default value is set to be false", + "in": "query", + "name": "include_details", + "schema": { + "description": "Includes request/response details. The default value is set to be false", + "type": "boolean" + } + }, + { + "description": "Pagination token from previous response", + "in": "query", + "name": "next_at", + "schema": { + "description": "Pagination token from previous response", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of log entries which contains the following fields:", + "items": { + "properties": { + "details": { + "description": "Additional error details if available (nullable)", + "type": "string" + }, + "error_code": { + "description": "The application-specific error code returned", + "type": "integer" + }, + "http_method": { + "description": "The HTTP method used for the request", + "type": "string" + }, + "method": { + "description": "The name of the method invoked", + "type": "string" + }, + "network": { + "description": "The name of the network on which the method was called", + "type": "string" + }, + "request_id": { + "description": "The unique identifier for the request", + "type": "string" + }, + "status": { + "description": "The HTTP status code returned by the request", + "type": "integer" + }, + "timestamp": { + "description": "The timestamp when the log was recorded", + "type": "string" + }, + "url": { + "description": "The request URL", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "next_at": { + "description": "A cursor string used for pagination to fetch the next set of logs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves logs for a specific endpoint with filtering and pagination options.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/method-rate-limits": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits" + }, + "operationId": "get_v0_endpoints_by_id_method_rate_limits", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "rate_limiters": { + "description": "An array of rate limiter configurations", + "items": { + "properties": { + "created": { + "description": "The timestamp when the rate limiter was created in second", + "type": "string" + }, + "id": { + "description": "A unique identifier for the rate limiter", + "type": "string" + }, + "interval": { + "description": "The time interval for the rate limit", + "type": "string" + }, + "methods": { + "description": "A list of method names to which the rate limiter applies ", + "items": {}, + "type": "array" + }, + "rate": { + "description": "The number of allowed requests within the specified interval", + "type": "integer" + }, + "status": { + "description": "The current status of the rate limiter", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Gets method rate limits.", + "tags": [ + "endpoints" + ] + }, + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-post" + }, + "operationId": "post_v0_endpoints_by_id_method_rate_limits", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "interval": { + "description": "Specifies the time interval for the rate limit; valid values include second, minute or hour", + "type": "string" + }, + "methods": { + "description": "An array of method names to which the rate limiter applies", + "items": { + "type": "string" + }, + "type": "array" + }, + "rate": { + "description": " Specifies the maximum number of requests allowed for the specified methods within the defined interval", + "type": "integer" + } + }, + "required": [ + "interval", + "methods", + "rate" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "created": { + "description": "The timestamp when the rate limiter was created in second", + "type": "string" + }, + "id": { + "description": "A unique identifier for the rate limiter", + "type": "string" + }, + "interval": { + "description": "The time interval for the rate limit", + "type": "string" + }, + "methods": { + "description": "A list of methods the rate limiter applies to", + "items": {}, + "type": "array" + }, + "rate": { + "description": "The maximum number of requests allowed within the specified interval", + "type": "integer" + }, + "status": { + "description": "The current status of the rate limiter", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a method rate limit.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-method_rate_limit_id-delete" + }, + "operationId": "delete_v0_endpoints_by_id_method_rate_limits_by_method_rate_limit_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier for the rate limiter", + "in": "path", + "name": "method_rate_limit_id", + "required": true, + "schema": { + "description": "The unique identifier for the rate limiter", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "A message indicating the result of the operation", + "type": "string" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes a method rate limit.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-method_rate_limit_id" + }, + "operationId": "patch_v0_endpoints_by_id_method_rate_limits_by_method_rate_limit_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier for the rate limiter", + "in": "path", + "name": "method_rate_limit_id", + "required": true, + "schema": { + "description": "The unique identifier for the rate limiter", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "methods": { + "description": "An array of method names to which the rate limiter applies", + "items": {}, + "type": "array" + }, + "rate": { + "description": " Specifies the maximum number of requests allowed for the specified methods within the defined interval", + "type": "integer" + }, + "status": { + "description": "The current status of the rate limiter; valid values include enabled or disabled", + "type": "string" + } + }, + "required": [ + "status", + "methods", + "rate" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "created": { + "description": "The timestamp when the rate limiter was created in second", + "type": "string" + }, + "id": { + "description": "A unique identifier for the rate limiter", + "type": "string" + }, + "interval": { + "description": "The time interval for the rate limit", + "type": "string" + }, + "methods": { + "description": "A list of methods the rate limiter applies to", + "items": {}, + "type": "array" + }, + "rate": { + "description": "The maximum number of requests allowed within the specified interval", + "type": "integer" + }, + "status": { + "description": "The current status of the rate limiter", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Updates a method rate limit.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/metrics": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-metrics/v0-endpoints-id-metrics" + }, + "operationId": "get_v0_endpoints_by_id_metrics", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "Specifies the time period for which the data is to be retrieved. Valid values includes - hour, day, week or month", + "in": "query", + "name": "period", + "required": true, + "schema": { + "description": "Specifies the time period for which the data is to be retrieved. Valid values includes - hour, day, week or month", + "type": "string" + } + }, + { + "description": "Specifies the type of metric to retrieve. Valid values includes - method_calls_over_time, response_status_over_time, method_call_breakdown, response_status_breakdown or method_response_time_max", + "in": "query", + "name": "metric", + "required": true, + "schema": { + "description": "Specifies the type of metric to retrieve. Valid values includes - method_calls_over_time, response_status_over_time, method_call_breakdown, response_status_breakdown or method_response_time_max", + "type": "string" + } + }, + { + "description": "Required when metric is method_response_time_max. Selects the response time percentile to return. For example, 95 returns the response time at or below which 95% of observed RPC responses completed. Accepted values: integers from 1 to 100, such as 50, 95, or 99", + "in": "query", + "name": "percentile", + "schema": { + "description": "Required when metric is method_response_time_max. Selects the response time percentile to return. For example, 95 returns the response time at or below which 95% of observed RPC responses completed. Accepted values: integers from 1 to 100, such as 50, 95, or 99", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of data", + "items": { + "properties": { + "data": { + "description": "A nested list of numerical values representing the metric fetched for the endpoint", + "items": {}, + "type": "array" + }, + "tag": { + "description": "A string label that identifies or categorizes the specific metric", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "error": { + "description": "A string containing an error message if the request to fetch the metric fails", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns a single metric.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/rate-limits": { + "get": { + "description": "Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits-get" + }, + "operationId": "get_v0_endpoints_by_id_rate_limits", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the endpoint rate limit configuration", + "properties": { + "rate_limits": { + "description": "An array of endpoint rate limit configurations", + "items": { + "properties": { + "bucket": { + "description": "The rate limit bucket, such as rps, rpm, or rpd", + "type": "string" + }, + "id": { + "description": "The unique identifier for a user-set endpoint rate limit override. This field is returned for user_override rate limits and can be used to delete a specific endpoint rate limit.", + "type": "string" + }, + "rate_limit": { + "description": "The rate limit value for the bucket", + "type": "integer" + }, + "source": { + "description": "The source of the rate limit, such as plan_default or user_override", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Gets endpoint rate limits.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "description": "Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits" + }, + "operationId": "patch_v0_endpoints_by_id_rate_limits", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "rate_limits": { + "description": "Contains the rate limit configurations that you want to update", + "properties": { + "rpd": { + "description": "Specifies the maximum number of requests allowed per day", + "type": "integer" + }, + "rpm": { + "description": "Specifies the maximum number of requests allowed per minute", + "type": "integer" + }, + "rps": { + "description": "Specifies the maximum number of requests allowed per second", + "type": "integer" + } + }, + "type": "object" + } + }, + "required": [ + "rate_limits" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "limits": { + "description": "The limits object which contains the following fields:", + "properties": { + "rpd": { + "description": "The maximum number of requests allowed per day. A value of -1 indicates that no endpoint-level override is set for this bucket.", + "type": "integer" + }, + "rpm": { + "description": "The maximum number of requests allowed per minute. A value of -1 indicates that no endpoint-level override is set for this bucket.", + "type": "integer" + }, + "rps": { + "description": "The maximum number of requests allowed per second. A value of -1 indicates that no endpoint-level override is set for this bucket.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Updates endpoint rate limits.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/rate-limits/{override_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits-override_id-delete" + }, + "operationId": "delete_v0_endpoints_by_id_rate_limits_by_override_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier for the user-set endpoint rate limit override", + "in": "path", + "name": "override_id", + "required": true, + "schema": { + "description": "The unique identifier for the user-set endpoint rate limit override", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the result of the operation", + "properties": { + "success": { + "description": "Indicates whether the endpoint rate limit was deleted", + "type": "boolean" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes a user-set endpoint rate limit by UUID.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security": { + "get": { + "description": "Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-security" + }, + "operationId": "get_v0_endpoints_by_id_security", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the security state of the endpoint", + "properties": { + "domain_masks": { + "description": "An array of domain mask entries; null if none configured", + "items": {}, + "type": "array" + }, + "ips": { + "description": "An array of allowed IP entries; null if none configured", + "items": {}, + "type": "array" + }, + "jwts": { + "description": "An array of JWT configuration objects; null if none configured", + "items": {}, + "type": "array" + }, + "options": { + "description": "Security feature toggles for the endpoint", + "properties": { + "cors": { + "description": "Whether CORS is enabled", + "type": "boolean" + }, + "domainMasks": { + "description": "Whether domain mask restrictions are enabled", + "type": "boolean" + }, + "hsts": { + "description": "Whether HSTS is enabled", + "type": "boolean" + }, + "ipCustomHeader": { + "description": "IP custom header configuration", + "properties": { + "value": { + "description": "The IP custom header value; null if not set", + "type": "string" + } + }, + "type": "object" + }, + "ips": { + "description": "Whether IP-based restrictions are enabled", + "type": "boolean" + }, + "jwts": { + "description": "Whether JWT-based authentication is enabled", + "type": "boolean" + }, + "referrers": { + "description": "Whether referrer-based restrictions are enabled", + "type": "boolean" + }, + "requestFilters": { + "description": "Whether request filters are enabled", + "type": "boolean" + }, + "responseLogging": { + "description": "Whether response logging is enabled", + "type": "boolean" + }, + "tokens": { + "description": "Whether token-based authentication is enabled", + "type": "boolean" + } + }, + "type": "object" + }, + "referrers": { + "description": "An array of allowed referrer entries; null if none configured", + "items": {}, + "type": "array" + }, + "request_filters": { + "description": "An array of request filter objects; null if none configured", + "items": { + "properties": { + "id": { + "description": "The unique identifier (UUID) of the request filter", + "type": "string" + }, + "method": { + "description": "An array of whitelisted method names", + "items": {}, + "type": "array" + }, + "params": { + "description": "Parameter constraints for the filter", + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "tokens": { + "description": "An array of authentication token objects; null if none configured", + "items": { + "properties": { + "id": { + "description": "The unique identifier (UUID) of the token", + "type": "string" + }, + "token": { + "description": "The authentication token value", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/domain_masks": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-domain_masks" + }, + "operationId": "post_v0_endpoints_by_id_security_domain_masks", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "domain_mask": { + "description": "The domain mask that you will use to mask your endpoint", + "type": "string" + } + }, + "required": [ + "domain_mask" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "domain_mask": { + "description": "The domain mask that you used to mask your endpoint", + "type": "string" + }, + "id": { + "description": "A unique identifier for the domain mask", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Create an endpoint domain mask.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/domain_masks/{domain_mask_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-domain_masks-domain_mask_id" + }, + "operationId": "delete_v0_endpoints_by_id_security_domain_masks_by_domain_mask_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The specific domain mask ID that needs to be deleted", + "in": "path", + "name": "domain_mask_id", + "required": true, + "schema": { + "description": "The specific domain mask ID that needs to be deleted", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Represent successfully deleted the existing endpoint domain mask", + "type": "boolean" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an existing endpoint domain mask.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/ips": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-ips" + }, + "operationId": "post_v0_endpoints_by_id_security_ips", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ip": { + "description": "The specific IP address that is allowed to access the API endpoint. Only requests originating from this IP address will be permitted", + "type": "string" + } + }, + "required": [ + "ip" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "id": { + "description": "A unique identifier for the IP rule", + "type": "string" + }, + "ip": { + "description": "The IP address that is allowed to access the API endpoint", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint IP.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/ips/{ip_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-ips-ip_id" + }, + "operationId": "delete_v0_endpoints_by_id_security_ips_by_ip_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier of the endpoint IP entry that needs to be deleted", + "in": "path", + "name": "ip_id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint IP entry that needs to be deleted", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Represent successfully deleted the existing endpoint IP", + "type": "boolean" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an existing endpoint IP.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/jwts": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-jwts" + }, + "operationId": "post_v0_endpoints_by_id_security_jwts", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "kid": { + "description": "The key identifier (KID) associated with the public key", + "type": "string" + }, + "name": { + "description": "A human-readable name for the JWT configuration", + "type": "string" + }, + "public_key": { + "description": "The public key used to verify the JWT token", + "type": "string" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "id": { + "description": "A unique identifier for the JWT configuration", + "type": "string" + }, + "kid": { + "description": "The key identifier (KID) associated with the public key", + "type": "string" + }, + "name": { + "description": "A human-readable name for the JWT configuration", + "type": "string" + }, + "public_key": { + "description": "The public key used to verify the JWT token", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint JWT.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/jwts/{jwt_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-jwts-jwt_id" + }, + "operationId": "delete_v0_endpoints_by_id_security_jwts_by_jwt_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "A unique identifier for the JWT which needs to be deleted", + "in": "path", + "name": "jwt_id", + "required": true, + "schema": { + "description": "A unique identifier for the JWT which needs to be deleted", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Represent successfully deleted the existing endpoint jwt", + "type": "boolean" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an existing endpoint JWT.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/referrers": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-referrers" + }, + "operationId": "post_v0_endpoints_by_id_security_referrers", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "referrer": { + "description": "The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted", + "type": "string" + } + }, + "required": [ + "referrer" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "id": { + "description": "A unique identifier for the referrer", + "type": "string" + }, + "referrer": { + "description": "The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint referrer.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/referrers/{referrer_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-referrers-referrer_id" + }, + "operationId": "delete_v0_endpoints_by_id_security_referrers_by_referrer_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The referrer_id which needs to be deleted", + "in": "path", + "name": "referrer_id", + "required": true, + "schema": { + "description": "The referrer_id which needs to be deleted", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Represent successfully deleted the existing endpoint referrer", + "type": "boolean" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an existing endpoint referrer.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/request_filters": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-post" + }, + "operationId": "post_v0_endpoints_by_id_security_request_filters", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "method": { + "description": "An array of method names to whitelist", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the created request filter details", + "properties": { + "id": { + "description": "The unique identifier (UUID) of the newly created request filter", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint request filter for method whitelisting.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/request_filters/{request_filter_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-request_filter_id-delete" + }, + "operationId": "delete_v0_endpoints_by_id_security_request_filters_by_request_filter_id", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier of the request filter to delete", + "in": "path", + "name": "request_filter_id", + "required": true, + "schema": { + "description": "The unique identifier of the request filter to delete", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Returns HTTP 204 No Content on successful deletion. The response body is empty." + } + }, + "summary": "Deletes an existing endpoint request filter.", + "tags": [ + "endpoints" + ] + }, + "put": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-request_filter_id-put" + }, + "operationId": "put_v0_endpoints_by_id_security_request_filters_by_request_filter_id", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier of the request filter to update", + "in": "path", + "name": "request_filter_id", + "required": true, + "schema": { + "description": "The unique identifier of the request filter to update", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "method": { + "description": "An array of method names to whitelist", + "items": {}, + "type": "array" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "Returns HTTP 204 No Content on successful update. The response body is empty." + } + }, + "summary": "Updates an existing endpoint request filter.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/tokens": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-tokens" + }, + "operationId": "post_v0_endpoints_by_id_security_tokens", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "id": { + "description": "A unique identifier for the token", + "type": "string" + }, + "token": { + "description": "The generated token string used for authentication", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new endpoint authentication token.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security/tokens/{token_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-tokens-token_id" + }, + "operationId": "delete_v0_endpoints_by_id_security_tokens_by_token_id", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + }, + { + "description": "The specific token id that needs to be deleted", + "in": "path", + "name": "token_id", + "required": true, + "schema": { + "description": "The specific token id that needs to be deleted", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Represent successfully deleted the existing endpoint token", + "type": "boolean" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an existing endpoint token.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/security_options": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security_options" + }, + "operationId": "get_v0_endpoints_by_id_security_options", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "option": { + "description": "Represents the security options", + "type": "string" + }, + "status": { + "description": "Indicates the status of the option. Possible values: enabled, disabled", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Gets security options for an endpoint.", + "tags": [ + "endpoints" + ] + }, + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security_options-patch" + }, + "operationId": "patch_v0_endpoints_by_id_security_options", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "options": { + "description": "The options object which contains the following fields:", + "properties": { + "cors": { + "description": "Configures Cross-Origin Resource Sharing (CORS) policies to control how resources can be accessed by external domains. Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "domainMasks": { + "description": "Configures the masking or restriction of specific domains. Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "hsts": { + "description": "The HTTP Strict Transport Security (HSTS). Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "ips": { + "description": "Specifies IP address-based restrictions or permissions. Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "jwts": { + "description": "Configures JSON Web Tokens (JWTs) for secure authentication and authorization. Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "referrers": { + "description": "The URL or domain that is allowed to access the specific API endpoint. Possible values includes 'enabled' or 'disabled'", + "type": "string" + }, + "tokens": { + "description": "Controls the token-based authentication mechanism. Possible values includes 'enabled' or 'disabled'", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "option": { + "description": "Represents the security options", + "type": "string" + }, + "status": { + "description": "Indicates the status of the option. Possible values: enabled, disabled", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Updates security options for an endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/status": { + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-status" + }, + "operationId": "patch_v0_endpoints_by_id_status", + "parameters": [ + { + "description": "The unique identifier of the endpoint to be updated", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint to be updated", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "description": "The new status to apply to the endpoint. Accepted values are 'active' and 'paused'", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The updated status of the endpoint (either 'active' or 'paused')", + "type": "string" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused'", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/tags": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags" + }, + "operationId": "get_v0_endpoints_by_id_tags", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "tags": { + "description": "An array of tags associated with the endpoint", + "items": { + "properties": { + "account_id": { + "description": "The account identifier associated with the tag", + "type": "integer" + }, + "created_at": { + "description": "The timestamp when the tag was created", + "type": "string" + }, + "endpoint_id": { + "description": "The endpoint identifier associated with the tag", + "type": "integer" + }, + "id": { + "description": "The unique identifier for the endpoint-tag relationship", + "type": "integer" + }, + "label": { + "description": "The label/name of the tag", + "type": "string" + }, + "tag_id": { + "description": "The unique identifier for the tag", + "type": "integer" + }, + "updated_at": { + "description": "The timestamp when the tag was last updated", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns all tags for a specific endpoint.", + "tags": [ + "endpoints" + ] + }, + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags-post" + }, + "operationId": "post_v0_endpoints_by_id_tags", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "label": { + "description": "The label/name for the new tag", + "type": "string" + } + }, + "required": [ + "label" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "tags": { + "description": "An array containing the newly created tag", + "items": { + "properties": { + "account_id": { + "description": "The account identifier associated with the tag", + "type": "integer" + }, + "created_at": { + "description": "The timestamp when the tag was created", + "type": "string" + }, + "endpoint_id": { + "description": "The endpoint identifier associated with the tag", + "type": "integer" + }, + "id": { + "description": "The unique identifier for the endpoint-tag relationship", + "type": "integer" + }, + "label": { + "description": "The label/name of the newly created tag", + "type": "string" + }, + "tag_id": { + "description": "The unique identifier for the newly created tag", + "type": "integer" + }, + "updated_at": { + "description": "The timestamp when the tag was last updated", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new tag for a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/tags/{tag_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags-tag_id-delete" + }, + "operationId": "delete_v0_endpoints_by_id_tags_by_tag_id", + "parameters": [ + { + "description": "The unique identifier of the endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the endpoint", + "type": "string" + } + }, + { + "description": "The unique identifier of the tag to remove", + "in": "path", + "name": "tag_id", + "required": true, + "schema": { + "description": "The unique identifier of the tag to remove", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains the result of the tag deletion", + "properties": { + "success": { + "description": "Whether the tag was successfully deleted from the endpoint", + "type": "boolean" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes a tag from a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/endpoints/{id}/urls": { + "get": { + "description": "Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-urls" + }, + "operationId": "get_v0_endpoints_by_id_urls", + "parameters": [ + { + "description": "The unique identifier for the specific endpoint", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the specific endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "http_url": { + "description": "The HTTP URL to access the endpoint", + "type": "string" + }, + "multichain_urls": { + "description": "Only present for multichain endpoints. An object keyed by network identifier (e.g. `avalanche-mainnet`), where each value contains the HTTP and WebSocket URLs for that network.", + "properties": { + "{network}": { + "description": "Per-network URL entry. The key is the network identifier (e.g. `avalanche-mainnet`).", + "properties": { + "http_url": { + "description": "The HTTP URL to access the endpoint on this network", + "type": "string" + }, + "wss_url": { + "description": "The WebSocket URL to access the endpoint on this network", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "wss_url": { + "description": "The WebSocket URL to access the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error information, if any", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns the URLs for a specific endpoint.", + "tags": [ + "endpoints" + ] + } + }, + "/v0/metrics": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/account-metrics/v0-metrics" + }, + "operationId": "get_v0_metrics", + "parameters": [ + { + "description": "The time period for the metrics. Accepted values: hour, day, week, month", + "in": "query", + "name": "period", + "required": true, + "schema": { + "description": "The time period for the metrics. Accepted values: hour, day, week, month", + "type": "string" + } + }, + { + "description": "The metric to retrieve. Accepted values: method_calls_over_time, metered_endpoint_data_over_time, metered_endpoint_credits_over_time, credits_over_time", + "in": "query", + "name": "metric", + "required": true, + "schema": { + "description": "The metric to retrieve. Accepted values: method_calls_over_time, metered_endpoint_data_over_time, metered_endpoint_credits_over_time, credits_over_time", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of metric objects, each containing a tag and its associated data points", + "items": { + "properties": { + "data": { + "description": "An array of [timestamp, value] pairs representing the metric data points", + "items": {}, + "type": "array" + }, + "tag": { + "description": "An array of strings identifying the metric group (e.g., network name)", + "items": {}, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Fetches metrics aggregated across all endpoints for an account.", + "tags": [ + "metrics" + ] + } + }, + "/v0/teams": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams" + }, + "operationId": "get_v0_teams", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of team objects containing the following fields:", + "items": { + "properties": { + "id": { + "description": "A unique identifier for the team", + "type": "integer" + }, + "members_count": { + "description": "The number of members in the team", + "type": "integer" + }, + "name": { + "description": "The name of the team", + "type": "string" + }, + "users": { + "description": "An array of user objects in the team", + "items": { + "properties": { + "created_at": { + "description": "The timestamp when the user was added to the team", + "type": "string" + }, + "email": { + "description": "The email address of the user", + "type": "string" + }, + "full_name": { + "description": "The full name of the user", + "type": "string" + }, + "id": { + "description": "A unique identifier for the user", + "type": "integer" + }, + "photo_url": { + "description": "The URL of the user's profile photo", + "type": "string" + }, + "role": { + "description": "The role of the user in the team (admin, viewer, or billing)", + "type": "string" + }, + "status": { + "description": "The status of the user (e.g., Active, Pending)", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves a list of all teams.", + "tags": [ + "teams" + ] + }, + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-post" + }, + "operationId": "post_v0_teams", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name for the new team", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The created team object containing the following fields:", + "properties": { + "default_role": { + "description": "The default role assigned to new team members (admin, viewer, or billing)", + "type": "string" + }, + "id": { + "description": "A unique identifier for the created team", + "type": "integer" + }, + "members_count": { + "description": "The number of members in the team", + "type": "integer" + }, + "name": { + "description": "The name of the created team", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Creates a new team.", + "tags": [ + "teams" + ] + } + }, + "/v0/teams/{id}": { + "delete": { + "description": "Deletes an empty team. The team must have no members before it can be deleted.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-delete" + }, + "operationId": "delete_v0_teams_by_id", + "parameters": [ + { + "description": "The unique identifier for the team to delete", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team to delete", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The response object containing the following fields:", + "properties": { + "message": { + "description": "A message confirming the team was deleted successfully", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Deletes an empty team.", + "tags": [ + "teams" + ] + }, + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id" + }, + "operationId": "get_v0_teams_by_id", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The team object containing the following fields:", + "properties": { + "default_role": { + "description": "The default role assigned to new team members (admin, viewer, or billing)", + "type": "string" + }, + "id": { + "description": "A unique identifier for the team", + "type": "integer" + }, + "members_count": { + "description": "The number of members in the team", + "type": "integer" + }, + "name": { + "description": "The name of the team", + "type": "string" + }, + "pending_invites": { + "description": "An array of pending invite objects", + "items": { + "properties": { + "account_primary_user": { + "description": "Indicates if the invited user will be the primary account user", + "type": "boolean" + }, + "created_at": { + "description": "The timestamp when the invite was created", + "type": "string" + }, + "email": { + "description": "The email address of the invited user", + "type": "string" + }, + "full_name": { + "description": "The full name of the invited user", + "type": "string" + }, + "id": { + "description": "A unique identifier for the pending invite", + "type": "integer" + }, + "photo_url": { + "description": "The URL of the invited user's profile photo", + "type": "string" + }, + "role": { + "description": "The role assigned to the invited user (admin, viewer, or billing)", + "type": "string" + }, + "status": { + "description": "The status of the invite (e.g., Pending)", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "users": { + "description": "An array of active user objects in the team", + "items": { + "properties": { + "account_primary_user": { + "description": "Indicates if the user is the primary account user", + "type": "boolean" + }, + "created_at": { + "description": "The timestamp when the user was added to the team", + "type": "string" + }, + "email": { + "description": "The email address of the user", + "type": "string" + }, + "full_name": { + "description": "The full name of the user", + "type": "string" + }, + "id": { + "description": "A unique identifier for the user", + "type": "integer" + }, + "photo_url": { + "description": "The URL of the user's profile photo", + "type": "string" + }, + "role": { + "description": "The role of the user in the team (admin, viewer, or billing)", + "type": "string" + }, + "status": { + "description": "The status of the user (e.g., Active)", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves details for a specific team.", + "tags": [ + "teams" + ] + } + }, + "/v0/teams/{id}/endpoints": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-endpoints" + }, + "operationId": "get_v0_teams_by_id_endpoints", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An array of endpoint objects containing the following fields:", + "items": { + "properties": { + "chain": { + "description": "The blockchain the endpoint is associated with", + "type": "string" + }, + "id": { + "description": "A unique identifier for the endpoint", + "type": "integer" + }, + "network": { + "description": "The specific network of the blockchain", + "type": "string" + }, + "subdomain": { + "description": "The subdomain name of the endpoint", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves a list of endpoints accessible to a team.", + "tags": [ + "teams" + ] + }, + "patch": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-endpoints-patch" + }, + "operationId": "patch_v0_teams_by_id_endpoints", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "endpoint_ids": { + "description": "An array of endpoint IDs to assign to the team. Pass an empty array to unassign all endpoints", + "items": {}, + "type": "array" + } + }, + "required": [ + "endpoint_ids" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The response object containing the following fields:", + "properties": { + "success": { + "description": "Indicates whether the operation was successful", + "type": "boolean" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Assigns or unassigns endpoints to a team.", + "tags": [ + "teams" + ] + } + }, + "/v0/teams/{id}/members": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-post" + }, + "operationId": "post_v0_teams_by_id_members", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "email": { + "description": "The email address of the user to invite", + "type": "string" + }, + "full_name": { + "description": "The full name of the user to invite (required only for new users)", + "type": "string" + }, + "role": { + "description": "The role to assign to the invited user. Valid values: admin, viewer, billing. Required only for new users", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The invited user object containing the following fields:", + "properties": { + "email": { + "description": "The email address of the invited user", + "type": "string" + }, + "full_name": { + "description": "The full name of the invited user", + "type": "string" + }, + "id": { + "description": "A unique identifier for the invited user", + "type": "integer" + }, + "role": { + "description": "The role assigned to the invited user (admin, viewer, or billing)", + "type": "string" + }, + "status": { + "description": "The status of the invitation (e.g., Active, Pending)", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Invites a user to a team.", + "tags": [ + "teams" + ] + } + }, + "/v0/teams/{id}/members/{user_id}": { + "delete": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-user_id-delete" + }, + "operationId": "delete_v0_teams_by_id_members_by_user_id", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + }, + { + "description": "The unique identifier for the user to remove", + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "description": "The unique identifier for the user to remove", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The response object containing the following fields:", + "properties": { + "message": { + "description": "A message confirming the user was removed successfully", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Removes a user from a team.", + "tags": [ + "teams" + ] + } + }, + "/v0/teams/{id}/members/{user_id}/resend_invite": { + "post": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-user_id-resend_invite" + }, + "operationId": "post_v0_teams_by_id_members_by_user_id_resend_invite", + "parameters": [ + { + "description": "The unique identifier for the team", + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier for the team", + "type": "integer" + } + }, + { + "description": "The unique identifier for the user to resend the invitation to", + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "description": "The unique identifier for the user to resend the invitation to", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The response object containing the following fields:", + "properties": { + "message": { + "description": "A message confirming the invitation was resent successfully", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Resends an invitation email to a pending team member.", + "tags": [ + "teams" + ] + } + }, + "/v0/tooling-access": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access" + }, + "operationId": "get_v0_tooling_access", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An object which contains the following fields:", + "properties": { + "enabled": { + "description": "Whether Tooling Access is currently enabled for the account", + "type": "boolean" + }, + "enabled_at": { + "description": "The timestamp when Tooling Access was enabled", + "type": "string" + }, + "endpoint_id": { + "description": "The unique identifier of the endpoint provisioned for Tooling Access", + "type": "integer" + }, + "endpoint_url": { + "description": "The URL of the endpoint provisioned for Tooling Access. May be present even when disabled if the account was previously provisioned", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Returns whether Tooling Access is enabled for the account.", + "tags": [ + "tooling-access" + ] + }, + "patch": { + "description": "Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access-patch" + }, + "operationId": "patch_v0_tooling_access", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "enabled": { + "description": "Set to true to enable (provision/reactivate) Tooling Access or false to disable it", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An object which contains the following fields:", + "properties": { + "enabled": { + "description": "Whether Tooling Access is enabled after the update", + "type": "boolean" + }, + "endpoint_url": { + "description": "The URL of the endpoint provisioned for Tooling Access", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Enable (provision/reactivate) or disable Tooling Access for the account.", + "tags": [ + "tooling-access" + ] + } + }, + "/v0/tooling-access/token": { + "post": { + "description": "Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access-token-post" + }, + "operationId": "post_v0_tooling_access_token", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "An object which contains the following fields:", + "properties": { + "endpoint_url": { + "description": "The URL of the Tooling Access endpoint the token authenticates against", + "type": "string" + }, + "expires_at": { + "description": "The timestamp when the token expires", + "type": "string" + }, + "token": { + "description": "The short-lived ES256 JWT used to authenticate RPC calls", + "type": "string" + } + }, + "type": "object" + }, + "error": { + "description": "An error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Mints a short-lived ES256 JWT for authenticating data-plane RPC calls.", + "tags": [ + "tooling-access" + ] + } + }, + "/v0/usage/rpc": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc" + }, + "operationId": "get_v0_usage_rpc", + "parameters": [ + { + "description": "Specifies the start of the time period for which the usage data is to be retrieved", + "in": "query", + "name": "start_time", + "schema": { + "description": "Specifies the start of the time period for which the usage data is to be retrieved", + "type": "integer" + } + }, + { + "description": "Specifies the end of the time period for which the usage data is to be retrieved", + "in": "query", + "name": "end_time", + "schema": { + "description": "Specifies the end of the time period for which the usage data is to be retrieved", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "credits_remaining": { + "description": "The number of credits remaining in the account", + "type": "integer" + }, + "credits_used": { + "description": "The number of credits used within the specified time period", + "type": "integer" + }, + "end_time": { + "description": "The end timestamp for the usage data in second in second", + "type": "integer" + }, + "limit": { + "description": "The maximum number of credits available", + "type": "integer" + }, + "overages": { + "description": "The number of credits used beyond the limit", + "type": "integer" + }, + "start_time": { + "description": "The start timestamp for the usage data in second in second", + "type": "integer" + } + }, + "type": "object" + }, + "error": { + "description": "A string containing an error message, if any issues occur during the request", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves usage total for specified time range.", + "tags": [ + "usage" + ] + } + }, + "/v0/usage/rpc/by-chain": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-chain" + }, + "operationId": "get_v0_usage_rpc_by_chain", + "parameters": [ + { + "description": "Specifies the start of the time period for which the usage data is to be retrieved", + "in": "query", + "name": "start_time", + "schema": { + "description": "Specifies the start of the time period for which the usage data is to be retrieved", + "type": "integer" + } + }, + { + "description": "Specifies the end of the time period for which the usage data is to be retrieved", + "in": "query", + "name": "end_time", + "schema": { + "description": "Specifies the end of the time period for which the usage data is to be retrieved", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "chains": { + "description": "An array of blockchains and their corresponding credit usage", + "items": { + "properties": { + "bytes": { + "description": "The total number of data bytes transferred on the specified blockchain (for example, Streams and Yellowstone gRPC data). Contributes to data_credits", + "type": "integer" + }, + "credits_used": { + "description": "The number of credits used by the specified blockchain (RPC credits and data credits combined)", + "type": "integer" + }, + "data_credits": { + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred", + "type": "integer" + }, + "name": { + "description": "The name of the blockchain", + "type": "string" + }, + "rpc_credits": { + "description": "The portion of credits_used consumed by RPC requests", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "end_time": { + "description": "The end timestamp for the data in second in second", + "type": "integer" + }, + "start_time": { + "description": "The start timestamp for the data in second in second", + "type": "integer" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves usage data by chain.", + "tags": [ + "usage" + ] + } + }, + "/v0/usage/rpc/by-endpoint": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-endpoint" + }, + "operationId": "get_v0_usage_rpc_by_endpoint", + "parameters": [ + { + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "in": "query", + "name": "start_time", + "schema": { + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "type": "integer" + } + }, + { + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "in": "query", + "name": "end_time", + "schema": { + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "end_time": { + "description": "The end timestamp for the data in second in second", + "type": "integer" + }, + "endpoints": { + "description": "An array of endpoints which contains the following fields:", + "items": { + "properties": { + "bytes": { + "description": "The total number of data bytes transferred by the endpoint (for example, Streams and Yellowstone gRPC data). Contributes to data_credits", + "type": "integer" + }, + "chain": { + "description": "The blockchain associated with the endpoint", + "type": "string" + }, + "credits_used": { + "description": "The total number of credits used by the endpoint (RPC credits and data credits combined)", + "type": "integer" + }, + "data_credits": { + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred", + "type": "integer" + }, + "label": { + "description": "A custom label for the endpoint", + "type": "string" + }, + "methods_breakdown": { + "description": "An array of methods_breakdown", + "items": { + "properties": { + "archive": { + "description": "Indicates whether the request is using archived data", + "type": "boolean" + }, + "bytes": { + "description": "The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe)", + "type": "integer" + }, + "credits_used": { + "description": "The number of credits used by the method (RPC credits and data credits combined)", + "type": "integer" + }, + "method_name": { + "description": "The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name of the endpoint", + "type": "string" + }, + "network": { + "description": "The specific network on the blockchain", + "type": "string" + }, + "requests": { + "description": "The total number of requests made to the endpoint", + "type": "integer" + }, + "rpc_credits": { + "description": "The portion of credits_used consumed by RPC requests", + "type": "integer" + }, + "status": { + "description": "The current state of the RPC endpoint. Possible values include: active, archived, paused or terminated", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "start_time": { + "description": "The start timestamp for the data in second in second", + "type": "integer" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves usage data by endpoint.", + "tags": [ + "usage" + ] + } + }, + "/v0/usage/rpc/by-method": { + "get": { + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-method" + }, + "operationId": "get_v0_usage_rpc_by_method", + "parameters": [ + { + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "in": "query", + "name": "start_time", + "schema": { + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "type": "integer" + } + }, + { + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "in": "query", + "name": "end_time", + "schema": { + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization.", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data object which contains the following fields:", + "properties": { + "end_time": { + "description": "The end timestamp for the data in second", + "type": "integer" + }, + "methods": { + "description": "An array of method calls and their corresponding credit usage", + "items": { + "properties": { + "archive": { + "description": "Indicates whether the request used archived data", + "type": "boolean" + }, + "bytes": { + "description": "The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe)", + "type": "integer" + }, + "credits_used": { + "description": "The number of credits used by the method (RPC credits and data credits combined)", + "type": "integer" + }, + "method_name": { + "description": "The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "start_time": { + "description": "The start timestamp for the data in second", + "type": "integer" + } + }, + "type": "object" + }, + "error": { + "description": "A field containing an error message if any issue occurs", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves usage data by method.", + "tags": [ + "usage" + ] + } + }, + "/v0/usage/rpc/by-tag": { + "get": { + "description": "Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags.", + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-tag" + }, + "operationId": "get_v0_usage_rpc_by_tag", + "parameters": [ + { + "description": "Start time as a unix timestamp", + "in": "query", + "name": "start_time", + "schema": { + "description": "Start time as a unix timestamp", + "type": "integer" + } + }, + { + "description": "End time as a unix timestamp", + "in": "query", + "name": "end_time", + "schema": { + "description": "End time as a unix timestamp", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "Contains usage data grouped by tag", + "properties": { + "end_time": { + "description": "The end time of the usage period as a unix timestamp", + "type": "integer" + }, + "start_time": { + "description": "The start time of the usage period as a unix timestamp", + "type": "integer" + }, + "tags": { + "description": "An array of usage data objects, one per tag", + "items": { + "properties": { + "bytes": { + "description": "The total number of data bytes transferred by endpoints with this tag (for example, Streams and Yellowstone gRPC data). Contributes to data_credits", + "type": "integer" + }, + "credits_used": { + "description": "The total number of credits used by endpoints with this tag (RPC credits and data credits combined)", + "type": "integer" + }, + "data_credits": { + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred", + "type": "integer" + }, + "label": { + "description": "The label/name of the tag", + "type": "string" + }, + "requests": { + "description": "The total number of requests made by endpoints with this tag", + "type": "integer" + }, + "rpc_credits": { + "description": "The portion of credits_used consumed by RPC requests", + "type": "integer" + }, + "tag_id": { + "description": "The unique identifier of the tag", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "error": { + "description": "Contains error details if the request failed; null if successful", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Successful response" + } + }, + "summary": "Retrieves usage data grouped by tag.", + "tags": [ + "usage" + ] + } + } + }, + "security": [ + { + "apiKeyAuth": [] + } + ], + "servers": [ + { + "description": "Quicknode Admin API", + "url": "https://api.quicknode.com" + } + ] +} diff --git a/api/admin/openapi.upstream.json b/api/admin/openapi.upstream.json new file mode 100644 index 0000000..aa606b9 --- /dev/null +++ b/api/admin/openapi.upstream.json @@ -0,0 +1,5826 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Admin API", + "description": "Quicknode Admin API reference", + "version": "1.0.0" + }, + "paths": { + "/v0/account/info": { + "get": { + "operationId": "get_v0_account_info", + "summary": "Returns information about the account associated with the API key.", + "tags": [ + "account" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/account/v0-account-info" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier for the account" + }, + "name": { + "type": "string", + "description": "The name of the account" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the account was created" + }, + "billing_version": { + "type": "string", + "description": "The billing version associated with the account" + }, + "subscription": { + "type": "object", + "properties": { + "plan_name": { + "type": "string", + "description": "The name of the subscription plan" + }, + "status": { + "type": "string", + "description": "The status of the subscription" + }, + "interval": { + "type": "string", + "description": "The billing interval of the subscription" + } + }, + "description": "An object containing the account's subscription details:" + } + }, + "description": "An object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/metrics": { + "get": { + "operationId": "get_v0_metrics", + "summary": "Fetches metrics aggregated across all endpoints for an account.", + "tags": [ + "metrics" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/account-metrics/v0-metrics" + }, + "parameters": [ + { + "name": "period", + "in": "query", + "schema": { + "type": "string", + "description": "The time period for the metrics. Accepted values: hour, day, week, month" + }, + "required": true, + "description": "The time period for the metrics. Accepted values: hour, day, week, month" + }, + { + "name": "metric", + "in": "query", + "schema": { + "type": "string", + "description": "The metric to retrieve. Accepted values: method_calls_over_time, metered_endpoint_data_over_time, metered_endpoint_credits_over_time, credits_over_time" + }, + "required": true, + "description": "The metric to retrieve. Accepted values: method_calls_over_time, metered_endpoint_data_over_time, metered_endpoint_credits_over_time, credits_over_time" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag": { + "type": "array", + "items": {}, + "description": "An array of strings identifying the metric group (e.g., network name)" + }, + "data": { + "type": "array", + "items": {}, + "description": "An array of [timestamp, value] pairs representing the metric data points" + } + } + }, + "description": "An array of metric objects, each containing a tag and its associated data points" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/api-credits/{chain}": { + "get": { + "operationId": "get_v0_api_credits_by_chain", + "summary": "Returns the API credit cost of each RPC method available on a chain.", + "tags": [ + "api-credits" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/api-credits/v0-api-credits-chain" + }, + "description": "Returns the API credit cost of each RPC method available on a chain. Credit costs are calculated using the account's billing version.", + "parameters": [ + { + "name": "chain", + "in": "path", + "schema": { + "type": "string", + "description": "The chain slug from the GET /v0/chains response" + }, + "required": true, + "description": "The chain slug from the GET /v0/chains response" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "The name of the RPC method" + }, + "credits": { + "type": "integer", + "description": "The API credit cost of the method for the account's billing version" + } + } + }, + "description": "An array of data which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/billing/invoices": { + "get": { + "operationId": "get_v0_billing_invoices", + "summary": "Returns a list of invoices", + "tags": [ + "billing" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/billing/v0-billing-invoices" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "invoices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier for the invoice" + }, + "status": { + "type": "string", + "description": "The current state of the invoice" + }, + "billing_reason": { + "type": "string", + "description": "The reason for generating the invoice" + }, + "amount_due": { + "type": "integer", + "description": "The total amount that is due on the invoice" + }, + "amount_paid": { + "type": "integer", + "description": "The total amount that has been paid for the invoice" + }, + "subtotal": { + "type": "integer", + "description": "The total cost of the invoice" + }, + "lines": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "A detailed description of each line item billed" + }, + "amount": { + "type": "integer", + "description": "The cost associated with each line item" + } + } + }, + "description": "An array of lines which contains the following fields:" + }, + "period_end": { + "type": "integer", + "description": "The end timestamp of the billing period for the invoice in second" + }, + "period_start": { + "type": "integer", + "description": "The start timestamp of the billing period for the invoice in second" + }, + "created": { + "type": "integer", + "description": "The timestamp when the invoice was created in second" + } + } + }, + "description": "An array of invoices" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/billing/payments": { + "get": { + "operationId": "get_v0_billing_payments", + "summary": "Returns a list of payments.", + "tags": [ + "billing" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/billing/v0-billing-payments" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "payments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "The total amount of the payment" + }, + "card_last_4": { + "type": "string", + "description": "The last four digits of the card used for the payment (masked for security)" + }, + "status": { + "type": "string", + "description": "The current status of the payment" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the payment was created in second" + }, + "currency": { + "type": "string", + "description": "The currency in which the payment was made" + }, + "marketplace_amount": { + "type": "string", + "description": "The total amount spent in the marketplace" + } + } + }, + "description": "An array of payments associated with the account" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/chains": { + "get": { + "operationId": "get_v0_chains", + "summary": "Returns a list of chains.", + "tags": [ + "chains" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/chains/v0-chains" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "A short, unique identifier for the blockchain network" + }, + "networks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "A short, unique identifier for the specific network" + }, + "name": { + "type": "string", + "description": "The name of the specific network" + } + } + }, + "description": "An array of networks" + } + } + }, + "description": "An array of data which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/metrics": { + "get": { + "operationId": "get_v0_endpoints_by_id_metrics", + "summary": "Returns a single metric.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-metrics/v0-endpoints-id-metrics" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "period", + "in": "query", + "schema": { + "type": "string", + "description": "Specifies the time period for which the data is to be retrieved. Valid values includes - hour, day, week or month" + }, + "required": true, + "description": "Specifies the time period for which the data is to be retrieved. Valid values includes - hour, day, week or month" + }, + { + "name": "metric", + "in": "query", + "schema": { + "type": "string", + "description": "Specifies the type of metric to retrieve. Valid values includes - method_calls_over_time, response_status_over_time, method_call_breakdown, response_status_breakdown or method_response_time_max" + }, + "required": true, + "description": "Specifies the type of metric to retrieve. Valid values includes - method_calls_over_time, response_status_over_time, method_call_breakdown, response_status_breakdown or method_response_time_max" + }, + { + "name": "percentile", + "in": "query", + "schema": { + "type": "integer", + "description": "Required when metric is method_response_time_max. Selects the response time percentile to return. For example, 95 returns the response time at or below which 95% of observed RPC responses completed. Accepted values: integers from 1 to 100, such as 50, 95, or 99" + }, + "description": "Required when metric is method_response_time_max. Selects the response time percentile to return. For example, 95 returns the response time at or below which 95% of observed RPC responses completed. Accepted values: integers from 1 to 100, such as 50, 95, or 99" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": {}, + "description": "A nested list of numerical values representing the metric fetched for the endpoint" + }, + "tag": { + "type": "string", + "description": "A string label that identifies or categorizes the specific metric" + } + } + }, + "description": "An array of data" + }, + "error": { + "type": "string", + "description": "A string containing an error message if the request to fetch the metric fails" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/method-rate-limits": { + "get": { + "operationId": "get_v0_endpoints_by_id_method_rate_limits", + "summary": "Gets method rate limits.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "rate_limiters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the rate limiter" + }, + "interval": { + "type": "string", + "description": "The time interval for the rate limit" + }, + "methods": { + "type": "array", + "items": {}, + "description": "A list of method names to which the rate limiter applies " + }, + "rate": { + "type": "integer", + "description": "The number of allowed requests within the specified interval" + }, + "status": { + "type": "string", + "description": "The current status of the rate limiter" + }, + "created": { + "type": "string", + "description": "The timestamp when the rate limiter was created in second" + } + } + }, + "description": "An array of rate limiter configurations" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "post_v0_endpoints_by_id_method_rate_limits", + "summary": "Creates a method rate limit.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-post" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "interval": { + "type": "string", + "description": "Specifies the time interval for the rate limit; valid values include second, minute or hour" + }, + "methods": { + "type": "array", + "items": {}, + "description": "An array of method names to which the rate limiter applies" + }, + "rate": { + "type": "integer", + "description": " Specifies the maximum number of requests allowed for the specified methods within the defined interval" + } + }, + "required": [ + "interval", + "methods", + "rate" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the rate limiter" + }, + "interval": { + "type": "string", + "description": "The time interval for the rate limit" + }, + "methods": { + "type": "array", + "items": {}, + "description": "A list of methods the rate limiter applies to" + }, + "rate": { + "type": "integer", + "description": "The maximum number of requests allowed within the specified interval" + }, + "status": { + "type": "string", + "description": "The current status of the rate limiter" + }, + "created": { + "type": "string", + "description": "The timestamp when the rate limiter was created in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/method-rate-limits/{method_rate_limit_id}": { + "patch": { + "operationId": "patch_v0_endpoints_by_id_method_rate_limits_by_method_rate_limit_id", + "summary": "Updates a method rate limit.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-method_rate_limit_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "method_rate_limit_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the rate limiter" + }, + "required": true, + "description": "The unique identifier for the rate limiter" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "The current status of the rate limiter; valid values include enabled or disabled" + }, + "methods": { + "type": "array", + "items": {}, + "description": "An array of method names to which the rate limiter applies" + }, + "rate": { + "type": "integer", + "description": " Specifies the maximum number of requests allowed for the specified methods within the defined interval" + } + }, + "required": [ + "status", + "methods", + "rate" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the rate limiter" + }, + "interval": { + "type": "string", + "description": "The time interval for the rate limit" + }, + "methods": { + "type": "array", + "items": {}, + "description": "A list of methods the rate limiter applies to" + }, + "rate": { + "type": "integer", + "description": "The maximum number of requests allowed within the specified interval" + }, + "status": { + "type": "string", + "description": "The current status of the rate limiter" + }, + "created": { + "type": "string", + "description": "The timestamp when the rate limiter was created in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete_v0_endpoints_by_id_method_rate_limits_by_method_rate_limit_id", + "summary": "Deletes a method rate limit.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-method-rate-limits-method_rate_limit_id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "method_rate_limit_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the rate limiter" + }, + "required": true, + "description": "The unique identifier for the rate limiter" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "A message indicating the result of the operation" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/rate-limits": { + "patch": { + "operationId": "patch_v0_endpoints_by_id_rate_limits", + "summary": "Updates endpoint rate limits.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits" + }, + "description": "Updates endpoint rate limits. Only rate limits specified in the payload are updated; omitted rate limits remain unchanged. The response returns the effective endpoint-level limits as a flat limits object.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rate_limits": { + "type": "object", + "properties": { + "rps": { + "type": "integer", + "description": "Specifies the maximum number of requests allowed per second" + }, + "rpd": { + "type": "integer", + "description": "Specifies the maximum number of requests allowed per day" + }, + "rpm": { + "type": "integer", + "description": "Specifies the maximum number of requests allowed per minute" + } + }, + "description": "Contains the rate limit configurations that you want to update" + } + }, + "required": [ + "rate_limits" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "limits": { + "type": "object", + "properties": { + "rps": { + "type": "integer", + "description": "The maximum number of requests allowed per second. A value of -1 indicates that no endpoint-level override is set for this bucket." + }, + "rpd": { + "type": "integer", + "description": "The maximum number of requests allowed per day. A value of -1 indicates that no endpoint-level override is set for this bucket." + }, + "rpm": { + "type": "integer", + "description": "The maximum number of requests allowed per minute. A value of -1 indicates that no endpoint-level override is set for this bucket." + } + }, + "description": "The limits object which contains the following fields:" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "get_v0_endpoints_by_id_rate_limits", + "summary": "Gets endpoint rate limits.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits-get" + }, + "description": "Gets endpoint rate limits. The response returns an array with the source for each rate limit, including plan defaults and user-set overrides.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "rate_limits": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bucket": { + "type": "string", + "description": "The rate limit bucket, such as rps, rpm, or rpd" + }, + "rate_limit": { + "type": "integer", + "description": "The rate limit value for the bucket" + }, + "source": { + "type": "string", + "description": "The source of the rate limit, such as plan_default or user_override" + }, + "id": { + "type": "string", + "description": "The unique identifier for a user-set endpoint rate limit override. This field is returned for user_override rate limits and can be used to delete a specific endpoint rate limit." + } + } + }, + "description": "An array of endpoint rate limit configurations" + } + }, + "description": "The data object which contains the endpoint rate limit configuration" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/rate-limits/{override_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_rate_limits_by_override_id", + "summary": "Deletes a user-set endpoint rate limit by UUID.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-rate-limits/v0-endpoints-id-rate-limits-override_id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "override_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the user-set endpoint rate limit override" + }, + "required": true, + "description": "The unique identifier for the user-set endpoint rate limit override" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates whether the endpoint rate limit was deleted" + } + }, + "description": "The data object which contains the result of the operation" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/disable_multichain": { + "post": { + "operationId": "post_v0_endpoints_by_id_disable_multichain", + "summary": "Disables multichain for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-disable_multichain" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Returns true when multichain is successfully disabled" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/enable_multichain": { + "post": { + "operationId": "post_v0_endpoints_by_id_enable_multichain", + "summary": "Enables multichain for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-enable_multichain" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Returns true when multichain is successfully enabled" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/ip_custom_header": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_ip_custom_header", + "summary": "Deletes the IP custom header for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-ip_custom_header-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Returns true when the IP custom header is successfully deleted" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_endpoints_by_id_ip_custom_header", + "summary": "Creates or updates an IP custom header for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-ip_custom_header-patch" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "header_name": { + "type": "string", + "description": "The name of the IP custom header" + } + }, + "required": [ + "header_name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "header_name": { + "type": "string", + "description": "The name of the IP custom header that was set" + } + }, + "description": "Contains the updated IP custom header details" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/domain_masks": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_domain_masks", + "summary": "Create an endpoint domain mask.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-domain_masks" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "domain_mask": { + "type": "string", + "description": "The domain mask that you will use to mask your endpoint" + } + }, + "required": [ + "domain_mask" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the domain mask" + }, + "domain_mask": { + "type": "string", + "description": "The domain mask that you used to mask your endpoint" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/domain_masks/{domain_mask_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_domain_masks_by_domain_mask_id", + "summary": "Deletes an existing endpoint domain mask.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-domain_masks-domain_mask_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "domain_mask_id", + "in": "path", + "schema": { + "type": "string", + "description": "The specific domain mask ID that needs to be deleted" + }, + "required": true, + "description": "The specific domain mask ID that needs to be deleted" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Represent successfully deleted the existing endpoint domain mask" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/ips": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_ips", + "summary": "Creates a new endpoint IP.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-ips" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "The specific IP address that is allowed to access the API endpoint. Only requests originating from this IP address will be permitted" + } + }, + "required": [ + "ip" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the IP rule" + }, + "ip": { + "type": "string", + "description": "The IP address that is allowed to access the API endpoint" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/ips/{ip_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_ips_by_ip_id", + "summary": "Deletes an existing endpoint IP.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-ips-ip_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "ip_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint IP entry that needs to be deleted" + }, + "required": true, + "description": "The unique identifier of the endpoint IP entry that needs to be deleted" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Represent successfully deleted the existing endpoint IP" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/jwts": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_jwts", + "summary": "Creates a new endpoint JWT.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-jwts" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "public_key": { + "type": "string", + "description": "The public key used to verify the JWT token" + }, + "kid": { + "type": "string", + "description": "The key identifier (KID) associated with the public key" + }, + "name": { + "type": "string", + "description": "A human-readable name for the JWT configuration" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the JWT configuration" + }, + "public_key": { + "type": "string", + "description": "The public key used to verify the JWT token" + }, + "kid": { + "type": "string", + "description": "The key identifier (KID) associated with the public key" + }, + "name": { + "type": "string", + "description": "A human-readable name for the JWT configuration" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/jwts/{jwt_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_jwts_by_jwt_id", + "summary": "Deletes an existing endpoint JWT.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-jwts-jwt_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "jwt_id", + "in": "path", + "schema": { + "type": "string", + "description": "A unique identifier for the JWT which needs to be deleted" + }, + "required": true, + "description": "A unique identifier for the JWT which needs to be deleted" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Represent successfully deleted the existing endpoint jwt" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/referrers": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_referrers", + "summary": "Creates a new endpoint referrer.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-referrers" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "referrer": { + "type": "string", + "description": "The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted" + } + }, + "required": [ + "referrer" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the referrer" + }, + "referrer": { + "type": "string", + "description": "The URL or domain that is allowed to access the specific API endpoint. Only requests coming from this referrer will be permitted" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/referrers/{referrer_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_referrers_by_referrer_id", + "summary": "Deletes an existing endpoint referrer.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-referrers-referrer_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "referrer_id", + "in": "path", + "schema": { + "type": "string", + "description": "The referrer_id which needs to be deleted" + }, + "required": true, + "description": "The referrer_id which needs to be deleted" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Represent successfully deleted the existing endpoint referrer" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/request_filters": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_request_filters", + "summary": "Creates a new endpoint request filter for method whitelisting.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-post" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "method": { + "type": "array", + "items": {}, + "description": "An array of method names to whitelist" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier (UUID) of the newly created request filter" + } + }, + "description": "Contains the created request filter details" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/request_filters/{request_filter_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_request_filters_by_request_filter_id", + "summary": "Deletes an existing endpoint request filter.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-request_filter_id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + }, + { + "name": "request_filter_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the request filter to delete" + }, + "required": true, + "description": "The unique identifier of the request filter to delete" + } + ], + "responses": { + "204": { + "description": "Returns HTTP 204 No Content on successful deletion. The response body is empty." + } + } + }, + "put": { + "operationId": "put_v0_endpoints_by_id_security_request_filters_by_request_filter_id", + "summary": "Updates an existing endpoint request filter.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-request_filters-request_filter_id-put" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + }, + { + "name": "request_filter_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the request filter to update" + }, + "required": true, + "description": "The unique identifier of the request filter to update" + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "method": { + "type": "array", + "items": {}, + "description": "An array of method names to whitelist" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Returns HTTP 204 No Content on successful update. The response body is empty." + } + } + } + }, + "/v0/endpoints/{id}/security/tokens": { + "post": { + "operationId": "post_v0_endpoints_by_id_security_tokens", + "summary": "Creates a new endpoint authentication token.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-tokens" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the token" + }, + "token": { + "type": "string", + "description": "The generated token string used for authentication" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security/tokens/{token_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_security_tokens_by_token_id", + "summary": "Deletes an existing endpoint token.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security-tokens-token_id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + }, + { + "name": "token_id", + "in": "path", + "schema": { + "type": "string", + "description": "The specific token id that needs to be deleted" + }, + "required": true, + "description": "The specific token id that needs to be deleted" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Represent successfully deleted the existing endpoint token" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security_options": { + "get": { + "operationId": "get_v0_endpoints_by_id_security_options", + "summary": "Gets security options for an endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security_options" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "option": { + "type": "string", + "description": "Represents the security options" + }, + "status": { + "type": "string", + "description": "Indicates the status of the option. Possible values: enabled, disabled" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_endpoints_by_id_security_options", + "summary": "Updates security options for an endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoint-security/v0-endpoints-id-security_options-patch" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "tokens": { + "type": "string", + "description": "Controls the token-based authentication mechanism. Possible values includes 'enabled' or 'disabled'" + }, + "referrers": { + "type": "string", + "description": "The URL or domain that is allowed to access the specific API endpoint. Possible values includes 'enabled' or 'disabled'" + }, + "jwts": { + "type": "string", + "description": "Configures JSON Web Tokens (JWTs) for secure authentication and authorization. Possible values includes 'enabled' or 'disabled'" + }, + "ips": { + "type": "string", + "description": "Specifies IP address-based restrictions or permissions. Possible values includes 'enabled' or 'disabled'" + }, + "domainMasks": { + "type": "string", + "description": "Configures the masking or restriction of specific domains. Possible values includes 'enabled' or 'disabled'" + }, + "hsts": { + "type": "string", + "description": "The HTTP Strict Transport Security (HSTS). Possible values includes 'enabled' or 'disabled'" + }, + "cors": { + "type": "string", + "description": "Configures Cross-Origin Resource Sharing (CORS) policies to control how resources can be accessed by external domains. Possible values includes 'enabled' or 'disabled'" + } + }, + "description": "The options object which contains the following fields:" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "option": { + "type": "string", + "description": "Represents the security options" + }, + "status": { + "type": "string", + "description": "Indicates the status of the option. Possible values: enabled, disabled" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints": { + "get": { + "operationId": "get_v0_endpoints", + "summary": "Retrieves a list of endpoints.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints" + }, + "description": "Retrieves a list of endpoints. Supports searching, filtering, and sorting.", + "parameters": [ + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the maximum number of endpoints to retrieve in the response. The default value is set to 20" + }, + "description": "Specifies the maximum number of endpoints to retrieve in the response. The default value is set to 20" + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the number of endpoints to skip before starting to retrieve the list" + }, + "description": "Specifies the number of endpoints to skip before starting to retrieve the list" + }, + { + "name": "search", + "in": "query", + "schema": { + "type": "string", + "description": "Search endpoints by subdomain or label" + }, + "description": "Search endpoints by subdomain or label" + }, + { + "name": "sort_by", + "in": "query", + "schema": { + "type": "string", + "description": "Sort field. Accepted values: name, status, network, label, tags, usage, created_at. Default value: created_at" + }, + "description": "Sort field. Accepted values: name, status, network, label, tags, usage, created_at. Default value: created_at" + }, + { + "name": "sort_direction", + "in": "query", + "schema": { + "type": "string", + "description": "Sort direction. Accepted values: asc, desc. Default value: ASC" + }, + "description": "Sort direction. Accepted values: asc, desc. Default value: ASC" + }, + { + "name": "networks", + "in": "query", + "schema": { + "type": "array", + "items": {}, + "description": "Filter by network name(s)" + }, + "description": "Filter by network name(s)" + }, + { + "name": "statuses", + "in": "query", + "schema": { + "type": "array", + "items": {}, + "description": "Filter by endpoint status. Accepted values: active, paused" + }, + "description": "Filter by endpoint status. Accepted values: active, paused" + }, + { + "name": "labels", + "in": "query", + "schema": { + "type": "array", + "items": {}, + "description": "Filter by endpoint label(s)" + }, + "description": "Filter by endpoint label(s)" + }, + { + "name": "dedicated", + "in": "query", + "schema": { + "type": "boolean", + "description": "Filter for dedicated endpoints only" + }, + "description": "Filter for dedicated endpoints only" + }, + { + "name": "is_flat_rate", + "in": "query", + "schema": { + "type": "boolean", + "description": "Filter for flat rate endpoints only" + }, + "description": "Filter for flat rate endpoints only" + }, + { + "name": "tag_ids", + "in": "query", + "schema": { + "type": [ + "integer", + "array" + ], + "description": "Filter endpoints by tag IDs. Can be a single integer or an array of integers. Optional. Cannot be used together with tag_labels" + }, + "description": "Filter endpoints by tag IDs. Can be a single integer or an array of integers. Optional. Cannot be used together with tag_labels" + }, + { + "name": "tag_labels", + "in": "query", + "schema": { + "type": [ + "string", + "array" + ], + "description": "Filter endpoints by tag labels. Can be a single string or an array of strings. Optional. Cannot be used together with tag_ids" + }, + "description": "Filter endpoints by tag labels. Can be a single string or an array of strings. Optional. Cannot be used together with tag_ids" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the specific endpoint" + }, + "name": { + "type": "string", + "description": "The endpoint subdomain" + }, + "label": { + "type": "string", + "description": "A descriptive label for the endpoint" + }, + "status": { + "type": "string", + "description": "The current status of the endpoint (active or paused)" + }, + "chain": { + "type": "string", + "description": "The blockchain the endpoint is associated with" + }, + "network": { + "type": "string", + "description": "The specific network of the blockchain" + }, + "is_dedicated": { + "type": "boolean", + "description": "Whether the endpoint is a dedicated endpoint" + }, + "is_flat_rate": { + "type": "boolean", + "description": "Whether the endpoint is a flat rate endpoint" + }, + "is_multichain": { + "type": "boolean", + "description": "Whether the endpoint is a multichain endpoint" + }, + "http_url": { + "type": "string", + "description": "The HTTP URL to access the endpoint" + }, + "wss_url": { + "type": "string", + "description": "The WebSocket URL to access the endpoint" + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag_id": { + "type": "integer", + "description": "The unique identifier for the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + } + } + }, + "description": "An array of tags associated with the endpoint" + } + } + }, + "description": "An array of data which contains the following fields:" + }, + "pagination": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "The total number of endpoints matching the query" + }, + "limit": { + "type": "integer", + "description": "The maximum number of endpoints returned per page" + }, + "offset": { + "type": "integer", + "description": "The number of endpoints skipped" + } + }, + "description": "Pagination details for the response" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "post_v0_endpoints", + "summary": "Creates a new endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-post" + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chain": { + "type": "string", + "description": "The chain name for which the endpoint is to be created" + }, + "network": { + "type": "string", + "description": "The chain network for which the endpoint is to be created" + } + }, + "required": [ + "chain", + "network" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the created endpoint" + }, + "label": { + "type": "string", + "description": "A descriptive label for the endpoint" + }, + "chain": { + "type": "string", + "description": "The blockchain the endpoint is associated with" + }, + "network": { + "type": "string", + "description": "The specific network of the blockchain" + }, + "http_url": { + "type": "string", + "description": "The HTTP URL to access the newly created endpoint" + }, + "wss_url": { + "type": "string", + "description": "The WebSocket URL to access the newly created endpoint" + }, + "security": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "tokens": { + "type": "boolean", + "description": "Indicates whether token-based security is enabled" + }, + "jwts": { + "type": "boolean", + "description": "Indicates whether JWT-based security is enabled" + }, + "domainMasks": { + "type": "boolean", + "description": "Indicates whether domain mask security is enabled" + }, + "ips": { + "type": "boolean", + "description": "Indicates whether IP-based security is enabled" + }, + "hosts": { + "type": "boolean", + "description": "Indicates whether host-based security is enabled" + }, + "referrers": { + "type": "boolean", + "description": "Indicates whether referrer-based security is enable" + }, + "validHosts": { + "type": "boolean", + "description": "Indicates whether only valid hosts are allowed" + }, + "requestFilters": { + "type": "boolean", + "description": "Indicates whether request filters are applied" + }, + "debugAuthErrors": { + "type": "boolean", + "description": "Indicates whether detailed authentication error debugging is enabled" + }, + "enforceChainNetwork": { + "type": "boolean", + "description": "Indicates whether the specified chain and network are enforced for the endpoint" + }, + "ipCustomHeader": { + "type": "boolean", + "description": "Indicates whether a custom IP header is applied" + }, + "hsts": { + "type": "boolean", + "description": "Indicates whether HTTP Strict Transport Security (HSTS) is enforced" + }, + "cors": { + "type": "boolean", + "description": "Indicates whether Cross-Origin Resource Sharing (CORS) is enabled" + } + }, + "description": "A list of security options available for the endpoint " + }, + "jwts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the JWT" + }, + "public_key": { + "type": "string", + "description": "The public key used in the JWT" + }, + "kid": { + "type": "string", + "description": "A unique key identifier for the JWT public key" + }, + "name": { + "type": "string", + "description": "The name of the JWT" + } + } + }, + "description": "An array of JSON Web Token (JWT) configurations" + }, + "tokens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the token" + }, + "token": { + "type": "string", + "description": "The actual token value used for authentication" + } + } + }, + "description": "An array of token-based security configurations" + }, + "referrers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the referrer." + }, + "referrer": { + "type": "string", + "description": "The referrer URL allowed to access the endpoint" + } + } + }, + "description": "An array of referrer-based security configurations" + }, + "domainMasks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the domain mask" + }, + "domain": { + "type": "string", + "description": "The allowed domain for accessing the endpoint" + } + } + }, + "description": "An array of domain-based security configurations" + }, + "ips": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the IP configuration" + }, + "ip": { + "type": "string", + "description": "The allowed IP address for accessing the endpoint" + } + } + }, + "description": "An array of IP-based security configurations" + } + }, + "description": "The security object which contains the following fields:" + }, + "rate_limits": { + "type": "object", + "properties": { + "rate_limit_by_ip": { + "type": "boolean", + "description": "Specifies if rate limiting is applied per IP" + }, + "account": { + "type": "integer", + "description": "The account-level rate limit" + }, + "rps": { + "type": "integer", + "description": "Requests per second limit" + }, + "rpm": { + "type": "integer", + "description": "Requests per minute limit" + }, + "rpd": { + "type": "integer", + "description": "Requests per day limit" + } + }, + "description": "The rate_limits object which contains the following fields:" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/bulk/status": { + "post": { + "operationId": "post_v0_endpoints_bulk_status", + "summary": "Pause or unpause multiple endpoints in a single call.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-status" + }, + "description": "Pause or unpause multiple endpoints in a single call. Admin-only.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": {}, + "description": "An array of endpoint IDs to update" + }, + "status": { + "type": "string", + "description": "The status to apply. Accepted values: active, paused" + } + }, + "required": [ + "ids", + "status" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "The total number of endpoints in the request" + }, + "updated_count": { + "type": "integer", + "description": "The number of endpoints successfully updated" + }, + "failed_count": { + "type": "integer", + "description": "The number of endpoints that failed to update" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The endpoint ID" + }, + "success": { + "type": "boolean", + "description": "Whether the status update succeeded for this endpoint" + } + } + }, + "description": "An array of result objects for each endpoint" + } + }, + "description": "Contains the result of the bulk status update" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/bulk/tags": { + "delete": { + "operationId": "delete_v0_endpoints_bulk_tags", + "summary": "Remove a tag from multiple endpoints in a single call.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-tags-delete" + }, + "description": "Remove a tag from multiple endpoints in a single call. Admin-only.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": {}, + "description": "An array of endpoint IDs to remove the tag from" + }, + "tag_id": { + "type": "integer", + "description": "The ID of the tag to remove from the endpoints" + } + }, + "required": [ + "ids", + "tag_id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "The total number of endpoints in the request" + }, + "updated_count": { + "type": "integer", + "description": "The number of endpoints successfully updated" + }, + "failed_count": { + "type": "integer", + "description": "The number of endpoints that failed to update" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The endpoint ID" + }, + "success": { + "type": "boolean", + "description": "Whether the tag was successfully removed from this endpoint" + } + } + }, + "description": "An array of result objects for each endpoint" + } + }, + "description": "Contains the result of the bulk tag removal" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "post_v0_endpoints_bulk_tags", + "summary": "Add a tag to multiple endpoints in a single call.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-bulk-tags-post" + }, + "description": "Add a tag to multiple endpoints in a single call. Admin-only.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": {}, + "description": "An array of endpoint IDs to tag" + }, + "label": { + "type": "string", + "description": "The tag label to add to the endpoints" + } + }, + "required": [ + "ids", + "label" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "The total number of endpoints in the request" + }, + "updated_count": { + "type": "integer", + "description": "The number of endpoints successfully updated" + }, + "failed_count": { + "type": "integer", + "description": "The number of endpoints that failed to update" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The endpoint ID" + }, + "success": { + "type": "boolean", + "description": "Whether the tag was successfully added to this endpoint" + } + } + }, + "description": "An array of result objects for each endpoint" + }, + "tag": { + "type": "object", + "properties": { + "tag_id": { + "type": "integer", + "description": "The unique identifier of the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + } + }, + "description": "The tag that was added to the endpoints" + } + }, + "description": "Contains the result of the bulk tag operation" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}": { + "get": { + "operationId": "get_v0_endpoints_by_id", + "summary": "Returns info for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the created endpoint" + }, + "label": { + "type": "string", + "description": "A descriptive label for the endpoint" + }, + "chain": { + "type": "string", + "description": "The blockchain the endpoint is associated with" + }, + "network": { + "type": "string", + "description": "The specific network of the blockchain" + }, + "http_url": { + "type": "string", + "description": "The HTTP URL to access the newly created endpoint" + }, + "wss_url": { + "type": "string", + "description": "The WebSocket URL to access the newly created endpoint" + }, + "security": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "tokens": { + "type": "boolean", + "description": "Indicates whether token-based security is enabled" + }, + "jwts": { + "type": "boolean", + "description": "Indicates whether JWT-based security is enabled" + }, + "domainMasks": { + "type": "boolean", + "description": "Indicates whether domain mask security is enabled" + }, + "ips": { + "type": "boolean", + "description": "Indicates whether IP-based security is enabled" + }, + "hosts": { + "type": "boolean", + "description": "Indicates whether host-based security is enabled" + }, + "referrers": { + "type": "boolean", + "description": "Indicates whether referrer-based security is enable" + }, + "validHosts": { + "type": "boolean", + "description": "Indicates whether only valid hosts are allowed" + }, + "requestFilters": { + "type": "boolean", + "description": "Indicates whether request filters are applied" + }, + "debugAuthErrors": { + "type": "boolean", + "description": "Indicates whether detailed authentication error debugging is enabled" + }, + "enforceChainNetwork": { + "type": "boolean", + "description": "Indicates whether the specified chain and network are enforced for the endpoint" + }, + "ipCustomHeader": { + "type": "boolean", + "description": "Indicates whether a custom IP header is applied" + }, + "hsts": { + "type": "boolean", + "description": "Indicates whether HTTP Strict Transport Security (HSTS) is enforced" + }, + "cors": { + "type": "boolean", + "description": "Indicates whether Cross-Origin Resource Sharing (CORS) is enabled" + } + }, + "description": "A list of security options available for the endpoint " + }, + "jwts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the JWT" + }, + "public_key": { + "type": "string", + "description": "The public key used in the JWT" + }, + "kid": { + "type": "string", + "description": "A unique key identifier for the JWT public key" + }, + "name": { + "type": "string", + "description": "The name of the JWT" + } + } + }, + "description": "An array of JSON Web Token (JWT) configurations" + }, + "tokens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the token" + }, + "token": { + "type": "string", + "description": "The actual token value used for authentication" + } + } + }, + "description": "An array of token-based security configurations" + }, + "referrers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the referrer." + }, + "referrer": { + "type": "string", + "description": "The referrer URL allowed to access the endpoint" + } + } + }, + "description": "An array of referrer-based security configurations" + }, + "domainMasks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the domain mask" + }, + "domain": { + "type": "string", + "description": "The allowed domain for accessing the endpoint" + } + } + }, + "description": "An array of domain-based security configurations" + }, + "ips": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the IP configuration" + }, + "ip": { + "type": "string", + "description": "The allowed IP address for accessing the endpoint" + } + } + }, + "description": "An array of IP-based security configurations" + } + }, + "description": "The security object which contains the following fields:" + }, + "status": { + "type": "string", + "description": "Current state of the endpoint — either `active` or `paused`" + }, + "rate_limits": { + "type": "object", + "properties": { + "rate_limit_by_ip": { + "type": "boolean", + "description": "Specifies if rate limiting is applied per IP" + }, + "account": { + "type": "integer", + "description": "The account-level rate limit" + }, + "rps": { + "type": "integer", + "description": "Requests per second limit" + }, + "rpm": { + "type": "integer", + "description": "Requests per minute limit" + }, + "rpd": { + "type": "integer", + "description": "Requests per day limit" + } + }, + "description": "The rate_limits object which contains the following fields:" + } + }, + "description": "The data object which contains the following fields:" + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag_id": { + "type": "integer", + "description": "The unique identifier for the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + } + } + }, + "description": "An array of tags associated with the endpoint" + }, + "is_multichain": { + "type": "boolean", + "description": "Whether the endpoint is a multichain endpoint" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete_v0_endpoints_by_id", + "summary": "Deletes an endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint that you want to delete" + }, + "required": true, + "description": "The unique identifier for the specific endpoint that you want to delete" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "result": { + "type": "boolean", + "description": "Indicates whether the endpoint was deleted" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_endpoints_by_id", + "summary": "Updates an endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-patch" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "A descriptive label for the endpoint which you need to update to" + } + }, + "required": [ + "label" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "boolean", + "description": "Indicates whether the updation is done or not" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/security": { + "get": { + "operationId": "get_v0_endpoints_by_id_security", + "summary": "Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-security" + }, + "description": "Returns full security state (tokens, JWTs, IPs, referrers, domain masks, request filters, options) without fetching the full endpoint.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "tokens": { + "type": "boolean", + "description": "Whether token-based authentication is enabled" + }, + "referrers": { + "type": "boolean", + "description": "Whether referrer-based restrictions are enabled" + }, + "jwts": { + "type": "boolean", + "description": "Whether JWT-based authentication is enabled" + }, + "ips": { + "type": "boolean", + "description": "Whether IP-based restrictions are enabled" + }, + "domainMasks": { + "type": "boolean", + "description": "Whether domain mask restrictions are enabled" + }, + "hsts": { + "type": "boolean", + "description": "Whether HSTS is enabled" + }, + "cors": { + "type": "boolean", + "description": "Whether CORS is enabled" + }, + "responseLogging": { + "type": "boolean", + "description": "Whether response logging is enabled" + }, + "requestFilters": { + "type": "boolean", + "description": "Whether request filters are enabled" + }, + "ipCustomHeader": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The IP custom header value; null if not set" + } + }, + "description": "IP custom header configuration" + } + }, + "description": "Security feature toggles for the endpoint" + }, + "tokens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier (UUID) of the token" + }, + "token": { + "type": "string", + "description": "The authentication token value" + } + } + }, + "description": "An array of authentication token objects; null if none configured" + }, + "jwts": { + "type": "array", + "items": {}, + "description": "An array of JWT configuration objects; null if none configured" + }, + "referrers": { + "type": "array", + "items": {}, + "description": "An array of allowed referrer entries; null if none configured" + }, + "domain_masks": { + "type": "array", + "items": {}, + "description": "An array of domain mask entries; null if none configured" + }, + "ips": { + "type": "array", + "items": {}, + "description": "An array of allowed IP entries; null if none configured" + }, + "request_filters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier (UUID) of the request filter" + }, + "method": { + "type": "array", + "items": {}, + "description": "An array of whitelisted method names" + }, + "params": { + "type": "object", + "description": "Parameter constraints for the filter" + } + } + }, + "description": "An array of request filter objects; null if none configured" + } + }, + "description": "Contains the security state of the endpoint" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/status": { + "patch": { + "operationId": "patch_v0_endpoints_by_id_status", + "summary": "Pauses or unpauses a specific endpoint by updating its status to either 'active' or 'paused'", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-status" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint to be updated" + }, + "required": true, + "description": "The unique identifier of the endpoint to be updated" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "The new status to apply to the endpoint. Accepted values are 'active' and 'paused'" + } + }, + "required": [ + "status" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "The updated status of the endpoint (either 'active' or 'paused')" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/tags": { + "get": { + "operationId": "get_v0_endpoints_by_id_tags", + "summary": "Returns all tags for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier for the endpoint-tag relationship" + }, + "tag_id": { + "type": "integer", + "description": "The unique identifier for the tag" + }, + "account_id": { + "type": "integer", + "description": "The account identifier associated with the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the tag was created" + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the tag was last updated" + }, + "endpoint_id": { + "type": "integer", + "description": "The endpoint identifier associated with the tag" + } + } + }, + "description": "An array of tags associated with the endpoint" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "post_v0_endpoints_by_id_tags", + "summary": "Creates a new tag for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags-post" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label/name for the new tag" + } + }, + "required": [ + "label" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier for the endpoint-tag relationship" + }, + "tag_id": { + "type": "integer", + "description": "The unique identifier for the newly created tag" + }, + "account_id": { + "type": "integer", + "description": "The account identifier associated with the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the newly created tag" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the tag was created" + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the tag was last updated" + }, + "endpoint_id": { + "type": "integer", + "description": "The endpoint identifier associated with the tag" + } + } + }, + "description": "An array containing the newly created tag" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/tags/{tag_id}": { + "delete": { + "operationId": "delete_v0_endpoints_by_id_tags_by_tag_id", + "summary": "Deletes a tag from a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-tags-tag_id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint" + }, + "required": true, + "description": "The unique identifier of the endpoint" + }, + { + "name": "tag_id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the tag to remove" + }, + "required": true, + "description": "The unique identifier of the tag to remove" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the tag was successfully deleted from the endpoint" + } + }, + "description": "Contains the result of the tag deletion" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/urls": { + "get": { + "operationId": "get_v0_endpoints_by_id_urls", + "summary": "Returns the URLs for a specific endpoint.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/endpoints/v0-endpoints-id-urls" + }, + "description": "Returns the URLs for a specific endpoint. For multichain endpoints, the response also includes a `multichain_urls` map with the URLs for every supported network.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier for the specific endpoint" + }, + "required": true, + "description": "The unique identifier for the specific endpoint" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "http_url": { + "type": "string", + "description": "The HTTP URL to access the endpoint" + }, + "wss_url": { + "type": "string", + "description": "The WebSocket URL to access the endpoint" + }, + "multichain_urls": { + "type": "object", + "properties": { + "{network}": { + "type": "object", + "properties": { + "http_url": { + "type": "string", + "description": "The HTTP URL to access the endpoint on this network" + }, + "wss_url": { + "type": "string", + "description": "The WebSocket URL to access the endpoint on this network" + } + }, + "description": "Per-network URL entry. The key is the network identifier (e.g. `avalanche-mainnet`)." + } + }, + "description": "Only present for multichain endpoints. An object keyed by network identifier (e.g. `avalanche-mainnet`), where each value contains the HTTP and WebSocket URLs for that network." + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "Contains error information, if any" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/logs": { + "get": { + "operationId": "get_v0_endpoints_by_id_logs", + "summary": "Retrieves logs for a specific endpoint with filtering and pagination options.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/logs/v0-endpoints-id-logs" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)" + }, + "required": true, + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)" + }, + { + "name": "from", + "in": "query", + "schema": { + "type": "string", + "description": "The start timestamp encoded in ISO8601 format" + }, + "required": true, + "description": "The start timestamp encoded in ISO8601 format" + }, + { + "name": "to", + "in": "query", + "schema": { + "type": "string", + "description": "The end timestamp encoded in ISO8601 format" + }, + "required": true, + "description": "The end timestamp encoded in ISO8601 format" + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "description": "Number of logs (1-100, default: 20)" + }, + "description": "Number of logs (1-100, default: 20)" + }, + { + "name": "include_details", + "in": "query", + "schema": { + "type": "boolean", + "description": "Includes request/response details. The default value is set to be false" + }, + "description": "Includes request/response details. The default value is set to be false" + }, + { + "name": "next_at", + "in": "query", + "schema": { + "type": "string", + "description": "Pagination token from previous response" + }, + "description": "Pagination token from previous response" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "description": "The timestamp when the log was recorded" + }, + "method": { + "type": "string", + "description": "The name of the method invoked" + }, + "network": { + "type": "string", + "description": "The name of the network on which the method was called" + }, + "http_method": { + "type": "string", + "description": "The HTTP method used for the request" + }, + "status": { + "type": "integer", + "description": "The HTTP status code returned by the request" + }, + "error_code": { + "type": "integer", + "description": "The application-specific error code returned" + }, + "request_id": { + "type": "string", + "description": "The unique identifier for the request" + }, + "url": { + "type": "string", + "description": "The request URL" + }, + "details": { + "type": "string", + "description": "Additional error details if available (nullable)" + } + } + }, + "description": "An array of log entries which contains the following fields:" + }, + "next_at": { + "type": "string", + "description": "A cursor string used for pagination to fetch the next set of logs" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/{id}/log_details": { + "get": { + "operationId": "get_v0_endpoints_by_id_log_details", + "summary": "Retrieves detailed request and response information for a specific log entry.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/logs/v0-endpoints-id-logs_details" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string", + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)" + }, + "required": true, + "description": "The unique identifier of the endpoint. You can find this ID in the URL when viewing an endpoint in the Quicknode dashboard (e.g., https://dashboard.quicknode.com/endpoints/12345 — here, '12345' is the endpoint ID)" + }, + { + "name": "request_id", + "in": "query", + "schema": { + "type": "string", + "description": "The UUID of the log entry" + }, + "required": true, + "description": "The UUID of the log entry" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "request": { + "type": "string", + "description": "A JSON-encoded string representing the request payload that was sent in the original log entry. The logs are truncated after 2KB." + }, + "response": { + "type": "string", + "description": "A JSON-encoded string containing the full response returned by the API or aggregator for the logged request. The logs are truncated after 2KB." + } + }, + "description": "Contains detailed information about a specific log entry, including the raw request that was sent and the response that was received." + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/tags": { + "get": { + "operationId": "get_v0_endpoints_tags", + "summary": "Returns all account-level tags including those with zero endpoints.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags" + }, + "description": "Returns all account-level tags including those with zero endpoints. Gated at Build/Growth+.", + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier for the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + }, + "usage_count": { + "type": "integer", + "description": "The number of endpoints associated with this tag" + } + } + }, + "description": "An array of tag objects" + } + }, + "description": "Contains the tags data" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/endpoints/tags/{id}": { + "delete": { + "operationId": "delete_v0_endpoints_tags_by_id", + "summary": "Deletes an account tag.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags-id-delete" + }, + "description": "Deletes an account tag. The tag must be removed from all endpoints before it can be deleted. Admin-only.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the tag to delete" + }, + "required": true, + "description": "The unique identifier for the tag to delete" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Contains the result of the deletion" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_endpoints_tags_by_id", + "summary": "Renames an account tag.", + "tags": [ + "endpoints" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tags/v0-endpoints-tags-id-patch" + }, + "description": "Renames an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately. Admin-only.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the tag to rename" + }, + "required": true, + "description": "The unique identifier for the tag to rename" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The new label for the tag" + } + }, + "required": [ + "label" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the tag" + }, + "label": { + "type": "string", + "description": "The updated label/name of the tag" + }, + "usage_count": { + "type": "integer", + "description": "The number of endpoints currently using this tag" + } + }, + "description": "Contains the updated tag details" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + }, + "/v0/teams": { + "get": { + "operationId": "get_v0_teams", + "summary": "Retrieves a list of all teams.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the team" + }, + "name": { + "type": "string", + "description": "The name of the team" + }, + "members_count": { + "type": "integer", + "description": "The number of members in the team" + }, + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the user" + }, + "full_name": { + "type": "string", + "description": "The full name of the user" + }, + "email": { + "type": "string", + "description": "The email address of the user" + }, + "role": { + "type": "string", + "description": "The role of the user in the team (admin, viewer, or billing)" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the user was added to the team" + }, + "status": { + "type": "string", + "description": "The status of the user (e.g., Active, Pending)" + }, + "photo_url": { + "type": "string", + "description": "The URL of the user's profile photo" + } + } + }, + "description": "An array of user objects in the team" + } + } + }, + "description": "An array of team objects containing the following fields:" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "post_v0_teams", + "summary": "Creates a new team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-post" + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name for the new team" + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the created team" + }, + "name": { + "type": "string", + "description": "The name of the created team" + }, + "default_role": { + "type": "string", + "description": "The default role assigned to new team members (admin, viewer, or billing)" + }, + "members_count": { + "type": "integer", + "description": "The number of members in the team" + } + }, + "description": "The created team object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/teams/{id}": { + "get": { + "operationId": "get_v0_teams_by_id", + "summary": "Retrieves details for a specific team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the team" + }, + "name": { + "type": "string", + "description": "The name of the team" + }, + "members_count": { + "type": "integer", + "description": "The number of members in the team" + }, + "default_role": { + "type": "string", + "description": "The default role assigned to new team members (admin, viewer, or billing)" + }, + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the user" + }, + "full_name": { + "type": "string", + "description": "The full name of the user" + }, + "email": { + "type": "string", + "description": "The email address of the user" + }, + "role": { + "type": "string", + "description": "The role of the user in the team (admin, viewer, or billing)" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the user was added to the team" + }, + "status": { + "type": "string", + "description": "The status of the user (e.g., Active)" + }, + "photo_url": { + "type": "string", + "description": "The URL of the user's profile photo" + }, + "account_primary_user": { + "type": "boolean", + "description": "Indicates if the user is the primary account user" + } + } + }, + "description": "An array of active user objects in the team" + }, + "pending_invites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the pending invite" + }, + "full_name": { + "type": "string", + "description": "The full name of the invited user" + }, + "email": { + "type": "string", + "description": "The email address of the invited user" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the invite was created" + }, + "status": { + "type": "string", + "description": "The status of the invite (e.g., Pending)" + }, + "role": { + "type": "string", + "description": "The role assigned to the invited user (admin, viewer, or billing)" + }, + "photo_url": { + "type": "string", + "description": "The URL of the invited user's profile photo" + }, + "account_primary_user": { + "type": "boolean", + "description": "Indicates if the invited user will be the primary account user" + } + } + }, + "description": "An array of pending invite objects" + } + }, + "description": "The team object containing the following fields:" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete_v0_teams_by_id", + "summary": "Deletes an empty team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-delete" + }, + "description": "Deletes an empty team. The team must have no members before it can be deleted.", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team to delete" + }, + "required": true, + "description": "The unique identifier for the team to delete" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A message confirming the team was deleted successfully" + } + }, + "description": "The response object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/teams/{id}/endpoints": { + "get": { + "operationId": "get_v0_teams_by_id_endpoints", + "summary": "Retrieves a list of endpoints accessible to a team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-endpoints" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the endpoint" + }, + "subdomain": { + "type": "string", + "description": "The subdomain name of the endpoint" + }, + "chain": { + "type": "string", + "description": "The blockchain the endpoint is associated with" + }, + "network": { + "type": "string", + "description": "The specific network of the blockchain" + } + } + }, + "description": "An array of endpoint objects containing the following fields:" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_teams_by_id_endpoints", + "summary": "Assigns or unassigns endpoints to a team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-endpoints-patch" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "endpoint_ids": { + "type": "array", + "items": {}, + "description": "An array of endpoint IDs to assign to the team. Pass an empty array to unassign all endpoints" + } + }, + "required": [ + "endpoint_ids" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates whether the operation was successful" + } + }, + "description": "The response object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/teams/{id}/members": { + "post": { + "operationId": "post_v0_teams_by_id_members", + "summary": "Invites a user to a team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-post" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "full_name": { + "type": "string", + "description": "The full name of the user to invite (required only for new users)" + }, + "email": { + "type": "string", + "description": "The email address of the user to invite" + }, + "role": { + "type": "string", + "description": "The role to assign to the invited user. Valid values: admin, viewer, billing. Required only for new users" + } + }, + "required": [ + "email" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "A unique identifier for the invited user" + }, + "full_name": { + "type": "string", + "description": "The full name of the invited user" + }, + "email": { + "type": "string", + "description": "The email address of the invited user" + }, + "role": { + "type": "string", + "description": "The role assigned to the invited user (admin, viewer, or billing)" + }, + "status": { + "type": "string", + "description": "The status of the invitation (e.g., Active, Pending)" + } + }, + "description": "The invited user object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/teams/{id}/members/{user_id}": { + "delete": { + "operationId": "delete_v0_teams_by_id_members_by_user_id", + "summary": "Removes a user from a team.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-user_id-delete" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + }, + { + "name": "user_id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the user to remove" + }, + "required": true, + "description": "The unique identifier for the user to remove" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A message confirming the user was removed successfully" + } + }, + "description": "The response object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/teams/{id}/members/{user_id}/resend_invite": { + "post": { + "operationId": "post_v0_teams_by_id_members_by_user_id_resend_invite", + "summary": "Resends an invitation email to a pending team member.", + "tags": [ + "teams" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/team-control/v0-teams-id-members-user_id-resend_invite" + }, + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the team" + }, + "required": true, + "description": "The unique identifier for the team" + }, + { + "name": "user_id", + "in": "path", + "schema": { + "type": "integer", + "description": "The unique identifier for the user to resend the invitation to" + }, + "required": true, + "description": "The unique identifier for the user to resend the invitation to" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A message confirming the invitation was resent successfully" + } + }, + "description": "The response object containing the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/tooling-access": { + "get": { + "operationId": "get_v0_tooling_access", + "summary": "Returns whether Tooling Access is enabled for the account.", + "tags": [ + "tooling-access" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access" + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether Tooling Access is currently enabled for the account" + }, + "endpoint_id": { + "type": "integer", + "description": "The unique identifier of the endpoint provisioned for Tooling Access" + }, + "endpoint_url": { + "type": "string", + "description": "The URL of the endpoint provisioned for Tooling Access. May be present even when disabled if the account was previously provisioned" + }, + "enabled_at": { + "type": "string", + "description": "The timestamp when Tooling Access was enabled" + } + }, + "description": "An object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + }, + "patch": { + "operationId": "patch_v0_tooling_access", + "summary": "Enable (provision/reactivate) or disable Tooling Access for the account.", + "tags": [ + "tooling-access" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access-patch" + }, + "description": "Enable (provision/reactivate) or disable Tooling Access for the account. Enabling is idempotent and requires an admin role.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set to true to enable (provision/reactivate) Tooling Access or false to disable it" + } + }, + "required": [ + "enabled" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether Tooling Access is enabled after the update" + }, + "endpoint_url": { + "type": "string", + "description": "The URL of the endpoint provisioned for Tooling Access" + } + }, + "description": "An object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/tooling-access/token": { + "post": { + "operationId": "post_v0_tooling_access_token", + "summary": "Mints a short-lived ES256 JWT for authenticating data-plane RPC calls.", + "tags": [ + "tooling-access" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/tooling-access/v0-tooling-access-token-post" + }, + "description": "Mints a short-lived ES256 JWT for authenticating data-plane RPC calls. Requires Tooling Access to be enabled first.", + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "endpoint_url": { + "type": "string", + "description": "The URL of the Tooling Access endpoint the token authenticates against" + }, + "token": { + "type": "string", + "description": "The short-lived ES256 JWT used to authenticate RPC calls" + }, + "expires_at": { + "type": "string", + "description": "The timestamp when the token expires" + } + }, + "description": "An object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "An error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/usage/rpc": { + "get": { + "operationId": "get_v0_usage_rpc", + "summary": "Retrieves usage total for specified time range.", + "tags": [ + "usage" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc" + }, + "parameters": [ + { + "name": "start_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the start of the time period for which the usage data is to be retrieved" + }, + "description": "Specifies the start of the time period for which the usage data is to be retrieved" + }, + { + "name": "end_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the end of the time period for which the usage data is to be retrieved" + }, + "description": "Specifies the end of the time period for which the usage data is to be retrieved" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "credits_used": { + "type": "integer", + "description": "The number of credits used within the specified time period" + }, + "credits_remaining": { + "type": "integer", + "description": "The number of credits remaining in the account" + }, + "limit": { + "type": "integer", + "description": "The maximum number of credits available" + }, + "overages": { + "type": "integer", + "description": "The number of credits used beyond the limit" + }, + "start_time": { + "type": "integer", + "description": "The start timestamp for the usage data in second in second" + }, + "end_time": { + "type": "integer", + "description": "The end timestamp for the usage data in second in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A string containing an error message, if any issues occur during the request" + } + } + } + } + } + } + } + } + }, + "/v0/usage/rpc/by-chain": { + "get": { + "operationId": "get_v0_usage_rpc_by_chain", + "summary": "Retrieves usage data by chain.", + "tags": [ + "usage" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-chain" + }, + "parameters": [ + { + "name": "start_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the start of the time period for which the usage data is to be retrieved" + }, + "description": "Specifies the start of the time period for which the usage data is to be retrieved" + }, + { + "name": "end_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the end of the time period for which the usage data is to be retrieved" + }, + "description": "Specifies the end of the time period for which the usage data is to be retrieved" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the blockchain" + }, + "credits_used": { + "type": "integer", + "description": "The number of credits used by the specified blockchain (RPC credits and data credits combined)" + }, + "rpc_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by RPC requests" + }, + "data_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred" + }, + "bytes": { + "type": "integer", + "description": "The total number of data bytes transferred on the specified blockchain (for example, Streams and Yellowstone gRPC data). Contributes to data_credits" + } + } + }, + "description": "An array of blockchains and their corresponding credit usage" + }, + "start_time": { + "type": "integer", + "description": "The start timestamp for the data in second in second" + }, + "end_time": { + "type": "integer", + "description": "The end timestamp for the data in second in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/usage/rpc/by-endpoint": { + "get": { + "operationId": "get_v0_usage_rpc_by_endpoint", + "summary": "Retrieves usage data by endpoint.", + "tags": [ + "usage" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-endpoint" + }, + "parameters": [ + { + "name": "start_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + { + "name": "end_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the endpoint" + }, + "label": { + "type": "string", + "description": "A custom label for the endpoint" + }, + "chain": { + "type": "string", + "description": "The blockchain associated with the endpoint" + }, + "status": { + "type": "string", + "description": "The current state of the RPC endpoint. Possible values include: active, archived, paused or terminated" + }, + "network": { + "type": "string", + "description": "The specific network on the blockchain" + }, + "credits_used": { + "type": "integer", + "description": "The total number of credits used by the endpoint (RPC credits and data credits combined)" + }, + "rpc_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by RPC requests" + }, + "data_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred" + }, + "requests": { + "type": "integer", + "description": "The total number of requests made to the endpoint" + }, + "bytes": { + "type": "integer", + "description": "The total number of data bytes transferred by the endpoint (for example, Streams and Yellowstone gRPC data). Contributes to data_credits" + }, + "methods_breakdown": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method_name": { + "type": "string", + "description": "The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer" + }, + "credits_used": { + "type": "integer", + "description": "The number of credits used by the method (RPC credits and data credits combined)" + }, + "bytes": { + "type": "integer", + "description": "The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe)" + }, + "archive": { + "type": "boolean", + "description": "Indicates whether the request is using archived data" + } + } + }, + "description": "An array of methods_breakdown" + } + } + }, + "description": "An array of endpoints which contains the following fields:" + }, + "start_time": { + "type": "integer", + "description": "The start timestamp for the data in second in second" + }, + "end_time": { + "type": "integer", + "description": "The end timestamp for the data in second in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/usage/rpc/by-method": { + "get": { + "operationId": "get_v0_usage_rpc_by_method", + "summary": "Retrieves usage data by method.", + "tags": [ + "usage" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-method" + }, + "parameters": [ + { + "name": "start_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + "description": "Specifies the start of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + { + "name": "end_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + }, + "description": "Specifies the end of the time period for which the usage data is to be retrieved. For periods longer than a week, times are rounded down to midnight UTC for performance optimization." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method_name": { + "type": "string", + "description": "The name of the method called. Streaming methods such as /geyser.geyser/subscribe also appear here with the data they transfer" + }, + "credits_used": { + "type": "integer", + "description": "The number of credits used by the method (RPC credits and data credits combined)" + }, + "bytes": { + "type": "integer", + "description": "The number of data bytes transferred by the method (for streaming methods such as /geyser.geyser/subscribe)" + }, + "archive": { + "type": "boolean", + "description": "Indicates whether the request used archived data" + } + } + }, + "description": "An array of method calls and their corresponding credit usage" + }, + "start_time": { + "type": "integer", + "description": "The start timestamp for the data in second" + }, + "end_time": { + "type": "integer", + "description": "The end timestamp for the data in second" + } + }, + "description": "The data object which contains the following fields:" + }, + "error": { + "type": "string", + "description": "A field containing an error message if any issue occurs" + } + } + } + } + } + } + } + } + }, + "/v0/usage/rpc/by-tag": { + "get": { + "operationId": "get_v0_usage_rpc_by_tag", + "summary": "Retrieves usage data grouped by tag.", + "tags": [ + "usage" + ], + "externalDocs": { + "description": "Quicknode docs", + "url": "https://www.quicknode.com/docs/admin-api/usage/v0-usage-rpc-by-tag" + }, + "description": "Retrieves usage data grouped by tag. Includes an untagged bucket for endpoints with no tags.", + "parameters": [ + { + "name": "start_time", + "in": "query", + "schema": { + "type": "integer", + "description": "Start time as a unix timestamp" + }, + "description": "Start time as a unix timestamp" + }, + { + "name": "end_time", + "in": "query", + "schema": { + "type": "integer", + "description": "End time as a unix timestamp" + }, + "description": "End time as a unix timestamp" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag_id": { + "type": "integer", + "description": "The unique identifier of the tag" + }, + "label": { + "type": "string", + "description": "The label/name of the tag" + }, + "credits_used": { + "type": "integer", + "description": "The total number of credits used by endpoints with this tag (RPC credits and data credits combined)" + }, + "rpc_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by RPC requests" + }, + "data_credits": { + "type": "integer", + "description": "The portion of credits_used consumed by data usage, such as Streams and Yellowstone gRPC bytes transferred" + }, + "requests": { + "type": "integer", + "description": "The total number of requests made by endpoints with this tag" + }, + "bytes": { + "type": "integer", + "description": "The total number of data bytes transferred by endpoints with this tag (for example, Streams and Yellowstone gRPC data). Contributes to data_credits" + } + } + }, + "description": "An array of usage data objects, one per tag" + }, + "start_time": { + "type": "integer", + "description": "The start time of the usage period as a unix timestamp" + }, + "end_time": { + "type": "integer", + "description": "The end time of the usage period as a unix timestamp" + } + }, + "description": "Contains usage data grouped by tag" + }, + "error": { + "type": "string", + "description": "Contains error details if the request failed; null if successful" + } + } + } + } + } + } + } + } + } + }, + "servers": [ + { + "url": "https://api.quicknode.com", + "description": "Quicknode Admin API" + } + ], + "components": { + "securitySchemes": { + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "x-api-key" + } + } + }, + "security": [ + { + "apiKeyAuth": [] + } + ] +} \ No newline at end of file diff --git a/api/admin/patches.json b/api/admin/patches.json new file mode 100644 index 0000000..383c203 --- /dev/null +++ b/api/admin/patches.json @@ -0,0 +1,173 @@ +[ + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/tags", + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tag_id": { + "type": "integer" + }, + "label": { + "type": "string" + } + } + } + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/is_multichain", + "value": { + "type": "boolean" + } + }, + { + "op": "remove", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/tags" + }, + { + "op": "remove", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/is_multichain" + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/security/properties/options", + "value": { + "type": "object", + "properties": { + "tokens": { + "type": "boolean" + }, + "referrers": { + "type": "boolean" + }, + "jwts": { + "type": "boolean" + }, + "ips": { + "type": "boolean" + }, + "domainMasks": { + "type": "boolean" + }, + "hsts": { + "type": "boolean" + }, + "cors": { + "type": "boolean" + }, + "responseLogging": { + "type": "boolean" + }, + "requestFilters": { + "type": "boolean" + }, + "ipCustomHeader": { + "type": "object", + "properties": { + "value": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + }, + { + "op": "set", + "path": "/paths/~1v0~1chains/get/responses/200/content/application~1json/schema/properties/data/items/properties/networks/items/properties/chain_id", + "value": { + "type": "integer" + } + }, + { + "op": "set", + "path": "/paths/~1v0~1chains/get/responses/200/content/application~1json/schema/properties/data/items/properties/is_select_chain", + "value": { + "type": "boolean" + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}~1method-rate-limits/post/requestBody/content/application~1json/schema/properties/methods/items", + "value": { + "type": "string" + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}~1security~1request_filters/post/requestBody/content/application~1json/schema/properties/method/items", + "value": { + "type": "string" + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints/get/parameters/10/schema", + "value": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints/get/parameters/11/schema", + "value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/security/properties/domain_masks", + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "domain": { + "type": "string" + } + } + } + } + }, + { + "op": "remove", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/security/properties/domainMasks" + }, + { + "op": "set", + "path": "/paths/~1v0~1endpoints~1{id}/get/responses/200/content/application~1json/schema/properties/data/properties/security/properties/request_filters", + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "method": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } +] diff --git a/examples/endpoint/main.tf b/examples/endpoint/main.tf new file mode 100644 index 0000000..e7fd2d9 --- /dev/null +++ b/examples/endpoint/main.tf @@ -0,0 +1,33 @@ +terraform { + required_providers { + quicknode = { + source = "quicknode/quicknode" + } + } +} + +# Reads QUICKNODE_API_KEY from the environment. +provider "quicknode" {} + +data "quicknode_chains" "all" {} + +locals { + ethereum = one([for chain in data.quicknode_chains.all.chains : chain if chain.slug == "eth"]) +} + +resource "quicknode_endpoint" "payments" { + chain = local.ethereum.slug + network = "mainnet" + label = "payments-prod" + status = "active" + tags = ["prod", "payments"] +} + +output "rpc_url" { + value = quicknode_endpoint.payments.http_url_with_token + sensitive = true +} + +output "rpc_base_url" { + value = quicknode_endpoint.payments.http_url +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..eb7b73c --- /dev/null +++ b/go.mod @@ -0,0 +1,37 @@ +module github.com/quicknode/terraform-provider-quicknode + +go 1.26.3 + +require ( + github.com/hashicorp/terraform-plugin-framework v1.19.0 + github.com/hashicorp/terraform-plugin-framework-validators v0.19.0 + github.com/oapi-codegen/runtime v1.7.0 +) + +require ( + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect + github.com/hashicorp/go-plugin v1.7.0 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/terraform-plugin-go v0.31.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.11.0 // indirect + github.com/hashicorp/terraform-registry-address v0.4.0 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + golang.org/x/net v0.48.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/text v0.32.0 // indirect + golang.org/x/time v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/grpc v1.79.2 // indirect + google.golang.org/protobuf v1.36.11 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..174ce70 --- /dev/null +++ b/go.sum @@ -0,0 +1,114 @@ +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.7.0 h1:YghfQH/0QmPNc/AZMTFE3ac8fipZyZECHdDPshfk+mA= +github.com/hashicorp/go-plugin v1.7.0/go.mod h1:BExt6KEaIYx804z8k4gRzRLEvxKVb+kn0NMcihqOqb8= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/terraform-plugin-framework v1.19.0 h1:q0bwyhxAOR3vfdgbk9iplv3MlTv/dhBHTXjQOtQDoBA= +github.com/hashicorp/terraform-plugin-framework v1.19.0/go.mod h1:YRXOBu0jvs7xp4AThBbX4mAzYaMJ1JgtFH//oGKxwLc= +github.com/hashicorp/terraform-plugin-framework-validators v0.19.0 h1:Zz3iGgzxe/1XBkooZCewS0nJAaCFPFPHdNJd8FgE4Ow= +github.com/hashicorp/terraform-plugin-framework-validators v0.19.0/go.mod h1:GBKTNGbGVJohU03dZ7U8wHqc2zYnMUawgCN+gC0itLc= +github.com/hashicorp/terraform-plugin-go v0.31.0 h1:0Fz2r9DQ+kNNl6bx8HRxFd1TfMKUvnrOtvJPmp3Z0q8= +github.com/hashicorp/terraform-plugin-go v0.31.0/go.mod h1:A88bDhd/cW7FnwqxQRz3slT+QY6yzbHKc6AOTtmdeS8= +github.com/hashicorp/terraform-plugin-log v0.11.0 h1:WjhcpZIVqP8YRe83+dIZXncwSgtu4vh27i23G33PUQY= +github.com/hashicorp/terraform-plugin-log v0.11.0/go.mod h1:XygBz8+m5kgwTb73MMyrnUjeNQeVWECEfg+h2opMsj0= +github.com/hashicorp/terraform-registry-address v0.4.0 h1:S1yCGomj30Sao4l5BMPjTGZmCNzuv7/GDTDX99E9gTk= +github.com/hashicorp/terraform-registry-address v0.4.0/go.mod h1:LRS1Ay0+mAiRkUyltGT+UHWkIqTFvigGn/LbMshfflE= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= +github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= +github.com/oapi-codegen/runtime v1.7.0 h1:t7358VYPvNbWJ9gdAkIK/smVeHpBf6yp8VTsaZsb/7k= +github.com/oapi-codegen/runtime v1.7.0/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= +golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= +golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= +golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU= +google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/client/client.go b/internal/client/client.go new file mode 100644 index 0000000..9376bb8 --- /dev/null +++ b/internal/client/client.go @@ -0,0 +1,406 @@ +package client + +import ( + "context" + "net/http" + "strconv" + "strings" + "time" + + "golang.org/x/time/rate" + + "github.com/quicknode/terraform-provider-quicknode/api/admin" +) + +const DefaultBaseURL = "https://api.quicknode.com" + +type Client struct { + api *admin.ClientWithResponses +} + +type Option func(*options) + +type options struct { + baseURL string + httpClient *http.Client + maxRetries int + requestsPerSecond int +} + +func WithBaseURL(baseURL string) Option { + return func(o *options) { + if baseURL != "" { + o.baseURL = baseURL + } + } +} + +func WithHTTPClient(httpClient *http.Client) Option { + return func(o *options) { o.httpClient = httpClient } +} + +func WithMaxRetries(maxRetries int) Option { + return func(o *options) { o.maxRetries = maxRetries } +} + +// WithRequestsPerSecond throttles outbound calls. A terraform apply over a large +// workspace bursts many Admin API calls at once, so the provider paces itself +// rather than relying on the API to reject the excess. +func WithRequestsPerSecond(requestsPerSecond int) Option { + return func(o *options) { + if requestsPerSecond > 0 { + o.requestsPerSecond = requestsPerSecond + } + } +} + +func New(apiKey string, opts ...Option) (*Client, error) { + settings := options{ + baseURL: DefaultBaseURL, + maxRetries: defaultMaxRetries, + requestsPerSecond: defaultRequestsPerSecond, + } + for _, opt := range opts { + opt(&settings) + } + + httpClient := settings.httpClient + if httpClient == nil { + httpClient = &http.Client{Timeout: 60 * time.Second} + } + httpClient.Transport = &retryTransport{ + base: httpClient.Transport, + apiKey: apiKey, + maxRetries: settings.maxRetries, + baseDelay: defaultBaseDelay, + maxDelay: defaultMaxDelay, + limiter: rate.NewLimiter( + rate.Limit(settings.requestsPerSecond), + settings.requestsPerSecond, + ), + } + + api, err := admin.NewClientWithResponses(settings.baseURL, admin.WithHTTPClient(httpClient)) + if err != nil { + return nil, err + } + return &Client{api: api}, nil +} + +type Network struct { + Slug string + Name string + ChainID *int64 +} + +type Chain struct { + Slug string + IsSelectChain bool + Networks []Network +} + +type Endpoint struct { + ID string + Chain string + Network string + Label string + Status string + + // HTTPURL and WSSURL have the auth token removed. HTTPURLWithToken and + // WSSURLWithToken are what the API returned, credential included. The + // token does not sit at a fixed position in the path — some chains append + // a suffix after it, as in https:////evm — so a caller that + // needs a working URL must use the WithToken form rather than rebuilding + // one from the parts. + HTTPURL string + WSSURL string + HTTPURLWithToken string + WSSURLWithToken string + + Multichain bool + Tokens []EndpointToken + Tags []Tag +} + +// EndpointToken is one of an endpoint's auth tokens. An endpoint can carry +// several, which is why this is a list rather than a single value. +type EndpointToken struct { + ID string + Value string +} + +type Tag struct { + ID int64 + Label string +} + +func (c *Client) ListChains(ctx context.Context) ([]Chain, error) { + const operation = "list chains" + + resp, err := c.api.GetV0ChainsWithResponse(ctx) + if err != nil { + return nil, err + } + if resp.JSON200 == nil { + return nil, statusError(operation, resp.StatusCode(), resp.Body) + } + if err := envelopeError(operation, resp.StatusCode(), resp.JSON200.Error); err != nil { + return nil, err + } + if resp.JSON200.Data == nil { + return nil, nil + } + + chains := make([]Chain, 0, len(*resp.JSON200.Data)) + for _, raw := range *resp.JSON200.Data { + chain := Chain{Slug: deref(raw.Slug), IsSelectChain: deref(raw.IsSelectChain)} + if raw.Networks != nil { + for _, rawNetwork := range *raw.Networks { + network := Network{Slug: deref(rawNetwork.Slug), Name: deref(rawNetwork.Name)} + if rawNetwork.ChainId != nil { + chainID := int64(*rawNetwork.ChainId) + network.ChainID = &chainID + } + chain.Networks = append(chain.Networks, network) + } + } + chains = append(chains, chain) + } + return chains, nil +} + +func (c *Client) CreateEndpoint(ctx context.Context, chain, network string) (*Endpoint, error) { + const operation = "create endpoint" + + resp, err := c.api.PostV0EndpointsWithResponse(ctx, admin.PostV0EndpointsJSONRequestBody{ + Chain: chain, + Network: network, + }) + if err != nil { + return nil, err + } + if resp.JSON200 == nil { + return nil, statusError(operation, resp.StatusCode(), resp.Body) + } + if err := envelopeError(operation, resp.StatusCode(), resp.JSON200.Error); err != nil { + return nil, err + } + if resp.JSON200.Data == nil || resp.JSON200.Data.Id == nil { + return nil, &Error{Operation: operation, Status: resp.StatusCode(), Message: "response carried no endpoint id"} + } + + data := resp.JSON200.Data + endpoint := &Endpoint{ + ID: *data.Id, + Chain: deref(data.Chain), + Network: deref(data.Network), + Label: deref(data.Label), + } + endpoint.setURLs(deref(data.HttpUrl), deref(data.WssUrl)) + if data.Security != nil && data.Security.Tokens != nil { + for _, rawToken := range *data.Security.Tokens { + endpoint.Tokens = append(endpoint.Tokens, EndpointToken{ + ID: deref(rawToken.Id), + Value: deref(rawToken.Token), + }) + } + } + return endpoint, nil +} + +func (c *Client) GetEndpoint(ctx context.Context, id string) (*Endpoint, error) { + const operation = "read endpoint" + + resp, err := c.api.GetV0EndpointsByIdWithResponse(ctx, id) + if err != nil { + return nil, err + } + if resp.StatusCode() == http.StatusNotFound { + return nil, &Error{Operation: operation, Status: http.StatusNotFound, Message: "endpoint not found"} + } + if resp.JSON200 == nil { + return nil, statusError(operation, resp.StatusCode(), resp.Body) + } + if err := envelopeError(operation, resp.StatusCode(), resp.JSON200.Error); err != nil { + return nil, err + } + if resp.JSON200.Data == nil { + return nil, &Error{Operation: operation, Status: http.StatusNotFound, Message: "endpoint not found"} + } + + data := resp.JSON200.Data + endpoint := &Endpoint{ + ID: deref(data.Id), + Chain: deref(data.Chain), + Network: deref(data.Network), + Label: deref(data.Label), + Status: deref(data.Status), + Multichain: deref(data.IsMultichain), + } + endpoint.setURLs(deref(data.HttpUrl), deref(data.WssUrl)) + if data.Security != nil && data.Security.Tokens != nil { + for _, rawToken := range *data.Security.Tokens { + endpoint.Tokens = append(endpoint.Tokens, EndpointToken{ + ID: deref(rawToken.Id), + Value: deref(rawToken.Token), + }) + } + } + + if data.Tags != nil { + for _, rawTag := range *data.Tags { + tag := Tag{Label: deref(rawTag.Label)} + if rawTag.TagId != nil { + tag.ID = int64(*rawTag.TagId) + } + endpoint.Tags = append(endpoint.Tags, tag) + } + } + return endpoint, nil +} + +func (c *Client) SetEndpointLabel(ctx context.Context, id, label string) error { + const operation = "set endpoint label" + + resp, err := c.api.PatchV0EndpointsByIdWithResponse(ctx, id, admin.PatchV0EndpointsByIdJSONRequestBody{ + Label: label, + }) + if err != nil { + return err + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) +} + +func (c *Client) SetEndpointStatus(ctx context.Context, id, status string) error { + const operation = "set endpoint status" + + resp, err := c.api.PatchV0EndpointsByIdStatusWithResponse(ctx, id, admin.PatchV0EndpointsByIdStatusJSONRequestBody{ + Status: status, + }) + if err != nil { + return err + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) +} + +func (c *Client) SetEndpointMultichain(ctx context.Context, id string, enabled bool) error { + operation := "disable endpoint multichain" + if enabled { + operation = "enable endpoint multichain" + } + + if enabled { + resp, err := c.api.PostV0EndpointsByIdEnableMultichainWithResponse(ctx, id) + if err != nil { + return err + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) + } + + resp, err := c.api.PostV0EndpointsByIdDisableMultichainWithResponse(ctx, id) + if err != nil { + return err + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) +} + +func (c *Client) DeleteEndpoint(ctx context.Context, id string) error { + const operation = "delete endpoint" + + resp, err := c.api.DeleteV0EndpointsByIdWithResponse(ctx, id) + if err != nil { + return err + } + if resp.StatusCode() == http.StatusNotFound { + return nil + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + if resp.JSON200.Result != nil && !*resp.JSON200.Result { + return &Error{Operation: operation, Status: resp.StatusCode(), Message: "the API reported the endpoint was not deleted"} + } + return nil +} + +func (c *Client) AddEndpointTag(ctx context.Context, id, label string) error { + const operation = "add endpoint tag" + + resp, err := c.api.PostV0EndpointsByIdTagsWithResponse(ctx, id, admin.PostV0EndpointsByIdTagsJSONRequestBody{ + Label: label, + }) + if err != nil { + return err + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) +} + +func (c *Client) RemoveEndpointTag(ctx context.Context, id string, tagID int64) error { + const operation = "remove endpoint tag" + + resp, err := c.api.DeleteV0EndpointsByIdTagsByTagIdWithResponse(ctx, id, strconv.FormatInt(tagID, 10)) + if err != nil { + return err + } + if resp.StatusCode() == http.StatusNotFound { + return nil + } + if resp.JSON200 == nil { + return statusError(operation, resp.StatusCode(), resp.Body) + } + return envelopeError(operation, resp.StatusCode(), resp.JSON200.Error) +} + +func (e *Endpoint) setURLs(httpURL, wssURL string) { + e.HTTPURLWithToken = httpURL + e.WSSURLWithToken = wssURL + e.HTTPURL, _ = splitEndpointURL(httpURL) + e.WSSURL, _ = splitEndpointURL(wssURL) +} + +// splitEndpointURL separates the credential from an endpoint URL. The Admin API +// returns URLs shaped https://.quiknode.pro/[/], and +// the provider keeps the token-free prefix and suffix apart from the token so a +// configuration can avoid writing the credential to Terraform state. +func splitEndpointURL(raw string) (base, token string) { + if raw == "" { + return "", "" + } + scheme, rest, found := strings.Cut(raw, "://") + if !found { + return raw, "" + } + host, path, found := strings.Cut(rest, "/") + if !found || path == "" { + return raw, "" + } + token, suffix, _ := strings.Cut(path, "/") + base = scheme + "://" + host + if suffix != "" { + base += "/" + suffix + } + return base, token +} + +func deref[T any](value *T) T { + if value == nil { + var zero T + return zero + } + return *value +} diff --git a/internal/client/client_test.go b/internal/client/client_test.go new file mode 100644 index 0000000..1b175ff --- /dev/null +++ b/internal/client/client_test.go @@ -0,0 +1,55 @@ +package client + +import "testing" + +func TestSplitEndpointURL(t *testing.T) { + cases := []struct { + name string + raw string + wantBase string + wantToken string + }{ + { + name: "token followed by a chain suffix", + raw: "https://polished-damp-grass.hype-testnet.quiknode.pro/abc123/evm", + wantBase: "https://polished-damp-grass.hype-testnet.quiknode.pro/evm", + wantToken: "abc123", + }, + { + name: "token with no suffix", + raw: "https://example-name.quiknode.pro/abc123", + wantBase: "https://example-name.quiknode.pro", + wantToken: "abc123", + }, + { + name: "websocket scheme", + raw: "wss://example-name.quiknode.pro/abc123/evm", + wantBase: "wss://example-name.quiknode.pro/evm", + wantToken: "abc123", + }, + { + name: "no path at all", + raw: "https://example-name.quiknode.pro", + wantBase: "https://example-name.quiknode.pro", + wantToken: "", + }, + { + name: "empty", + raw: "", + wantBase: "", + wantToken: "", + }, + } + + for _, testCase := range cases { + t.Run(testCase.name, func(t *testing.T) { + base, token := splitEndpointURL(testCase.raw) + if base != testCase.wantBase { + t.Errorf("base = %q, want %q", base, testCase.wantBase) + } + if token != testCase.wantToken { + t.Errorf("token = %q, want %q", token, testCase.wantToken) + } + }) + } +} diff --git a/internal/client/endpoint_test.go b/internal/client/endpoint_test.go new file mode 100644 index 0000000..5e7ba50 --- /dev/null +++ b/internal/client/endpoint_test.go @@ -0,0 +1,108 @@ +package client + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" +) + +// hypeEndpointBody mirrors a live GET /v0/endpoints/{id} response for a chain +// that appends a path suffix after the token. The token is fabricated. +const hypeEndpointBody = `{"data":{"id":"652052","label":null,"chain":"hype","network":"hype-testnet", +"http_url":"https://polished-damp-grass.hype-testnet.quiknode.pro/TOKENVALUE/evm", +"wss_url":"wss://polished-damp-grass.hype-testnet.quiknode.pro/TOKENVALUE/evm", +"security":{"options":{"tokens":true,"cors":true}, +"tokens":[{"id":"d3312bd2-c1a2-4d89-865f-11c99fa3863a","token":"TOKENVALUE"}], +"jwts":null,"referrers":null,"domain_masks":null,"ips":null,"request_filters":null}, +"status":"active","rate_limits":{"rate_limit_by_ip":false,"account":-1,"rps":-1,"rpd":-1,"rpm":-1}, +"tags":[{"tag_id":7,"label":"prod"}],"is_multichain":false}}` + +// bitcoinEndpointBody mirrors a live response for a chain with no WebSocket +// support and no path suffix. +const bitcoinEndpointBody = `{"data":{"id":"613071","label":"ledger","chain":"btc","network":"btc", +"http_url":"https://frosty-capable-pallet.btc.quiknode.pro/TOKENVALUE/","wss_url":null, +"security":{"options":{"tokens":true},"tokens":[{"id":"abc","token":"TOKENVALUE"}]}, +"status":"paused","tags":[],"is_multichain":false}}` + +func newTestClient(t *testing.T, body string) *Client { + t.Helper() + + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("x-api-key") != "test-key" { + w.WriteHeader(http.StatusUnauthorized) + return + } + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(body)) + })) + t.Cleanup(server.Close) + + quicknode, err := New("test-key", WithBaseURL(server.URL)) + if err != nil { + t.Fatalf("New: %v", err) + } + return quicknode +} + +func TestGetEndpointWithPathSuffix(t *testing.T) { + endpoint, err := newTestClient(t, hypeEndpointBody).GetEndpoint(context.Background(), "652052") + if err != nil { + t.Fatalf("GetEndpoint: %v", err) + } + + const wantWorking = "https://polished-damp-grass.hype-testnet.quiknode.pro/TOKENVALUE/evm" + if endpoint.HTTPURLWithToken != wantWorking { + t.Errorf("HTTPURLWithToken = %q, want %q", endpoint.HTTPURLWithToken, wantWorking) + } + if endpoint.WSSURLWithToken != "wss://polished-damp-grass.hype-testnet.quiknode.pro/TOKENVALUE/evm" { + t.Errorf("WSSURLWithToken = %q", endpoint.WSSURLWithToken) + } + + // The token-free URL is not a working address on this chain, which is the + // reason HTTPURLWithToken exists. + if endpoint.HTTPURL == wantWorking { + t.Error("HTTPURL still carries the token") + } + if endpoint.HTTPURL+"/TOKENVALUE" == wantWorking { + t.Error("joining HTTPURL to the token happens to work here; the test no longer guards the bug it was written for") + } + + if len(endpoint.Tokens) != 1 || endpoint.Tokens[0].Value != "TOKENVALUE" { + t.Errorf("Tokens = %+v", endpoint.Tokens) + } + if len(endpoint.Tags) != 1 || endpoint.Tags[0].Label != "prod" || endpoint.Tags[0].ID != 7 { + t.Errorf("Tags = %+v", endpoint.Tags) + } + if endpoint.Status != "active" || endpoint.Multichain { + t.Errorf("Status = %q, Multichain = %v", endpoint.Status, endpoint.Multichain) + } +} + +func TestGetEndpointWithoutWebsocket(t *testing.T) { + endpoint, err := newTestClient(t, bitcoinEndpointBody).GetEndpoint(context.Background(), "613071") + if err != nil { + t.Fatalf("GetEndpoint: %v", err) + } + + if endpoint.WSSURL != "" || endpoint.WSSURLWithToken != "" { + t.Errorf("WSSURL = %q, WSSURLWithToken = %q, want both empty", endpoint.WSSURL, endpoint.WSSURLWithToken) + } + if endpoint.HTTPURLWithToken != "https://frosty-capable-pallet.btc.quiknode.pro/TOKENVALUE/" { + t.Errorf("HTTPURLWithToken = %q", endpoint.HTTPURLWithToken) + } + if endpoint.HTTPURL != "https://frosty-capable-pallet.btc.quiknode.pro" { + t.Errorf("HTTPURL = %q", endpoint.HTTPURL) + } + if endpoint.Status != "paused" || endpoint.Label != "ledger" { + t.Errorf("Status = %q, Label = %q", endpoint.Status, endpoint.Label) + } +} + +func TestGetEndpointRejectsEnvelopeError(t *testing.T) { + quicknode := newTestClient(t, `{"data":null,"error":"endpoint does not belong to this account"}`) + + if _, err := quicknode.GetEndpoint(context.Background(), "1"); err == nil { + t.Fatal("expected an error from a 200 response carrying an error field") + } +} diff --git a/internal/client/errors.go b/internal/client/errors.go new file mode 100644 index 0000000..a0bee44 --- /dev/null +++ b/internal/client/errors.go @@ -0,0 +1,53 @@ +package client + +import ( + "errors" + "fmt" + "net/http" +) + +// Error carries an Admin API failure. The Admin API can report a failure either +// through the HTTP status or through the "error" field of a 200 response body, +// so both paths produce this type. +type Error struct { + Operation string + Status int + Message string +} + +func (e *Error) Error() string { + if e.Message == "" { + return fmt.Sprintf("%s: unexpected HTTP %d", e.Operation, e.Status) + } + return fmt.Sprintf("%s: %s (HTTP %d)", e.Operation, e.Message, e.Status) +} + +func IsNotFound(err error) bool { + var apiErr *Error + return errors.As(err, &apiErr) && apiErr.Status == http.StatusNotFound +} + +// IsUnauthorized reports the two ways the Admin API rejects a key: an invalid +// key, and a key on a plan without Admin API access. +func IsUnauthorized(err error) bool { + var apiErr *Error + if !errors.As(err, &apiErr) { + return false + } + return apiErr.Status == http.StatusUnauthorized || apiErr.Status == http.StatusForbidden +} + +func statusError(operation string, status int, body []byte) error { + message := "" + if len(body) > 0 && len(body) < 512 { + message = string(body) + } + return &Error{Operation: operation, Status: status, Message: message} +} + +func envelopeError(operation string, status int, apiError *string) error { + if apiError == nil || *apiError == "" { + return nil + } + return &Error{Operation: operation, Status: status, Message: *apiError} +} diff --git a/internal/client/transport.go b/internal/client/transport.go new file mode 100644 index 0000000..e044813 --- /dev/null +++ b/internal/client/transport.go @@ -0,0 +1,140 @@ +package client + +import ( + "io" + "math" + "math/rand" + "net/http" + "strconv" + + "golang.org/x/time/rate" + "time" +) + +const ( + defaultMaxRetries = 4 + defaultBaseDelay = 500 * time.Millisecond + defaultMaxDelay = 30 * time.Second + defaultRequestsPerSecond = 5 +) + +// retryTransport retries throttled and transient responses. A terraform apply +// over a large workspace bursts many Admin API calls at once, so the provider +// backs off rather than surfacing a 429 as a resource failure. +type retryTransport struct { + base http.RoundTripper + apiKey string + maxRetries int + baseDelay time.Duration + maxDelay time.Duration + limiter *rate.Limiter + sleep func(time.Duration) +} + +func (t *retryTransport) RoundTrip(req *http.Request) (*http.Response, error) { + base := t.base + if base == nil { + base = http.DefaultTransport + } + sleep := t.sleep + if sleep == nil { + sleep = time.Sleep + } + + if t.limiter != nil { + if err := t.limiter.Wait(req.Context()); err != nil { + return nil, err + } + } + + var lastResp *http.Response + var lastErr error + + for attempt := 0; attempt <= t.maxRetries; attempt++ { + if attempt > 0 { + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + default: + } + sleep(t.delayFor(attempt, lastResp)) + } + + if lastResp != nil { + drain(lastResp) + } + + clone := req.Clone(req.Context()) + if t.apiKey != "" { + clone.Header.Set("x-api-key", t.apiKey) + } + if req.GetBody != nil { + body, err := req.GetBody() + if err != nil { + return nil, err + } + clone.Body = body + } + + lastResp, lastErr = base.RoundTrip(clone) + if lastErr != nil { + return nil, lastErr + } + if !shouldRetry(lastResp.StatusCode) { + return lastResp, nil + } + if req.GetBody == nil && req.Body != nil { + return lastResp, nil + } + } + + return lastResp, lastErr +} + +func (t *retryTransport) delayFor(attempt int, resp *http.Response) time.Duration { + if after := retryAfter(resp); after > 0 { + return min(after, t.maxDelay) + } + backoff := time.Duration(float64(t.baseDelay) * math.Pow(2, float64(attempt-1))) + jitter := time.Duration(rand.Int63n(int64(t.baseDelay))) + return min(backoff+jitter, t.maxDelay) +} + +func retryAfter(resp *http.Response) time.Duration { + if resp == nil { + return 0 + } + value := resp.Header.Get("Retry-After") + if value == "" { + return 0 + } + if seconds, err := strconv.Atoi(value); err == nil && seconds >= 0 { + return time.Duration(seconds) * time.Second + } + if when, err := http.ParseTime(value); err == nil { + if delay := time.Until(when); delay > 0 { + return delay + } + } + return 0 +} + +func shouldRetry(status int) bool { + switch status { + case http.StatusTooManyRequests, + http.StatusBadGateway, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout: + return true + default: + return false + } +} + +func drain(resp *http.Response) { + if resp == nil || resp.Body == nil { + return + } + _, _ = io.Copy(io.Discard, io.LimitReader(resp.Body, 4096)) + _ = resp.Body.Close() +} diff --git a/internal/provider/chains_data_source.go b/internal/provider/chains_data_source.go new file mode 100644 index 0000000..8df1d45 --- /dev/null +++ b/internal/provider/chains_data_source.go @@ -0,0 +1,132 @@ +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/quicknode/terraform-provider-quicknode/internal/client" +) + +var _ datasource.DataSource = (*chainsDataSource)(nil) +var _ datasource.DataSourceWithConfigure = (*chainsDataSource)(nil) + +type chainsDataSource struct { + client *client.Client +} + +type chainsDataSourceModel struct { + Chains []chainModel `tfsdk:"chains"` +} + +type chainModel struct { + Slug types.String `tfsdk:"slug"` + IsSelectChain types.Bool `tfsdk:"is_select_chain"` + Networks []networkModel `tfsdk:"networks"` +} + +type networkModel struct { + Slug types.String `tfsdk:"slug"` + Name types.String `tfsdk:"name"` + ChainID types.Int64 `tfsdk:"chain_id"` +} + +func NewChainsDataSource() datasource.DataSource { + return &chainsDataSource{} +} + +func (d *chainsDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_chains" +} + +func (d *chainsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Every chain and network Quicknode supports. Use it to validate slugs at plan time and to fan a configuration out across networks.\n\n" + + "Chain slugs are abbreviations that often differ from the chain's name: Ethereum is `eth`, Avalanche is `avax`, Arbitrum is `arb`, Polygon is `matic`.", + Attributes: map[string]schema.Attribute{ + "chains": schema.ListNestedAttribute{ + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "slug": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Chain slug, as `quicknode_endpoint.chain` expects it.", + }, + "is_select_chain": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Whether the chain is only available on Quicknode's Select plans.", + }, + "networks": schema.ListNestedAttribute{ + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "slug": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Network slug, as `quicknode_endpoint.network` expects it. Most are chain-qualified (`base-sepolia`), but some are not (`mainnet` for Ethereum, `bsc`, `optimism`).", + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Human-readable network name.", + }, + "chain_id": schema.Int64Attribute{ + Computed: true, + MarkdownDescription: "EVM chain id, or null on non-EVM networks.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func (d *chainsDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + data, ok := req.ProviderData.(providerData) + if !ok { + resp.Diagnostics.AddError("Unexpected provider data", fmt.Sprintf("The chains data source expected providerData, got %T.", req.ProviderData)) + return + } + d.client = data.Client +} + +func (d *chainsDataSource) Read(ctx context.Context, _ datasource.ReadRequest, resp *datasource.ReadResponse) { + chains, err := d.client.ListChains(ctx) + if err != nil { + resp.Diagnostics.AddError("Could not list Quicknode chains", err.Error()) + return + } + + state := chainsDataSourceModel{Chains: make([]chainModel, 0, len(chains))} + for _, chain := range chains { + entry := chainModel{ + Slug: types.StringValue(chain.Slug), + IsSelectChain: types.BoolValue(chain.IsSelectChain), + Networks: make([]networkModel, 0, len(chain.Networks)), + } + for _, network := range chain.Networks { + entry.Networks = append(entry.Networks, networkModel{ + Slug: types.StringValue(network.Slug), + Name: types.StringValue(network.Name), + ChainID: chainIDValue(network.ChainID), + }) + } + state.Chains = append(state.Chains, entry) + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +func chainIDValue(chainID *int64) types.Int64 { + if chainID == nil { + return types.Int64Null() + } + return types.Int64Value(*chainID) +} diff --git a/internal/provider/data.go b/internal/provider/data.go new file mode 100644 index 0000000..2bb4cc5 --- /dev/null +++ b/internal/provider/data.go @@ -0,0 +1,11 @@ +package provider + +import "github.com/quicknode/terraform-provider-quicknode/internal/client" + +// providerData is what Configure hands to every resource and data source. +// Chains is fetched once when the provider configures so that resources can +// validate chain and network slugs during plan, before anything is created. +type providerData struct { + Client *client.Client + Chains []client.Chain +} diff --git a/internal/provider/endpoint_resource.go b/internal/provider/endpoint_resource.go new file mode 100644 index 0000000..bac98bb --- /dev/null +++ b/internal/provider/endpoint_resource.go @@ -0,0 +1,479 @@ +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/quicknode/terraform-provider-quicknode/internal/client" +) + +const ( + statusActive = "active" + statusPaused = "paused" +) + +var endpointTokenAttrTypes = map[string]attr.Type{ + "id": types.StringType, + "token": types.StringType, +} + +var _ resource.Resource = (*endpointResource)(nil) +var _ resource.ResourceWithConfigure = (*endpointResource)(nil) +var _ resource.ResourceWithImportState = (*endpointResource)(nil) +var _ resource.ResourceWithModifyPlan = (*endpointResource)(nil) + +type endpointResource struct { + client *client.Client + chains []client.Chain +} + +type endpointResourceModel struct { + ID types.String `tfsdk:"id"` + Chain types.String `tfsdk:"chain"` + Network types.String `tfsdk:"network"` + Label types.String `tfsdk:"label"` + Status types.String `tfsdk:"status"` + Multichain types.Bool `tfsdk:"multichain"` + Tags types.Set `tfsdk:"tags"` + HTTPURL types.String `tfsdk:"http_url"` + WSSURL types.String `tfsdk:"wss_url"` + HTTPURLWithToken types.String `tfsdk:"http_url_with_token"` + WSSURLWithToken types.String `tfsdk:"wss_url_with_token"` + Tokens types.List `tfsdk:"tokens"` +} + +func NewEndpointResource() resource.Resource { + return &endpointResource{} +} + +func (r *endpointResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_endpoint" +} + +func (r *endpointResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "A Quicknode RPC endpoint on a chain and network.\n\n" + + "Pass `http_url_with_token` to anything that needs to make RPC calls. " + + "`http_url` and `wss_url` have the credential removed and are safe to log or expose, but they are not usable endpoints: " + + "the token does not sit at the end of the path on every chain, so rebuilding a URL by joining them to a token produces a broken address on chains that append a suffix.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Endpoint id.", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "chain": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Chain slug, for example `eth`, `base`, `arb`, `sol`. Slugs are often abbreviations rather than the chain's name; read `data.quicknode_chains` for the full list.", + PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, + }, + "network": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Network slug, for example `mainnet`, `base-sepolia`, `arbitrum-mainnet`.", + PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, + }, + "label": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Descriptive label. The Admin API cannot set a label while creating an endpoint, so the provider applies it in a second call.", + }, + "status": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(statusActive), + MarkdownDescription: "`active` or `paused`.", + Validators: []validator.String{stringvalidator.OneOf(statusActive, statusPaused)}, + }, + "multichain": schema.BoolAttribute{ + Optional: true, + Computed: true, + Default: booldefault.StaticBool(false), + MarkdownDescription: "Whether the endpoint serves more than one network.", + }, + "tags": schema.SetAttribute{ + Optional: true, + ElementType: types.StringType, + MarkdownDescription: "Tag labels applied to the endpoint. Omitting the attribute removes every tag the provider finds on the endpoint.", + }, + "http_url": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "HTTPS URL with the auth token removed. Safe to expose, but not a working endpoint.", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "wss_url": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "WebSocket URL with the auth token removed, or null on chains without WebSocket support.", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "http_url_with_token": schema.StringAttribute{ + Computed: true, + Sensitive: true, + MarkdownDescription: "The working HTTPS endpoint, exactly as the Admin API returns it. Pass this to whatever makes RPC calls.", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "wss_url_with_token": schema.StringAttribute{ + Computed: true, + Sensitive: true, + MarkdownDescription: "The working WebSocket endpoint, or null on chains without WebSocket support.", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "tokens": schema.ListNestedAttribute{ + Computed: true, + MarkdownDescription: "Auth tokens for the endpoint. An endpoint can carry several. Token values are stored in Terraform state, so keep state encrypted and remote.", + PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Token id.", + }, + "token": schema.StringAttribute{ + Computed: true, + Sensitive: true, + MarkdownDescription: "Token value.", + }, + }, + }, + }, + }, + } +} + +func (r *endpointResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + data, ok := req.ProviderData.(providerData) + if !ok { + resp.Diagnostics.AddError("Unexpected provider data", fmt.Sprintf("The endpoint resource expected providerData, got %T.", req.ProviderData)) + return + } + r.client = data.Client + r.chains = data.Chains +} + +// ModifyPlan rejects an unknown chain or network before anything is created, +// rather than letting the Admin API reject it partway through an apply. +func (r *endpointResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + if req.Plan.Raw.IsNull() { + return + } + + var config endpointResourceModel + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + if resp.Diagnostics.HasError() { + return + } + if config.Chain.IsUnknown() || config.Network.IsUnknown() { + return + } + + problem := validateChainNetwork(r.chains, config.Chain.ValueString(), config.Network.ValueString()) + if problem == nil { + return + } + resp.Diagnostics.AddAttributeError(path.Root(problem.Attribute), problem.Summary, problem.Detail) +} + +func (r *endpointResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan endpointResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.CreateEndpoint(ctx, plan.Chain.ValueString(), plan.Network.ValueString()) + if err != nil { + resp.Diagnostics.AddError("Could not create the Quicknode endpoint", err.Error()) + return + } + + plan.ID = types.StringValue(created.ID) + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + if label := plan.Label.ValueString(); label != "" { + if err := r.client.SetEndpointLabel(ctx, created.ID, label); err != nil { + resp.Diagnostics.AddError( + "Created the endpoint but could not set its label", + fmt.Sprintf("Endpoint %s exists and is tracked in state. %s", created.ID, err.Error()), + ) + return + } + } + + if plan.Multichain.ValueBool() { + if err := r.client.SetEndpointMultichain(ctx, created.ID, true); err != nil { + resp.Diagnostics.AddError("Created the endpoint but could not enable multichain", err.Error()) + return + } + } + + if plan.Status.ValueString() == statusPaused { + if err := r.client.SetEndpointStatus(ctx, created.ID, statusPaused); err != nil { + resp.Diagnostics.AddError("Created the endpoint but could not pause it", err.Error()) + return + } + } + + wanted, diags := tagLabels(ctx, plan.Tags) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + for _, label := range wanted { + if err := r.client.AddEndpointTag(ctx, created.ID, label); err != nil { + resp.Diagnostics.AddError("Created the endpoint but could not tag it", err.Error()) + return + } + } + + r.readInto(ctx, created.ID, &plan, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +func (r *endpointResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state endpointResourceModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + endpoint, err := r.client.GetEndpoint(ctx, state.ID.ValueString()) + if client.IsNotFound(err) { + resp.State.RemoveResource(ctx) + return + } + if err != nil { + resp.Diagnostics.AddError("Could not read the Quicknode endpoint", err.Error()) + return + } + + resp.Diagnostics.Append(applyEndpoint(endpoint, &state)...) + if resp.Diagnostics.HasError() { + return + } + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +func (r *endpointResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state endpointResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + id := state.ID.ValueString() + plan.ID = state.ID + + if !plan.Label.Equal(state.Label) { + if err := r.client.SetEndpointLabel(ctx, id, plan.Label.ValueString()); err != nil { + resp.Diagnostics.AddError("Could not update the endpoint label", err.Error()) + return + } + } + + if !plan.Multichain.Equal(state.Multichain) { + if err := r.client.SetEndpointMultichain(ctx, id, plan.Multichain.ValueBool()); err != nil { + resp.Diagnostics.AddError("Could not update endpoint multichain", err.Error()) + return + } + } + + if !plan.Status.Equal(state.Status) { + if err := r.client.SetEndpointStatus(ctx, id, plan.Status.ValueString()); err != nil { + resp.Diagnostics.AddError("Could not update the endpoint status", err.Error()) + return + } + } + + if !plan.Tags.Equal(state.Tags) { + resp.Diagnostics.Append(r.reconcileTags(ctx, id, plan.Tags)...) + if resp.Diagnostics.HasError() { + return + } + } + + r.readInto(ctx, id, &plan, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +func (r *endpointResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state endpointResourceModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + if err := r.client.DeleteEndpoint(ctx, state.ID.ValueString()); err != nil { + resp.Diagnostics.AddError("Could not delete the Quicknode endpoint", err.Error()) + } +} + +func (r *endpointResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// readInto refreshes only the attributes the API computes. Create and Update +// leave configured attributes at their planned values, because Terraform +// rejects an applied state that disagrees with the plan. +func (r *endpointResource) readInto(ctx context.Context, id string, model *endpointResourceModel, diags *diag.Diagnostics) { + endpoint, err := r.client.GetEndpoint(ctx, id) + if err != nil { + diags.AddError("Could not read the Quicknode endpoint back", err.Error()) + return + } + model.ID = types.StringValue(endpoint.ID) + applyEndpointURLs(endpoint, model) + + tokens, tokenDiags := tokenList(endpoint.Tokens) + diags.Append(tokenDiags...) + model.Tokens = tokens +} + +func applyEndpoint(endpoint *client.Endpoint, state *endpointResourceModel) diag.Diagnostics { + var diags diag.Diagnostics + + state.ID = types.StringValue(endpoint.ID) + state.Chain = types.StringValue(endpoint.Chain) + state.Network = types.StringValue(endpoint.Network) + state.Status = types.StringValue(endpoint.Status) + state.Multichain = types.BoolValue(endpoint.Multichain) + applyEndpointURLs(endpoint, state) + + tokens, tokenDiags := tokenList(endpoint.Tokens) + diags.Append(tokenDiags...) + state.Tokens = tokens + + if endpoint.Label == "" { + state.Label = types.StringNull() + } else { + state.Label = types.StringValue(endpoint.Label) + } + + if len(endpoint.Tags) == 0 && state.Tags.IsNull() { + return diags + } + labels := make([]attr.Value, 0, len(endpoint.Tags)) + for _, tag := range endpoint.Tags { + labels = append(labels, types.StringValue(tag.Label)) + } + tagSet, tagDiags := types.SetValue(types.StringType, labels) + diags.Append(tagDiags...) + state.Tags = tagSet + return diags +} + +// applyEndpointURLs maps empty URLs to null so that a chain without WebSocket +// support reports wss_url as absent rather than as an empty string. +func applyEndpointURLs(endpoint *client.Endpoint, model *endpointResourceModel) { + model.HTTPURL = stringOrNull(endpoint.HTTPURL) + model.WSSURL = stringOrNull(endpoint.WSSURL) + model.HTTPURLWithToken = stringOrNull(endpoint.HTTPURLWithToken) + model.WSSURLWithToken = stringOrNull(endpoint.WSSURLWithToken) +} + +func stringOrNull(value string) types.String { + if value == "" { + return types.StringNull() + } + return types.StringValue(value) +} + +func tokenList(tokens []client.EndpointToken) (types.List, diag.Diagnostics) { + elementType := types.ObjectType{AttrTypes: endpointTokenAttrTypes} + values := make([]attr.Value, 0, len(tokens)) + var diags diag.Diagnostics + + for _, token := range tokens { + value, objectDiags := types.ObjectValue(endpointTokenAttrTypes, map[string]attr.Value{ + "id": types.StringValue(token.ID), + "token": types.StringValue(token.Value), + }) + diags.Append(objectDiags...) + values = append(values, value) + } + if diags.HasError() { + return types.ListNull(elementType), diags + } + + list, listDiags := types.ListValue(elementType, values) + diags.Append(listDiags...) + return list, diags +} + +func (r *endpointResource) reconcileTags(ctx context.Context, id string, planned types.Set) diag.Diagnostics { + var diags diag.Diagnostics + + wanted, tagDiags := tagLabels(ctx, planned) + diags.Append(tagDiags...) + if diags.HasError() { + return diags + } + + endpoint, err := r.client.GetEndpoint(ctx, id) + if err != nil { + diags.AddError("Could not read the endpoint's current tags", err.Error()) + return diags + } + + current := make(map[string]int64, len(endpoint.Tags)) + for _, tag := range endpoint.Tags { + current[tag.Label] = tag.ID + } + keep := make(map[string]struct{}, len(wanted)) + for _, label := range wanted { + keep[label] = struct{}{} + } + + for label, tagID := range current { + if _, ok := keep[label]; ok { + continue + } + if err := r.client.RemoveEndpointTag(ctx, id, tagID); err != nil { + diags.AddError("Could not remove an endpoint tag", fmt.Sprintf("tag %q: %s", label, err.Error())) + return diags + } + } + for _, label := range wanted { + if _, ok := current[label]; ok { + continue + } + if err := r.client.AddEndpointTag(ctx, id, label); err != nil { + diags.AddError("Could not add an endpoint tag", fmt.Sprintf("tag %q: %s", label, err.Error())) + return diags + } + } + return diags +} + +func tagLabels(ctx context.Context, tags types.Set) ([]string, diag.Diagnostics) { + if tags.IsNull() || tags.IsUnknown() { + return nil, nil + } + var labels []string + diags := tags.ElementsAs(ctx, &labels, false) + return labels, diags +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go new file mode 100644 index 0000000..5ddc5b2 --- /dev/null +++ b/internal/provider/provider.go @@ -0,0 +1,142 @@ +package provider + +import ( + "context" + "os" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/provider" + "github.com/hashicorp/terraform-plugin-framework/provider/schema" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/quicknode/terraform-provider-quicknode/internal/client" +) + +const apiKeyEnvVar = "QUICKNODE_API_KEY" + +// legacyAPIKeyEnvVars are the variables the community providers read. The +// official provider accepts them so a migrating configuration keeps working. +var legacyAPIKeyEnvVars = []string{"QUICKNODE_APIKEY", "QUICKNODE_API_TOKEN"} + +var _ provider.Provider = (*quicknodeProvider)(nil) + +type quicknodeProvider struct { + version string +} + +type providerModel struct { + APIKey types.String `tfsdk:"api_key"` + BaseURL types.String `tfsdk:"base_url"` + RequestsPerSecond types.Int64 `tfsdk:"requests_per_second"` +} + +func New(version string) func() provider.Provider { + return func() provider.Provider { + return &quicknodeProvider{version: version} + } +} + +func (p *quicknodeProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) { + resp.TypeName = "quicknode" + resp.Version = p.version +} + +func (p *quicknodeProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Manage Quicknode RPC infrastructure as code.", + Attributes: map[string]schema.Attribute{ + "api_key": schema.StringAttribute{ + Optional: true, + Sensitive: true, + MarkdownDescription: "Quicknode Admin API key. Defaults to the `" + apiKeyEnvVar + "` environment variable. Prefer the environment variable so the key stays out of configuration and state.", + }, + "base_url": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Admin API base URL. Defaults to `" + client.DefaultBaseURL + "`.", + }, + "requests_per_second": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Throttle applied to Admin API calls. A large workspace bursts many calls during one apply, so the provider paces itself.", + Validators: []validator.Int64{int64validator.AtLeast(1)}, + }, + }, + } +} + +func (p *quicknodeProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { + var config providerModel + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + if resp.Diagnostics.HasError() { + return + } + + if config.APIKey.IsUnknown() { + resp.Diagnostics.AddAttributeError( + path.Root("api_key"), + "Admin API key is not known at plan time", + "The api_key value comes from another resource that has not been applied yet. Set it from a variable or from the "+apiKeyEnvVar+" environment variable instead.", + ) + return + } + + apiKey := os.Getenv(apiKeyEnvVar) + for _, legacy := range legacyAPIKeyEnvVars { + if apiKey != "" { + break + } + apiKey = os.Getenv(legacy) + } + if !config.APIKey.IsNull() && config.APIKey.ValueString() != "" { + apiKey = config.APIKey.ValueString() + } + if apiKey == "" { + resp.Diagnostics.AddAttributeError( + path.Root("api_key"), + "Missing Admin API key", + "Set the "+apiKeyEnvVar+" environment variable, or set api_key on the provider block. Admin API access requires a paid Quicknode plan.", + ) + return + } + + quicknode, err := client.New(apiKey, + client.WithBaseURL(config.BaseURL.ValueString()), + client.WithRequestsPerSecond(int(config.RequestsPerSecond.ValueInt64())), + ) + if err != nil { + resp.Diagnostics.AddError("Could not build the Quicknode API client", err.Error()) + return + } + + chains, err := quicknode.ListChains(ctx) + if err != nil { + if client.IsUnauthorized(err) { + resp.Diagnostics.AddError( + "Quicknode rejected the Admin API key", + "Check that the key is valid and that the account is on a paid plan, which Admin API access requires. "+err.Error(), + ) + return + } + resp.Diagnostics.AddError("Could not reach the Quicknode Admin API", err.Error()) + return + } + + data := providerData{Client: quicknode, Chains: chains} + resp.DataSourceData = data + resp.ResourceData = data +} + +func (p *quicknodeProvider) Resources(_ context.Context) []func() resource.Resource { + return []func() resource.Resource{ + NewEndpointResource, + } +} + +func (p *quicknodeProvider) DataSources(_ context.Context) []func() datasource.DataSource { + return []func() datasource.DataSource{ + NewChainsDataSource, + } +} diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go new file mode 100644 index 0000000..da300b6 --- /dev/null +++ b/internal/provider/provider_test.go @@ -0,0 +1,40 @@ +package provider_test + +import ( + "context" + "testing" + + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + + "github.com/quicknode/terraform-provider-quicknode/internal/provider" +) + +func TestProviderSchema(t *testing.T) { + server := providerserver.NewProtocol6(provider.New("test")())() + + schema, err := server.GetProviderSchema(context.Background(), &tfprotov6.GetProviderSchemaRequest{}) + if err != nil { + t.Fatalf("GetProviderSchema: %v", err) + } + for _, diagnostic := range schema.Diagnostics { + if diagnostic.Severity == tfprotov6.DiagnosticSeverityError { + t.Errorf("schema diagnostic: %s — %s", diagnostic.Summary, diagnostic.Detail) + } + } + + if _, ok := schema.ResourceSchemas["quicknode_endpoint"]; !ok { + t.Errorf("quicknode_endpoint is missing, got %v", keys(schema.ResourceSchemas)) + } + if _, ok := schema.DataSourceSchemas["quicknode_chains"]; !ok { + t.Errorf("quicknode_chains is missing, got %v", keys(schema.DataSourceSchemas)) + } +} + +func keys[T any](m map[string]T) []string { + out := make([]string, 0, len(m)) + for k := range m { + out = append(out, k) + } + return out +} diff --git a/internal/provider/slug_validation.go b/internal/provider/slug_validation.go new file mode 100644 index 0000000..952d176 --- /dev/null +++ b/internal/provider/slug_validation.go @@ -0,0 +1,75 @@ +package provider + +import ( + "fmt" + "sort" + "strings" + + "github.com/quicknode/terraform-provider-quicknode/internal/client" +) + +// slugProblem is a rejected chain or network, named by the attribute it belongs +// to so the caller can attach it to the right path. +type slugProblem struct { + Attribute string + Summary string + Detail string +} + +// validateChainNetwork matches slugs exactly rather than case-insensitively. +// The Admin API echoes back its own casing, and chain and network force +// replacement, so accepting "ETH" for "eth" would let Read overwrite the +// configured value on the next refresh and leave every subsequent plan +// proposing a destroy and create that never converges. +func validateChainNetwork(chains []client.Chain, wantChain, wantNetwork string) *slugProblem { + if len(chains) == 0 { + return nil + } + + for _, chain := range chains { + if chain.Slug != wantChain { + continue + } + networkSlugs := make([]string, 0, len(chain.Networks)) + for _, network := range chain.Networks { + if network.Slug == wantNetwork { + return nil + } + networkSlugs = append(networkSlugs, network.Slug) + } + for _, network := range chain.Networks { + if strings.EqualFold(network.Slug, wantNetwork) { + return &slugProblem{ + Attribute: "network", + Summary: "Network slug differs in case", + Detail: fmt.Sprintf("Use %q rather than %q. Quicknode reports its own casing back, and network forces replacement, so a mismatch would make every plan propose a replacement.", network.Slug, wantNetwork), + } + } + } + sort.Strings(networkSlugs) + return &slugProblem{ + Attribute: "network", + Summary: "Unknown network for this chain", + Detail: fmt.Sprintf("Chain %q has no network %q. Its networks are: %s.", wantChain, wantNetwork, strings.Join(networkSlugs, ", ")), + } + } + + chainSlugs := make([]string, 0, len(chains)) + for _, chain := range chains { + if strings.EqualFold(chain.Slug, wantChain) { + return &slugProblem{ + Attribute: "chain", + Summary: "Chain slug differs in case", + Detail: fmt.Sprintf("Use %q rather than %q. Quicknode reports its own casing back, and chain forces replacement, so a mismatch would make every plan propose a replacement.", chain.Slug, wantChain), + } + } + chainSlugs = append(chainSlugs, chain.Slug) + } + + sort.Strings(chainSlugs) + return &slugProblem{ + Attribute: "chain", + Summary: "Unknown chain", + Detail: fmt.Sprintf("Quicknode has no chain %q. Chain slugs are abbreviations, so Ethereum is \"eth\" and Polygon is \"matic\". Known chains: %s.", wantChain, strings.Join(chainSlugs, ", ")), + } +} diff --git a/internal/provider/slug_validation_test.go b/internal/provider/slug_validation_test.go new file mode 100644 index 0000000..e0ffbed --- /dev/null +++ b/internal/provider/slug_validation_test.go @@ -0,0 +1,76 @@ +package provider + +import ( + "strings" + "testing" + + "github.com/quicknode/terraform-provider-quicknode/internal/client" +) + +func testChains() []client.Chain { + return []client.Chain{ + {Slug: "eth", Networks: []client.Network{ + {Slug: "mainnet"}, {Slug: "ethereum-sepolia"}, {Slug: "ethereum-hoodi"}, + }}, + {Slug: "base", Networks: []client.Network{ + {Slug: "base-mainnet"}, {Slug: "base-sepolia"}, + }}, + } +} + +func TestValidateChainNetwork(t *testing.T) { + cases := []struct { + name string + chain string + network string + wantAttr string + wantDetails string + }{ + {name: "exact match", chain: "eth", network: "mainnet"}, + {name: "exact match on a qualified network", chain: "base", network: "base-sepolia"}, + { + name: "chain case mismatch is rejected", chain: "ETH", network: "mainnet", + wantAttr: "chain", wantDetails: `Use "eth" rather than "ETH"`, + }, + { + name: "network case mismatch is rejected", chain: "base", network: "Base-Sepolia", + wantAttr: "network", wantDetails: `Use "base-sepolia" rather than "Base-Sepolia"`, + }, + { + name: "chain name instead of slug", chain: "ethereum", network: "mainnet", + wantAttr: "chain", wantDetails: "has no chain", + }, + { + name: "network from another chain", chain: "eth", network: "base-sepolia", + wantAttr: "network", wantDetails: "has no network", + }, + } + + for _, testCase := range cases { + t.Run(testCase.name, func(t *testing.T) { + problem := validateChainNetwork(testChains(), testCase.chain, testCase.network) + + if testCase.wantAttr == "" { + if problem != nil { + t.Fatalf("expected no problem, got %s: %s", problem.Summary, problem.Detail) + } + return + } + if problem == nil { + t.Fatal("expected a problem, got none") + } + if problem.Attribute != testCase.wantAttr { + t.Errorf("attribute = %q, want %q", problem.Attribute, testCase.wantAttr) + } + if !strings.Contains(problem.Detail, testCase.wantDetails) { + t.Errorf("detail = %q, want it to contain %q", problem.Detail, testCase.wantDetails) + } + }) + } +} + +func TestValidateChainNetworkSkipsWhenChainsUnavailable(t *testing.T) { + if problem := validateChainNetwork(nil, "nonsense", "nonsense"); problem != nil { + t.Errorf("expected validation to be skipped without a chain list, got %s", problem.Summary) + } +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..33de2d5 --- /dev/null +++ b/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "context" + "flag" + "log" + + "github.com/hashicorp/terraform-plugin-framework/providerserver" + + "github.com/quicknode/terraform-provider-quicknode/internal/provider" +) + +var version = "dev" + +func main() { + var debug bool + flag.BoolVar(&debug, "debug", false, "run the provider with support for debuggers") + flag.Parse() + + err := providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{ + Address: "registry.terraform.io/quicknode/quicknode", + Debug: debug, + }) + if err != nil { + log.Fatal(err) + } +} From 122196ce38064bcb1e49e563ec9cdea241840733 Mon Sep 17 00:00:00 2001 From: AlejandroFabianCampos Date: Tue, 22 Sep 2026 12:25:33 -0500 Subject: [PATCH 2/4] feat: add registry publishing, docs generation and repo conventions Co-Authored-By: Claude Opus 5 (1M context) --- .gitattributes | 5 + .github/dependabot.yml | 18 +++ .github/workflows/release.yml | 35 ++++++ .github/workflows/test.yml | 88 ++++++++++++++ .golangci.yml | 27 +++++ .goreleaser.yml | 58 ++++++++++ CHANGELOG.md | 8 ++ CODEOWNERS | 1 + CONTRIBUTING.md | 83 ++++++++++++++ GNUmakefile | 12 +- README.md | 108 +++++++++--------- SECURITY.md | 26 +++++ docs/data-sources/chains.md | 56 +++++++++ docs/index.md | 63 ++++++++++ docs/resources/endpoint.md | 80 +++++++++++++ .../quicknode_chains/data-source.tf | 12 ++ examples/endpoint/main.tf | 33 ------ examples/provider/provider.tf | 11 ++ .../resources/quicknode_endpoint/import.sh | 2 + .../resources/quicknode_endpoint/resource.tf | 18 +++ internal/provider/endpoint_resource.go | 2 +- templates/index.md.tmpl | 44 +++++++ terraform-registry-manifest.json | 8 ++ 23 files changed, 710 insertions(+), 88 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml create mode 100644 .golangci.yml create mode 100644 .goreleaser.yml create mode 100644 CHANGELOG.md create mode 100644 CODEOWNERS create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md create mode 100644 docs/data-sources/chains.md create mode 100644 docs/index.md create mode 100644 docs/resources/endpoint.md create mode 100644 examples/data-sources/quicknode_chains/data-source.tf delete mode 100644 examples/endpoint/main.tf create mode 100644 examples/provider/provider.tf create mode 100644 examples/resources/quicknode_endpoint/import.sh create mode 100644 examples/resources/quicknode_endpoint/resource.tf create mode 100644 templates/index.md.tmpl create mode 100644 terraform-registry-manifest.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..33729ef --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +api/admin/admin.gen.go linguist-generated=true +api/admin/openapi.json linguist-generated=true +api/admin/openapi.upstream.json linguist-vendored=true +docs/** linguist-generated=true +* text=auto eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c215a41 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly + groups: + go-dependencies: + patterns: + - "*" + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d6e908d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + id: import_gpg + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8bd6cac --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,88 @@ +name: Tests + +on: + pull_request: + paths-ignore: + - "README.md" + push: + branches: + - main + paths-ignore: + - "README.md" + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - run: go mod download + - run: go build -v ./... + - name: Run linters + uses: golangci/golangci-lint-action@v8 + with: + version: v2.5.0 + + generate: + name: Docs up to date + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - run: make docs + - name: Check for uncommitted changes + run: | + git diff --compact-summary --exit-code || \ + (echo; echo "Unexpected difference in directories after code generation. Run 'make docs' and commit."; exit 1) + + test: + name: Unit tests + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - run: go mod download + - run: go test -v -cover ./... + + acceptance: + name: Acceptance tests + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + if: github.event_name == 'push' + strategy: + fail-fast: false + matrix: + terraform: + - "1.13.*" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ matrix.terraform }} + terraform_wrapper: false + - run: go mod download + - env: + TF_ACC: "1" + QUICKNODE_API_KEY: ${{ secrets.QUICKNODE_API_KEY }} + run: go test -v -timeout 30m ./... diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..93c39b7 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,27 @@ +version: "2" + +run: + timeout: 5m + +linters: + default: standard + enable: + - bodyclose + - copyloopvar + - errorlint + - misspell + - nilerr + - predeclared + - unconvert + - usestdlibvars + exclusions: + generated: lax + paths: + - api/admin/admin.gen.go + +formatters: + enable: + - gofmt + exclusions: + paths: + - api/admin/admin.gen.go diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..321085a --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,58 @@ +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + flags: + - -trimpath + ldflags: + - "-s -w -X main.version={{.Version}}" + goos: + - darwin + - freebsd + - linux + - windows + goarch: + - amd64 + - arm64 + - "386" + - arm + goarm: + - "6" + ignore: + - goos: darwin + goarch: "386" + - goos: darwin + goarch: arm + - goos: windows + goarch: arm + binary: "{{ .ProjectName }}_v{{ .Version }}" + +archives: + - formats: [zip] + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" + algorithm: sha256 + +signs: + - artifacts: checksum + args: + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" + +release: + draft: false + +changelog: + disable: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a09bc6d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## Unreleased + +FEATURES: + +* **New Resource:** `quicknode_endpoint` +* **New Data Source:** `quicknode_chains` diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..95d9aea --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @quicknode/devex diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..891a489 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,83 @@ +# Contributing + +Thanks for helping improve the Quicknode Terraform provider. + +## Getting set up + +You need Go (the version in `go.mod`) and Terraform 1.13 or later. + +```sh +make build # compile +make test # unit tests +make lint # gofmt, go vet, golangci-lint +``` + +## Trying a local build + +Terraform normally downloads providers from the registry. To point it at a local +build instead, add a development override to `~/.terraformrc`: + +```hcl +provider_installation { + dev_overrides { + "quicknode/quicknode" = "/path/to/your/GOPATH/bin" + } + direct {} +} +``` + +Then `go install .` and run Terraform as usual. Skip `terraform init` — with an +override in place it is neither needed nor supported. + +## Making changes + +**Schema changes require regenerated docs.** `docs/` is generated from the +provider schema and the files under `examples/`, and CI fails if it is stale: + +```sh +make docs +``` + +Commit the result alongside your change. + +**API client changes.** `api/admin/admin.gen.go` is generated and should never +be edited by hand. It comes from `api/admin/openapi.upstream.json`, which is +vendored verbatim, plus the local schema corrections in +`api/admin/patches.json`. To pick up an upstream spec change: + +```sh +make vendor # refresh the vendored spec +make generate # apply patches, regenerate the client +``` + +Review the `make vendor` diff before generating — an upstream change can +silently invalidate a patch. + +Domain types live in `internal/client`, not in the generated package. The +provider layer imports `internal/client` and never `api/admin`. + +## Tests + +Unit tests run against `httptest` servers and need no credentials. + +Acceptance tests create real, billable Quicknode resources. They need an Admin +API key for a paid account dedicated to testing: + +```sh +QUICKNODE_API_KEY=... make testacc +``` + +Do not run them against an account with production endpoints. + +## Pull requests + +- One logical change per pull request. +- Include tests for behavior changes. +- Run `make lint`, `make test` and `make docs` before pushing. +- Describe what the change does and why, not just what files moved. + +## Reporting bugs + +Open an issue with the provider version, the Terraform version, a minimal +configuration that reproduces the problem, and the output of the failing +command. Redact API keys and endpoint URLs containing tokens. diff --git a/GNUmakefile b/GNUmakefile index 8dc101d..02b00bf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,6 @@ OAPI_CODEGEN_VERSION ?= v2.8.0 +TFPLUGINDOCS_VERSION ?= v0.23.0 +GOLANGCI_LINT_VERSION ?= v2.5.0 ADMIN_SPEC_URL ?= https://www.quicknode.com/docs/openapi/admin-api.openapi.json default: build @@ -17,9 +19,17 @@ generate: cd api/admin && go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@$(OAPI_CODEGEN_VERSION) -config config.yaml openapi.json gofmt -w api/admin/admin.gen.go +docs: + go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@$(TFPLUGINDOCS_VERSION) generate --provider-name quicknode + +fmt: + gofmt -w . + terraform fmt -recursive ./examples/ + lint: gofmt -l . | tee /dev/stderr | (! read) go vet ./... + go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run ./... test: go test ./... @@ -29,4 +39,4 @@ test: testacc: TF_ACC=1 go test ./... -v -timeout 30m -.PHONY: default build vendor generate lint test testacc +.PHONY: default build vendor generate docs fmt lint test testacc diff --git a/README.md b/README.md index f664dd6..0db2937 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,19 @@ # Terraform Provider for Quicknode -The official [Terraform](https://developer.hashicorp.com/terraform) provider for [Quicknode](https://www.quicknode.com) — manage your blockchain infrastructure as code: RPC endpoints, security rules, rate limits, Streams, and Webhooks, all through `terraform plan` and `apply`. +The official [Terraform](https://developer.hashicorp.com/terraform) provider for +[Quicknode](https://www.quicknode.com). Manage RPC endpoints, security rules and +rate limits with `terraform plan` and `terraform apply`. -## Why +- [Provider documentation](./docs) — also published to the Terraform Registry +- [Contributing](./CONTRIBUTING.md) +- [Changelog](./CHANGELOG.md) -Teams run their Quicknode setup across environments and chains, and that setup deserves the same workflow as the rest of their infrastructure: version control, pull-request review for security changes, drift detection, and repeatable environments — no click-ops. +## Requirements -## Usage +- [Terraform](https://developer.hashicorp.com/terraform/install) 1.13 or later +- [Go](https://go.dev/doc/install) — the version in [`go.mod`](./go.mod), to build from source + +## Using the provider ```hcl terraform { @@ -18,81 +25,76 @@ terraform { } } -# Reads QUICKNODE_API_KEY from the environment provider "quicknode" {} resource "quicknode_endpoint" "payments" { chain = "eth" network = "mainnet" label = "payments-prod" - tags = ["prod", "payments"] } +``` -# Working endpoint, credential included. -output "rpc_url" { - value = quicknode_endpoint.payments.http_url_with_token - sensitive = true -} +Authentication uses a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) +key, available on paid plans. Set `QUICKNODE_API_KEY` in the environment rather +than writing it into a configuration file. -# Same endpoint with the credential removed: safe to log or display. -output "rpc_base_url" { - value = quicknode_endpoint.payments.http_url -} -``` +Full resource and attribute reference lives in [`docs/`](./docs). + +## Building -Chain slugs are abbreviations that often differ from the chain's name — Ethereum is `eth`, Avalanche is `avax`, Arbitrum is `arb`, Polygon is `matic`. Read `data.quicknode_chains` for the full list. +```sh +make build +``` -Authentication uses a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) key (paid plans), via the `QUICKNODE_API_KEY` environment variable or the provider block. +## Developing -The Admin API returns endpoint URLs with the auth token embedded. The provider exposes both forms: +To run Terraform against a local build, add a development override to +`~/.terraformrc`: -| Attribute | Sensitive | Use it for | -|---|---|---| -| `http_url_with_token`, `wss_url_with_token` | yes | anything that makes RPC calls | -| `http_url`, `wss_url` | no | logging, display, anything that must not hold a credential | -| `tokens` | yes | rotation workflows that need token ids | +```hcl +provider_installation { + dev_overrides { + "quicknode/quicknode" = "/path/to/your/GOPATH/bin" + } + direct {} +} +``` -Do not rebuild a URL by joining `http_url` to a token. The token is not always the last path segment — some chains append a suffix, as in `https:////evm` — so a hand-assembled URL works on Ethereum and breaks elsewhere. `wss_url` is null on chains without WebSocket support. +Then `go install .` and run Terraform normally. With an override in place, +`terraform init` is neither needed nor supported. -Token values land in Terraform state either way — use encrypted remote state. +```sh +make lint # gofmt, go vet, golangci-lint +make docs # regenerate docs/ from the provider schema and examples/ +make fmt # format Go and Terraform sources +``` -## Resources +`docs/` is generated. CI fails if it is out of date with the schema, so run +`make docs` after any schema change and commit the result. -| Name | Status | -|---|---| -| `quicknode_endpoint` (label, status, tags, multichain, import) | ✅ available | -| `data.quicknode_chains` | ✅ available | -| `security_options` on `quicknode_endpoint` | 🚧 planned | -| `quicknode_endpoint_ip`, `quicknode_endpoint_domain_mask`, `quicknode_endpoint_referrer`, `quicknode_endpoint_jwt`, `quicknode_endpoint_request_filter` | 🚧 planned | -| `quicknode_endpoint_rate_limits`, `quicknode_method_rate_limit` | 🚧 planned | -| `data.quicknode_endpoint(s)` | 🚧 planned | -| `quicknode_stream`, `quicknode_webhook` | 🚧 planned, blocked on published specs | +The API client in `api/admin/` is generated and should not be edited by hand. +See [CONTRIBUTING.md](./CONTRIBUTING.md#making-changes) for how to refresh it. -Security splits along the way the API splits. The toggles are a single PATCH on -the endpoint, so they become a `security_options` attribute on -`quicknode_endpoint`. Each allowlist entry is a POST/DELETE with no update, so -each becomes its own resource keyed by `endpoint_id` — which also keeps a -one-address change from showing up as a diff on the whole endpoint. +## Testing -Full documentation lives in [`docs/`](./docs) and, once published, on the Terraform Registry. +Unit tests need no credentials: -## Development +```sh +make test +``` -Requires Go (see `go.mod`) and Terraform >= 1.13. +Acceptance tests create real, billable Quicknode resources and require an Admin +API key for a paid account dedicated to testing: ```sh -make vendor # refresh the upstream Admin API spec -make generate # apply api/admin/patches.json, then regenerate the client -make lint # gofmt + go vet -make test # unit tests -make testacc # acceptance tests: creates real, billable resources +QUICKNODE_API_KEY=... make testacc ``` -The client is generated from `api/admin/openapi.upstream.json`, which is vendored -verbatim so `make vendor` can refresh it. `api/admin/patches.json` holds the local -schema corrections applied before generation, keeping the vendored copy unmodified. +## Security -Contributions welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md). +Endpoint tokens and credentialed URLs are written to Terraform state. Use +encrypted remote state and treat state files as credential material. See +[SECURITY.md](./SECURITY.md) to report a vulnerability. ## License diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..aa6c6ad --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,26 @@ +# Security Policy + +## Reporting a vulnerability + +Do not open a public issue for security problems. + +Report vulnerabilities in this provider to **security@quicknode.com**, or through +the security contact listed at https://www.quicknode.com/security. Include the +provider version, a description of the issue, and reproduction steps. + +## Credentials and Terraform state + +Terraform writes every attribute it reads into state, including attributes marked +sensitive. For this provider that includes endpoint auth tokens and credentialed +endpoint URLs. + +Marking an attribute sensitive keeps it out of CLI output and plan diffs. It does +not encrypt it, and it does not keep it out of the state file. + +Use [encrypted remote state](https://developer.hashicorp.com/terraform/language/state/sensitive-data) +with access controls, treat state files as credential material, and never commit +them to version control. + +## Supported versions + +Security fixes are applied to the latest released minor version. diff --git a/docs/data-sources/chains.md b/docs/data-sources/chains.md new file mode 100644 index 0000000..13a9524 --- /dev/null +++ b/docs/data-sources/chains.md @@ -0,0 +1,56 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "quicknode_chains Data Source - quicknode" +subcategory: "" +description: |- + Every chain and network Quicknode supports. Use it to validate slugs at plan time and to fan a configuration out across networks. + Chain slugs are abbreviations that often differ from the chain's name: Ethereum is eth, Avalanche is avax, Arbitrum is arb, Polygon is matic. +--- + +# quicknode_chains (Data Source) + +Every chain and network Quicknode supports. Use it to validate slugs at plan time and to fan a configuration out across networks. + +Chain slugs are abbreviations that often differ from the chain's name: Ethereum is `eth`, Avalanche is `avax`, Arbitrum is `arb`, Polygon is `matic`. + +## Example Usage + +```terraform +data "quicknode_chains" "all" {} + +# Chain slugs are abbreviations that often differ from the chain's name, so look +# one up rather than hardcoding it. +locals { + ethereum = one([for chain in data.quicknode_chains.all.chains : chain if chain.slug == "eth"]) +} + +resource "quicknode_endpoint" "primary" { + chain = local.ethereum.slug + network = one([for network in local.ethereum.networks : network.slug if network.chain_id == 1]) +} +``` + + +## Schema + +### Read-Only + +- `chains` (Attributes List) (see [below for nested schema](#nestedatt--chains)) + + +### Nested Schema for `chains` + +Read-Only: + +- `is_select_chain` (Boolean) Whether the chain is only available on Quicknode's Select plans. +- `networks` (Attributes List) (see [below for nested schema](#nestedatt--chains--networks)) +- `slug` (String) Chain slug, as `quicknode_endpoint.chain` expects it. + + +### Nested Schema for `chains.networks` + +Read-Only: + +- `chain_id` (Number) EVM chain id, or null on non-EVM networks. +- `name` (String) Human-readable network name. +- `slug` (String) Network slug, as `quicknode_endpoint.network` expects it. Most are chain-qualified (`base-sepolia`), but some are not (`mainnet` for Ethereum, `bsc`, `optimism`). diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..661893d --- /dev/null +++ b/docs/index.md @@ -0,0 +1,63 @@ +--- +page_title: "Quicknode Provider" +description: |- + Manage Quicknode RPC endpoints, security rules and rate limits with Terraform. +--- + +# Quicknode Provider + +Manage your Quicknode blockchain infrastructure as code: RPC endpoints, security +rules, and rate limits, through `terraform plan` and `terraform apply`. + +## Authentication + +The provider authenticates with a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) +key, available on paid plans. Set it in the environment rather than in a +configuration file: + +```sh +export QUICKNODE_API_KEY="your-api-key" +``` + +## Example Usage + +```terraform +terraform { + required_providers { + quicknode = { + source = "quicknode/quicknode" + version = "~> 0.1" + } + } +} + +# Reads the API key from QUICKNODE_API_KEY. Set api_key here to override it. +provider "quicknode" {} +``` + +## Endpoint URLs + +The Admin API returns endpoint URLs with the auth token embedded. Endpoints +expose both forms: + +| Attribute | Sensitive | Use it for | +|---|---|---| +| `http_url_with_token`, `wss_url_with_token` | yes | anything that makes RPC calls | +| `http_url`, `wss_url` | no | logging, display, anything that must not hold a credential | + +Do not rebuild a URL by joining `http_url` to a token. The token is not always +the last path segment — some chains append a suffix, as in +`https:////evm` — so a hand-assembled URL works on Ethereum and +breaks elsewhere. + +Token values are written to Terraform state. Use +[encrypted remote state](https://developer.hashicorp.com/terraform/language/state/sensitive-data). + + +## Schema + +### Optional + +- `api_key` (String, Sensitive) Quicknode Admin API key. Defaults to the `QUICKNODE_API_KEY` environment variable. Prefer the environment variable so the key stays out of configuration and state. +- `base_url` (String) Admin API base URL. Defaults to `https://api.quicknode.com`. +- `requests_per_second` (Number) Throttle applied to Admin API calls. A large workspace bursts many calls during one apply, so the provider paces itself. diff --git a/docs/resources/endpoint.md b/docs/resources/endpoint.md new file mode 100644 index 0000000..a918f8e --- /dev/null +++ b/docs/resources/endpoint.md @@ -0,0 +1,80 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "quicknode_endpoint Resource - quicknode" +subcategory: "" +description: |- + A Quicknode RPC endpoint on a chain and network. + Pass http_url_with_token to anything that needs to make RPC calls. http_url and wss_url have the credential removed and are safe to log or expose, but they are not usable endpoints: the token does not sit at the end of the path on every chain, so rebuilding a URL by joining them to a token produces a broken address on chains that append a suffix. +--- + +# quicknode_endpoint (Resource) + +A Quicknode RPC endpoint on a chain and network. + +Pass `http_url_with_token` to anything that needs to make RPC calls. `http_url` and `wss_url` have the credential removed and are safe to log or expose, but they are not usable endpoints: the token does not sit at the end of the path on every chain, so rebuilding a URL by joining them to a token produces a broken address on chains that append a suffix. + +## Example Usage + +```terraform +resource "quicknode_endpoint" "payments" { + chain = "eth" + network = "mainnet" + label = "payments-prod" + status = "active" + tags = ["prod", "payments"] +} + +# Pass the credentialed URL to whatever makes RPC calls. +output "payments_rpc_url" { + value = quicknode_endpoint.payments.http_url_with_token + sensitive = true +} + +# The same endpoint without the credential, safe to log or display. +output "payments_rpc_host" { + value = quicknode_endpoint.payments.http_url +} +``` + + +## Schema + +### Required + +- `chain` (String) Chain slug, for example `eth`, `base`, `arb`, `sol`. Slugs are often abbreviations rather than the chain's name; read `data.quicknode_chains` for the full list. +- `network` (String) Network slug, for example `mainnet`, `base-sepolia`, `arbitrum-mainnet`. + +### Optional + +- `label` (String) Descriptive label for the endpoint. Labels are not unique and are not used to identify the endpoint. +- `multichain` (Boolean) Whether the endpoint serves more than one network. +- `status` (String) `active` or `paused`. +- `tags` (Set of String) Tag labels applied to the endpoint. Omitting the attribute removes every tag the provider finds on the endpoint. + +### Read-Only + +- `http_url` (String) HTTPS URL with the auth token removed. Safe to expose, but not a working endpoint. +- `http_url_with_token` (String, Sensitive) The working HTTPS endpoint, exactly as the Admin API returns it. Pass this to whatever makes RPC calls. +- `id` (String) Endpoint id. +- `tokens` (Attributes List) Auth tokens for the endpoint. An endpoint can carry several. Token values are stored in Terraform state, so keep state encrypted and remote. (see [below for nested schema](#nestedatt--tokens)) +- `wss_url` (String) WebSocket URL with the auth token removed, or null on chains without WebSocket support. +- `wss_url_with_token` (String, Sensitive) The working WebSocket endpoint, or null on chains without WebSocket support. + + +### Nested Schema for `tokens` + +Read-Only: + +- `id` (String) Token id. +- `token` (String, Sensitive) Token value. + +## Import + +Import is supported using the following syntax: + +The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: + +```shell +# Endpoints are imported by their Quicknode endpoint id. +terraform import quicknode_endpoint.payments 123456 +``` diff --git a/examples/data-sources/quicknode_chains/data-source.tf b/examples/data-sources/quicknode_chains/data-source.tf new file mode 100644 index 0000000..98d5283 --- /dev/null +++ b/examples/data-sources/quicknode_chains/data-source.tf @@ -0,0 +1,12 @@ +data "quicknode_chains" "all" {} + +# Chain slugs are abbreviations that often differ from the chain's name, so look +# one up rather than hardcoding it. +locals { + ethereum = one([for chain in data.quicknode_chains.all.chains : chain if chain.slug == "eth"]) +} + +resource "quicknode_endpoint" "primary" { + chain = local.ethereum.slug + network = one([for network in local.ethereum.networks : network.slug if network.chain_id == 1]) +} diff --git a/examples/endpoint/main.tf b/examples/endpoint/main.tf deleted file mode 100644 index e7fd2d9..0000000 --- a/examples/endpoint/main.tf +++ /dev/null @@ -1,33 +0,0 @@ -terraform { - required_providers { - quicknode = { - source = "quicknode/quicknode" - } - } -} - -# Reads QUICKNODE_API_KEY from the environment. -provider "quicknode" {} - -data "quicknode_chains" "all" {} - -locals { - ethereum = one([for chain in data.quicknode_chains.all.chains : chain if chain.slug == "eth"]) -} - -resource "quicknode_endpoint" "payments" { - chain = local.ethereum.slug - network = "mainnet" - label = "payments-prod" - status = "active" - tags = ["prod", "payments"] -} - -output "rpc_url" { - value = quicknode_endpoint.payments.http_url_with_token - sensitive = true -} - -output "rpc_base_url" { - value = quicknode_endpoint.payments.http_url -} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf new file mode 100644 index 0000000..95fa69e --- /dev/null +++ b/examples/provider/provider.tf @@ -0,0 +1,11 @@ +terraform { + required_providers { + quicknode = { + source = "quicknode/quicknode" + version = "~> 0.1" + } + } +} + +# Reads the API key from QUICKNODE_API_KEY. Set api_key here to override it. +provider "quicknode" {} diff --git a/examples/resources/quicknode_endpoint/import.sh b/examples/resources/quicknode_endpoint/import.sh new file mode 100644 index 0000000..a1f79df --- /dev/null +++ b/examples/resources/quicknode_endpoint/import.sh @@ -0,0 +1,2 @@ +# Endpoints are imported by their Quicknode endpoint id. +terraform import quicknode_endpoint.payments 123456 diff --git a/examples/resources/quicknode_endpoint/resource.tf b/examples/resources/quicknode_endpoint/resource.tf new file mode 100644 index 0000000..e25f0c1 --- /dev/null +++ b/examples/resources/quicknode_endpoint/resource.tf @@ -0,0 +1,18 @@ +resource "quicknode_endpoint" "payments" { + chain = "eth" + network = "mainnet" + label = "payments-prod" + status = "active" + tags = ["prod", "payments"] +} + +# Pass the credentialed URL to whatever makes RPC calls. +output "payments_rpc_url" { + value = quicknode_endpoint.payments.http_url_with_token + sensitive = true +} + +# The same endpoint without the credential, safe to log or display. +output "payments_rpc_host" { + value = quicknode_endpoint.payments.http_url +} diff --git a/internal/provider/endpoint_resource.go b/internal/provider/endpoint_resource.go index bac98bb..dc655e4 100644 --- a/internal/provider/endpoint_resource.go +++ b/internal/provider/endpoint_resource.go @@ -88,7 +88,7 @@ func (r *endpointResource) Schema(_ context.Context, _ resource.SchemaRequest, r }, "label": schema.StringAttribute{ Optional: true, - MarkdownDescription: "Descriptive label. The Admin API cannot set a label while creating an endpoint, so the provider applies it in a second call.", + MarkdownDescription: "Descriptive label for the endpoint. Labels are not unique and are not used to identify the endpoint.", }, "status": schema.StringAttribute{ Optional: true, diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 0000000..ee6db5c --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,44 @@ +--- +page_title: "Quicknode Provider" +description: |- + Manage Quicknode RPC endpoints, security rules and rate limits with Terraform. +--- + +# Quicknode Provider + +Manage your Quicknode blockchain infrastructure as code: RPC endpoints, security +rules, and rate limits, through `terraform plan` and `terraform apply`. + +## Authentication + +The provider authenticates with a Quicknode [Admin API](https://www.quicknode.com/docs/admin-api) +key, available on paid plans. Set it in the environment rather than in a +configuration file: + +```sh +export QUICKNODE_API_KEY="your-api-key" +``` + +## Example Usage + +{{ tffile "examples/provider/provider.tf" }} + +## Endpoint URLs + +The Admin API returns endpoint URLs with the auth token embedded. Endpoints +expose both forms: + +| Attribute | Sensitive | Use it for | +|---|---|---| +| `http_url_with_token`, `wss_url_with_token` | yes | anything that makes RPC calls | +| `http_url`, `wss_url` | no | logging, display, anything that must not hold a credential | + +Do not rebuild a URL by joining `http_url` to a token. The token is not always +the last path segment — some chains append a suffix, as in +`https:////evm` — so a hand-assembled URL works on Ethereum and +breaks elsewhere. + +Token values are written to Terraform state. Use +[encrypted remote state](https://developer.hashicorp.com/terraform/language/state/sensitive-data). + +{{ .SchemaMarkdown | trimspace }} diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 0000000..3ffa783 --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,8 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": [ + "6.0" + ] + } +} From f0503cae3d9e3d555393826e43faa1672d94157c Mon Sep 17 00:00:00 2001 From: AlejandroFabianCampos Date: Tue, 22 Sep 2026 14:10:10 -0500 Subject: [PATCH 3/4] fix: publish the registry manifest as a release asset Co-Authored-By: Claude Opus 5 (1M context) --- .goreleaser.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 321085a..d561690 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -53,6 +53,9 @@ signs: release: draft: false + extra_files: + - glob: terraform-registry-manifest.json + name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json" changelog: disable: true From 8c30c5e236aee657f1934184afc75398c8f3dd8d Mon Sep 17 00:00:00 2001 From: AlejandroFabianCampos Date: Tue, 22 Sep 2026 14:56:26 -0500 Subject: [PATCH 4/4] fix: make CI lint and docs jobs reproducible Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/test.yml | 29 +++++++++++++++++++---------- GNUmakefile | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bd6cac..f5ab46b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,16 @@ on: - main paths-ignore: - "README.md" + workflow_dispatch: permissions: contents: read jobs: build: - name: Build + name: Build and lint runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -26,26 +27,32 @@ jobs: cache: true - run: go mod download - run: go build -v ./... - - name: Run linters - uses: golangci/golangci-lint-action@v8 - with: - version: v2.5.0 + # golangci-lint runs through the Makefile so it is compiled with this + # repo's Go toolchain. The prebuilt action binary lags the Go version in + # go.mod and refuses to run against a newer one. + - run: make lint generate: name: Docs up to date runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true + # tfplugindocs needs Terraform to read the provider schema. Installing it + # here keeps tfplugindocs from downloading its own copy. + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: "1.13.*" + terraform_wrapper: false - run: make docs - name: Check for uncommitted changes run: | git diff --compact-summary --exit-code || \ - (echo; echo "Unexpected difference in directories after code generation. Run 'make docs' and commit."; exit 1) + (echo; echo "docs/ is out of date. Run 'make docs' and commit the result."; exit 1) test: name: Unit tests @@ -60,12 +67,14 @@ jobs: - run: go mod download - run: go test -v -cover ./... + # Acceptance tests create real, billable Quicknode resources, so they run only + # when triggered by hand. They need QUICKNODE_API_KEY for a paid account that + # is dedicated to testing. acceptance: name: Acceptance tests - needs: build runs-on: ubuntu-latest timeout-minutes: 30 - if: github.event_name == 'push' + if: github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: diff --git a/GNUmakefile b/GNUmakefile index 02b00bf..953f874 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ OAPI_CODEGEN_VERSION ?= v2.8.0 TFPLUGINDOCS_VERSION ?= v0.23.0 -GOLANGCI_LINT_VERSION ?= v2.5.0 +GOLANGCI_LINT_VERSION ?= v2.13.2 ADMIN_SPEC_URL ?= https://www.quicknode.com/docs/openapi/admin-api.openapi.json default: build