diff --git a/CHANGELOG.md b/CHANGELOG.md index af0066c..6da1091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `nr domain` manages domain names: `search`, `check`, `list`, `get`, `order`, `register`, `transfer`, `renew`, `nameservers set`, `autorenew on|off`, `lock on|off`, `dnssec`, `auth-code` and `contacts list`. Purchases are card only, show the price with tax, need the terms version (`--accept-terms`) and, with auto-renew, consent to renewal charges (`--mit-consent`); `--yes` skips the prompts. A card that needs 3-D Secure gets a portal link instead. See [docs/DOMAINS.md](docs/DOMAINS.md). +- API errors keep the `google.rpc.ErrorInfo` reason and metadata. + ## [1.0.21] - 2026-11-29 ### Added diff --git a/README.md b/README.md index 1f52e84..6e8ad4c 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,9 @@ nr cluster operator upgrade nr cluster deregister --name edge-ams-01 ``` +Domain names (search, register, transfer, renew, nameservers, DNSSEC, auto-renew) are under +`nr domain`; see [Domains](docs/DOMAINS.md). + Diagnostic messages go to **stderr**. Use `--output json` when you need machine-readable **stdout**. Exit codes: `0` success, `1` runtime failure, `2` usage error. ## Configuration @@ -105,6 +108,7 @@ Optional config lives at `~/.nr/config.yaml`. Production API default is `https:/ - [Install](docs/INSTALL.md) - [Configuration](docs/CONFIG.md) +- [Domains](docs/DOMAINS.md) - [Troubleshooting](docs/TROUBLESHOOTING.md) - [Security](SECURITY.md) - [Contributing](CONTRIBUTING.md) diff --git a/docs/DOMAINS.md b/docs/DOMAINS.md new file mode 100644 index 0000000..2b6ddb6 --- /dev/null +++ b/docs/DOMAINS.md @@ -0,0 +1,72 @@ +# Domains + +`nr domain` searches, registers, transfers and manages domain names registered through +NodeRings. It works with a service account token (`NR_API_TOKEN`) or an `nr auth login` session. + +```bash +nr domain search evergreen-coffee --tld com,io +nr domain check evergreen-coffee.com +nr domain contacts list +nr domain register evergreen-coffee.com --years 1 --contact +nr domain list +nr domain get evergreen-coffee.com +``` + +Every command takes `--output json` (`-o json`). + +## Paying for domains + +Domains are paid **by card only**; account credit and coupons do not apply. `register`, +`transfer` and `renew`: + +1. create an order and show the price with tax, +2. ask you to accept the current domain registration terms (version and link are shown), +3. ask for consent to automatic renewal charges when auto-renew is on (the default), +4. ask to confirm the charge, +5. charge `--card ` or the organization's default card, and +6. wait until the registry confirms (`--no-wait` to skip; `nr domain order ` shows it later). + +Acceptance is never implied. With `--yes` (no prompts) pass the terms version and consent +explicitly: + +```bash +nr domain register evergreen-coffee.com --contact \ + --accept-terms 2026-12-01 --mit-consent --yes +nr domain register evergreen-coffee.com --contact \ + --accept-terms 2026-12-01 --no-auto-renew --yes +``` + +If no card is on file, or the card asks for **3-D Secure**, the CLI cannot finish the purchase +(the bank's check only runs in a browser). Nothing is charged; the command prints the portal +link where the same order can be paid. + +Failed items are never charged. A partially completed order charges only the domains that were +registered, and the command exits with status 1. + +## Transfers + +Unlock the domain at the current registrar and get its auth code, then: + +```bash +NR_DOMAIN_AUTH_CODE='...' nr domain transfer example.com --keep-nameservers +``` + +## Settings + +```bash +nr domain nameservers set example.com --noderings +nr domain nameservers set example.com ns1.example.net ns2.example.net +nr domain autorenew on example.com --mit-consent +nr domain autorenew off example.com +nr domain lock on example.com +nr domain dnssec example.com managed +nr domain dnssec example.com custom --ds 12345:13:2: +nr domain renew example.com --years 1 +``` + +## Sensitive actions + +`nr domain auth-code` and `nr domain lock off` need a fresh sign-in (password and/or +two-factor code). The CLI does not ask for your password: it prints the portal link instead. +Callers that already hold a step-up token from `POST /v1/auth/reauthenticate` can pass it with +`--reauth-token` (or `NR_REAUTH_TOKEN`). Service accounts cannot do these actions. diff --git a/internal/api/errors.go b/internal/api/errors.go index a1f9261..a60b009 100644 --- a/internal/api/errors.go +++ b/internal/api/errors.go @@ -22,6 +22,28 @@ type APIError struct { Message string Details string Code string // gRPC error code (e.g., "NOT_FOUND", "ALREADY_EXISTS") + // Reason and Metadata come from the first google.rpc.ErrorInfo detail + // (e.g. REQUIRES_PORTAL_VERIFICATION with metadata portal_url). + Reason string + Metadata map[string]string +} + +// ErrorReason returns the google.rpc.ErrorInfo reason of an API error, or "". +func ErrorReason(err error) string { + var apiErr *APIError + if errors.As(err, &apiErr) && apiErr != nil { + return apiErr.Reason + } + return "" +} + +// ErrorMetadata returns one google.rpc.ErrorInfo metadata value of an API error, or "". +func ErrorMetadata(err error, key string) string { + var apiErr *APIError + if errors.As(err, &apiErr) && apiErr != nil { + return apiErr.Metadata[key] + } + return "" } func (e *APIError) Error() string { @@ -202,6 +224,7 @@ func fillAPIErrorFromObject(apiErr *APIError, obj map[string]json.RawMessage) { if json.Unmarshal(raw, &details) != nil || len(details) == 0 { return } + applyErrorInfo(apiErr, details) d := details[0] if raw, ok := d["code"]; ok { var s string @@ -217,6 +240,32 @@ func fillAPIErrorFromObject(apiErr *APIError, obj map[string]json.RawMessage) { } } +// applyErrorInfo copies the reason and metadata of the first google.rpc.ErrorInfo detail. +func applyErrorInfo(apiErr *APIError, details []map[string]json.RawMessage) { + for _, d := range details { + var typ string + if raw, ok := d["@type"]; !ok || json.Unmarshal(raw, &typ) != nil || !strings.HasSuffix(typ, "google.rpc.ErrorInfo") { + continue + } + var info struct { + Reason string `json:"reason"` + Metadata map[string]string `json:"metadata"` + } + if raw, ok := d["reason"]; ok { + _ = json.Unmarshal(raw, &info.Reason) + } + if raw, ok := d["metadata"]; ok { + _ = json.Unmarshal(raw, &info.Metadata) + } + if info.Reason == "" { + continue + } + apiErr.Reason = info.Reason + apiErr.Metadata = info.Metadata + return + } +} + func applyStatusHeaders(apiErr *APIError, header http.Header) { if header == nil { return diff --git a/internal/api/errors_test.go b/internal/api/errors_test.go index 2f1bfda..9b2b2ac 100644 --- a/internal/api/errors_test.go +++ b/internal/api/errors_test.go @@ -160,3 +160,23 @@ func TestIsProviderReviewPendingWrapped(t *testing.T) { t.Fatal("generic 403 must not be treated as marketplace review") } } + +func TestParseErrorErrorInfo(t *testing.T) { + t.Parallel() + + body := `{"code":9,"message":"This card needs verification.","details":[` + + `{"@type":"type.googleapis.com/google.rpc.DebugInfo","detail":"x"},` + + `{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"REQUIRES_PORTAL_VERIFICATION","domain":"api","metadata":{"portal_url":"https://noderings.com/domains/checkout/o1"}}]}` + resp := &http.Response{StatusCode: http.StatusBadRequest, Status: "400 Bad Request", Body: io.NopCloser(strings.NewReader(body))} + err := fmt.Errorf("checkout: %w", ParseError(resp)) + + if got := ErrorReason(err); got != "REQUIRES_PORTAL_VERIFICATION" { + t.Fatalf("ErrorReason = %q", got) + } + if got := ErrorMetadata(err, "portal_url"); got != "https://noderings.com/domains/checkout/o1" { + t.Fatalf("ErrorMetadata = %q", got) + } + if ErrorReason(fmt.Errorf("plain")) != "" || ErrorMetadata(nil, "x") != "" { + t.Fatal("non-API errors have no reason") + } +} diff --git a/internal/api/generated/client.gen.go b/internal/api/generated/client.gen.go index e09484a..870273b 100644 --- a/internal/api/generated/client.gen.go +++ b/internal/api/generated/client.gen.go @@ -170,6 +170,114 @@ type ClientInterface interface { // MetadataServiceGetPlatformVersions performs a GET /v1/platform-versions (the `MetadataServiceGetPlatformVersions` operationId) request. MetadataServiceGetPlatformVersions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // DomainSearchServiceCheckDomainsWithBody performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request, + // with any type of body and a specified content type. + DomainSearchServiceCheckDomainsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainSearchServiceCheckDomains performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request. + // Takes a body of the `application/json` content type. + DomainSearchServiceCheckDomains(ctx context.Context, body DomainSearchServiceCheckDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainContactServiceListDomainContacts performs a GET /v1/registrar/contacts (the `DomainContactServiceListDomainContacts` operationId) request. + DomainContactServiceListDomainContacts(ctx context.Context, params *DomainContactServiceListDomainContactsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceListRegisteredDomains performs a GET /v1/registrar/domains (the `RegisteredDomainServiceListRegisteredDomains` operationId) request. + RegisteredDomainServiceListRegisteredDomains(ctx context.Context, params *RegisteredDomainServiceListRegisteredDomainsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceGetRegisteredDomain performs a GET /v1/registrar/domains/{name} (the `RegisteredDomainServiceGetRegisteredDomain` operationId) request. + RegisteredDomainServiceGetRegisteredDomain(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceGetDomainAuthCodeWithBody performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceGetDomainAuthCodeWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceGetDomainAuthCode performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceGetDomainAuthCode(ctx context.Context, name string, body RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainAutoRenewWithBody performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceSetDomainAutoRenewWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainAutoRenew performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceSetDomainAutoRenew(ctx context.Context, name string, body RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainDnssecWithBody performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceSetDomainDnssecWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainDnssec performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceSetDomainDnssec(ctx context.Context, name string, body RegisteredDomainServiceSetDomainDnssecJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainTransferLockWithBody performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceSetDomainTransferLockWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainTransferLock performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceSetDomainTransferLock(ctx context.Context, name string, body RegisteredDomainServiceSetDomainTransferLockJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainNameserversWithBody performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceSetDomainNameserversWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceSetDomainNameservers performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceSetDomainNameservers(ctx context.Context, name string, body RegisteredDomainServiceSetDomainNameserversJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceRenewDomainWithBody performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request, + // with any type of body and a specified content type. + RegisteredDomainServiceRenewDomainWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RegisteredDomainServiceRenewDomain performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request. + // Takes a body of the `application/json` content type. + RegisteredDomainServiceRenewDomain(ctx context.Context, name string, body RegisteredDomainServiceRenewDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServiceCreateDomainOrderWithBody performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request, + // with any type of body and a specified content type. + DomainOrderServiceCreateDomainOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServiceCreateDomainOrder performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request. + // Takes a body of the `application/json` content type. + DomainOrderServiceCreateDomainOrder(ctx context.Context, body DomainOrderServiceCreateDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServiceGetDomainOrder performs a GET /v1/registrar/orders/{id} (the `DomainOrderServiceGetDomainOrder` operationId) request. + DomainOrderServiceGetDomainOrder(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServiceCheckoutDomainOrderWithBody performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request, + // with any type of body and a specified content type. + DomainOrderServiceCheckoutDomainOrderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServiceCheckoutDomainOrder performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request. + // Takes a body of the `application/json` content type. + DomainOrderServiceCheckoutDomainOrder(ctx context.Context, id string, body DomainOrderServiceCheckoutDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServicePriceDomainOrderWithBody performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request, + // with any type of body and a specified content type. + DomainOrderServicePriceDomainOrderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainOrderServicePriceDomainOrder performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request. + // Takes a body of the `application/json` content type. + DomainOrderServicePriceDomainOrder(ctx context.Context, id string, body DomainOrderServicePriceDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainSearchServiceSearchDomainsWithBody performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request, + // with any type of body and a specified content type. + DomainSearchServiceSearchDomainsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainSearchServiceSearchDomains performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request. + // Takes a body of the `application/json` content type. + DomainSearchServiceSearchDomains(ctx context.Context, body DomainSearchServiceSearchDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainSearchServiceCheckTransferWithBody performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request, + // with any type of body and a specified content type. + DomainSearchServiceCheckTransferWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DomainSearchServiceCheckTransfer performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request. + // Takes a body of the `application/json` content type. + DomainSearchServiceCheckTransfer(ctx context.Context, body DomainSearchServiceCheckTransferJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // RoleServiceReplaceRoleForServiceAccountWithBody performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, // with any type of body and a specified content type. RoleServiceReplaceRoleForServiceAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -518,10 +626,10 @@ func (c *Client) MetadataServiceGetPlatformVersions(ctx context.Context, reqEdit return c.Client.Do(req) } -// RoleServiceReplaceRoleForServiceAccountWithBody performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, +// DomainSearchServiceCheckDomainsWithBody performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request, // with any type of body and a specified content type. -func (c *Client) RoleServiceReplaceRoleForServiceAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(c.Server, contentType, body) +func (c *Client) DomainSearchServiceCheckDomainsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceCheckDomainsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -532,10 +640,10 @@ func (c *Client) RoleServiceReplaceRoleForServiceAccountWithBody(ctx context.Con return c.Client.Do(req) } -// RoleServiceReplaceRoleForServiceAccount performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. +// DomainSearchServiceCheckDomains performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request. // Takes a body of the `application/json` content type. -func (c *Client) RoleServiceReplaceRoleForServiceAccount(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRoleServiceReplaceRoleForServiceAccountRequest(c.Server, body) +func (c *Client) DomainSearchServiceCheckDomains(ctx context.Context, body DomainSearchServiceCheckDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceCheckDomainsRequest(c.Server, body) if err != nil { return nil, err } @@ -546,9 +654,9 @@ func (c *Client) RoleServiceReplaceRoleForServiceAccount(ctx context.Context, bo return c.Client.Do(req) } -// ServiceAccountServiceListServiceAccounts performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. -func (c *Client) ServiceAccountServiceListServiceAccounts(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceListServiceAccountsRequest(c.Server, params) +// DomainContactServiceListDomainContacts performs a GET /v1/registrar/contacts (the `DomainContactServiceListDomainContacts` operationId) request. +func (c *Client) DomainContactServiceListDomainContacts(ctx context.Context, params *DomainContactServiceListDomainContactsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainContactServiceListDomainContactsRequest(c.Server, params) if err != nil { return nil, err } @@ -559,10 +667,9 @@ func (c *Client) ServiceAccountServiceListServiceAccounts(ctx context.Context, p return c.Client.Do(req) } -// ServiceAccountServiceCreateServiceAccountWithBody performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, -// with any type of body and a specified content type. -func (c *Client) ServiceAccountServiceCreateServiceAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceCreateServiceAccountRequestWithBody(c.Server, contentType, body) +// RegisteredDomainServiceListRegisteredDomains performs a GET /v1/registrar/domains (the `RegisteredDomainServiceListRegisteredDomains` operationId) request. +func (c *Client) RegisteredDomainServiceListRegisteredDomains(ctx context.Context, params *RegisteredDomainServiceListRegisteredDomainsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceListRegisteredDomainsRequest(c.Server, params) if err != nil { return nil, err } @@ -573,10 +680,9 @@ func (c *Client) ServiceAccountServiceCreateServiceAccountWithBody(ctx context.C return c.Client.Do(req) } -// ServiceAccountServiceCreateServiceAccount performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. -// Takes a body of the `application/json` content type. -func (c *Client) ServiceAccountServiceCreateServiceAccount(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceCreateServiceAccountRequest(c.Server, body) +// RegisteredDomainServiceGetRegisteredDomain performs a GET /v1/registrar/domains/{name} (the `RegisteredDomainServiceGetRegisteredDomain` operationId) request. +func (c *Client) RegisteredDomainServiceGetRegisteredDomain(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceGetRegisteredDomainRequest(c.Server, name) if err != nil { return nil, err } @@ -587,9 +693,10 @@ func (c *Client) ServiceAccountServiceCreateServiceAccount(ctx context.Context, return c.Client.Do(req) } -// ServiceAccountServiceRevokeToken performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. -func (c *Client) ServiceAccountServiceRevokeToken(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceRevokeTokenRequest(c.Server, tokenId) +// RegisteredDomainServiceGetDomainAuthCodeWithBody performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RegisteredDomainServiceGetDomainAuthCodeWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceGetDomainAuthCodeRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } @@ -600,9 +707,10 @@ func (c *Client) ServiceAccountServiceRevokeToken(ctx context.Context, tokenId s return c.Client.Do(req) } -// ServiceAccountServiceDeleteServiceAccount performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. -func (c *Client) ServiceAccountServiceDeleteServiceAccount(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceDeleteServiceAccountRequest(c.Server, id) +// RegisteredDomainServiceGetDomainAuthCode performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RegisteredDomainServiceGetDomainAuthCode(ctx context.Context, name string, body RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceGetDomainAuthCodeRequest(c.Server, name, body) if err != nil { return nil, err } @@ -613,9 +721,10 @@ func (c *Client) ServiceAccountServiceDeleteServiceAccount(ctx context.Context, return c.Client.Do(req) } -// ServiceAccountServiceGetServiceAccount performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. -func (c *Client) ServiceAccountServiceGetServiceAccount(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceGetServiceAccountRequest(c.Server, id) +// RegisteredDomainServiceSetDomainAutoRenewWithBody performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RegisteredDomainServiceSetDomainAutoRenewWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainAutoRenewRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } @@ -626,10 +735,10 @@ func (c *Client) ServiceAccountServiceGetServiceAccount(ctx context.Context, id return c.Client.Do(req) } -// ServiceAccountServiceUpdateServiceAccountWithBody performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, -// with any type of body and a specified content type. -func (c *Client) ServiceAccountServiceUpdateServiceAccountWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceUpdateServiceAccountRequestWithBody(c.Server, id, contentType, body) +// RegisteredDomainServiceSetDomainAutoRenew performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RegisteredDomainServiceSetDomainAutoRenew(ctx context.Context, name string, body RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainAutoRenewRequest(c.Server, name, body) if err != nil { return nil, err } @@ -640,10 +749,10 @@ func (c *Client) ServiceAccountServiceUpdateServiceAccountWithBody(ctx context.C return c.Client.Do(req) } -// ServiceAccountServiceUpdateServiceAccount performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. -// Takes a body of the `application/json` content type. -func (c *Client) ServiceAccountServiceUpdateServiceAccount(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceUpdateServiceAccountRequest(c.Server, id, body) +// RegisteredDomainServiceSetDomainDnssecWithBody performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RegisteredDomainServiceSetDomainDnssecWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainDnssecRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } @@ -654,9 +763,10 @@ func (c *Client) ServiceAccountServiceUpdateServiceAccount(ctx context.Context, return c.Client.Do(req) } -// ServiceAccountServiceListTokens performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. -func (c *Client) ServiceAccountServiceListTokens(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceListTokensRequest(c.Server, serviceAccountId, params) +// RegisteredDomainServiceSetDomainDnssec performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RegisteredDomainServiceSetDomainDnssec(ctx context.Context, name string, body RegisteredDomainServiceSetDomainDnssecJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainDnssecRequest(c.Server, name, body) if err != nil { return nil, err } @@ -667,10 +777,10 @@ func (c *Client) ServiceAccountServiceListTokens(ctx context.Context, serviceAcc return c.Client.Do(req) } -// ServiceAccountServiceGenerateTokenWithBody performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, +// RegisteredDomainServiceSetDomainTransferLockWithBody performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request, // with any type of body and a specified content type. -func (c *Client) ServiceAccountServiceGenerateTokenWithBody(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceGenerateTokenRequestWithBody(c.Server, serviceAccountId, contentType, body) +func (c *Client) RegisteredDomainServiceSetDomainTransferLockWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainTransferLockRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } @@ -681,10 +791,10 @@ func (c *Client) ServiceAccountServiceGenerateTokenWithBody(ctx context.Context, return c.Client.Do(req) } -// ServiceAccountServiceGenerateToken performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. +// RegisteredDomainServiceSetDomainTransferLock performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request. // Takes a body of the `application/json` content type. -func (c *Client) ServiceAccountServiceGenerateToken(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewServiceAccountServiceGenerateTokenRequest(c.Server, serviceAccountId, body) +func (c *Client) RegisteredDomainServiceSetDomainTransferLock(ctx context.Context, name string, body RegisteredDomainServiceSetDomainTransferLockJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainTransferLockRequest(c.Server, name, body) if err != nil { return nil, err } @@ -695,453 +805,394 @@ func (c *Client) ServiceAccountServiceGenerateToken(ctx context.Context, service return c.Client.Do(req) } -// NewAgentServiceListAgentsRequest constructs an http.Request for the AgentServiceListAgents method -func NewAgentServiceListAgentsRequest(server string, params *AgentServiceListAgentsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +// RegisteredDomainServiceSetDomainNameserversWithBody performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RegisteredDomainServiceSetDomainNameserversWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainNameserversRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// RegisteredDomainServiceSetDomainNameservers performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RegisteredDomainServiceSetDomainNameservers(ctx context.Context, name string, body RegisteredDomainServiceSetDomainNameserversJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceSetDomainNameserversRequest(c.Server, name, body) 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.Page != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.GatewayRegion != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "gatewayRegion", *params.GatewayRegion, 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.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 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 { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewAgentServiceCreateAgentRequest calls the generic AgentServiceCreateAgent builder with application/json body -func NewAgentServiceCreateAgentRequest(server string, body AgentServiceCreateAgentJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// RegisteredDomainServiceRenewDomainWithBody performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RegisteredDomainServiceRenewDomainWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceRenewDomainRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewAgentServiceCreateAgentRequestWithBody(server, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewAgentServiceCreateAgentRequestWithBody constructs an http.Request for the AgentServiceCreateAgent method, with any body, and a specified content type -func NewAgentServiceCreateAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +// RegisteredDomainServiceRenewDomain performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RegisteredDomainServiceRenewDomain(ctx context.Context, name string, body RegisteredDomainServiceRenewDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRegisteredDomainServiceRenewDomainRequest(c.Server, name, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// DomainOrderServiceCreateDomainOrderWithBody performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request, +// with any type of body and a specified content type. +func (c *Client) DomainOrderServiceCreateDomainOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServiceCreateDomainOrderRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewAgentServiceDeleteAgentRequest constructs an http.Request for the AgentServiceDeleteAgent method -func NewAgentServiceDeleteAgentRequest(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: ""}) +// DomainOrderServiceCreateDomainOrder performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) DomainOrderServiceCreateDomainOrder(ctx context.Context, body DomainOrderServiceCreateDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServiceCreateDomainOrderRequest(c.Server, body) if err != nil { return nil, err } - - serverURL, err := url.Parse(server) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) +// DomainOrderServiceGetDomainOrder performs a GET /v1/registrar/orders/{id} (the `DomainOrderServiceGetDomainOrder` operationId) request. +func (c *Client) DomainOrderServiceGetDomainOrder(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServiceGetDomainOrderRequest(c.Server, id) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - return req, nil -} - -// NewAgentServiceGetAgentRequest constructs an http.Request for the AgentServiceGetAgent method -func NewAgentServiceGetAgentRequest(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: ""}) +// DomainOrderServiceCheckoutDomainOrderWithBody performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request, +// with any type of body and a specified content type. +func (c *Client) DomainOrderServiceCheckoutDomainOrderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServiceCheckoutDomainOrderRequestWithBody(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) +} - serverURL, err := url.Parse(server) +// DomainOrderServiceCheckoutDomainOrder performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) DomainOrderServiceCheckoutDomainOrder(ctx context.Context, id string, body DomainOrderServiceCheckoutDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServiceCheckoutDomainOrderRequest(c.Server, id, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// DomainOrderServicePriceDomainOrderWithBody performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request, +// with any type of body and a specified content type. +func (c *Client) DomainOrderServicePriceDomainOrderWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServicePriceDomainOrderRequestWithBody(c.Server, id, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewAgentServiceUpdateAgentRequest calls the generic AgentServiceUpdateAgent builder with application/json body -func NewAgentServiceUpdateAgentRequest(server string, id string, body AgentServiceUpdateAgentJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// DomainOrderServicePriceDomainOrder performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) DomainOrderServicePriceDomainOrder(ctx context.Context, id string, body DomainOrderServicePriceDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainOrderServicePriceDomainOrderRequest(c.Server, id, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewAgentServiceUpdateAgentRequestWithBody(server, id, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewAgentServiceUpdateAgentRequestWithBody constructs an http.Request for the AgentServiceUpdateAgent method, with any body, and a specified content type -func NewAgentServiceUpdateAgentRequestWithBody(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: ""}) +// DomainSearchServiceSearchDomainsWithBody performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request, +// with any type of body and a specified content type. +func (c *Client) DomainSearchServiceSearchDomainsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceSearchDomainsRequestWithBody(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) +} - serverURL, err := url.Parse(server) +// DomainSearchServiceSearchDomains performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) DomainSearchServiceSearchDomains(ctx context.Context, body DomainSearchServiceSearchDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceSearchDomainsRequest(c.Server, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// DomainSearchServiceCheckTransferWithBody performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request, +// with any type of body and a specified content type. +func (c *Client) DomainSearchServiceCheckTransferWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceCheckTransferRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewAgentServiceGeneratePeeringConfigRequest calls the generic AgentServiceGeneratePeeringConfig builder with application/json body -func NewAgentServiceGeneratePeeringConfigRequest(server string, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// DomainSearchServiceCheckTransfer performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) DomainSearchServiceCheckTransfer(ctx context.Context, body DomainSearchServiceCheckTransferJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDomainSearchServiceCheckTransferRequest(c.Server, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewAgentServiceGeneratePeeringConfigRequestWithBody(server, id, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewAgentServiceGeneratePeeringConfigRequestWithBody constructs an http.Request for the AgentServiceGeneratePeeringConfig method, with any body, and a specified content type -func NewAgentServiceGeneratePeeringConfigRequestWithBody(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: ""}) +// RoleServiceReplaceRoleForServiceAccountWithBody performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, +// with any type of body and a specified content type. +func (c *Client) RoleServiceReplaceRoleForServiceAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(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) +} - serverURL, err := url.Parse(server) +// RoleServiceReplaceRoleForServiceAccount performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) RoleServiceReplaceRoleForServiceAccount(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRoleServiceReplaceRoleForServiceAccountRequest(c.Server, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents/%s:generatePeeringConfig", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// ServiceAccountServiceListServiceAccounts performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. +func (c *Client) ServiceAccountServiceListServiceAccounts(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceListServiceAccountsRequest(c.Server, params) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewAgentServiceUploadInboundPeeringConfigRequest calls the generic AgentServiceUploadInboundPeeringConfig builder with application/json body -func NewAgentServiceUploadInboundPeeringConfigRequest(server string, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// ServiceAccountServiceCreateServiceAccountWithBody performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, +// with any type of body and a specified content type. +func (c *Client) ServiceAccountServiceCreateServiceAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceCreateServiceAccountRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewAgentServiceUploadInboundPeeringConfigRequestWithBody(server, id, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewAgentServiceUploadInboundPeeringConfigRequestWithBody constructs an http.Request for the AgentServiceUploadInboundPeeringConfig method, with any body, and a specified content type -func NewAgentServiceUploadInboundPeeringConfigRequestWithBody(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: ""}) +// ServiceAccountServiceCreateServiceAccount performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) ServiceAccountServiceCreateServiceAccount(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceCreateServiceAccountRequest(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) +} - serverURL, err := url.Parse(server) +// ServiceAccountServiceRevokeToken performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. +func (c *Client) ServiceAccountServiceRevokeToken(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceRevokeTokenRequest(c.Server, tokenId) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/agents/%s:uploadInboundPeeringConfig", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// ServiceAccountServiceDeleteServiceAccount performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. +func (c *Client) ServiceAccountServiceDeleteServiceAccount(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceDeleteServiceAccountRequest(c.Server, id) if err != nil { return nil, err } - - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewGroupServiceAddServiceAccountToGroupRequest calls the generic GroupServiceAddServiceAccountToGroup builder with application/json body -func NewGroupServiceAddServiceAccountToGroupRequest(server string, body GroupServiceAddServiceAccountToGroupJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// ServiceAccountServiceGetServiceAccount performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. +func (c *Client) ServiceAccountServiceGetServiceAccount(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceGetServiceAccountRequest(c.Server, id) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewGroupServiceAddServiceAccountToGroupRequestWithBody(server, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewGroupServiceAddServiceAccountToGroupRequestWithBody constructs an http.Request for the GroupServiceAddServiceAccountToGroup method, with any body, and a specified content type -func NewGroupServiceAddServiceAccountToGroupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +// ServiceAccountServiceUpdateServiceAccountWithBody performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, +// with any type of body and a specified content type. +func (c *Client) ServiceAccountServiceUpdateServiceAccountWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceUpdateServiceAccountRequestWithBody(c.Server, id, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/groups/add-service-account") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// ServiceAccountServiceUpdateServiceAccount performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) ServiceAccountServiceUpdateServiceAccount(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceUpdateServiceAccountRequest(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) +} - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) +// ServiceAccountServiceListTokens performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. +func (c *Client) ServiceAccountServiceListTokens(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceListTokensRequest(c.Server, serviceAccountId, 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) +} - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGroupServiceRemoveServiceAccountFromGroupRequest constructs an http.Request for the GroupServiceRemoveServiceAccountFromGroup method -func NewGroupServiceRemoveServiceAccountFromGroupRequest(server string, params *GroupServiceRemoveServiceAccountFromGroupParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +// ServiceAccountServiceGenerateTokenWithBody performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, +// with any type of body and a specified content type. +func (c *Client) ServiceAccountServiceGenerateTokenWithBody(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceGenerateTokenRequestWithBody(c.Server, serviceAccountId, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/groups/remove-service-account") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +// ServiceAccountServiceGenerateToken performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. +// Takes a body of the `application/json` content type. +func (c *Client) ServiceAccountServiceGenerateToken(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountServiceGenerateTokenRequest(c.Server, serviceAccountId, body) 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.GroupId != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "groupId", *params.GroupId, 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.ServiceAccountIds != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "serviceAccountIds", *params.ServiceAccountIds, 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.MethodDelete, queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewMetricsCredentialServiceListMetricsWriteCredentialsRequest constructs an http.Request for the MetricsCredentialServiceListMetricsWriteCredentials method -func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string, params *MetricsCredentialServiceListMetricsWriteCredentialsParams) (*http.Request, error) { +// NewAgentServiceListAgentsRequest constructs an http.Request for the AgentServiceListAgents method +func NewAgentServiceListAgentsRequest(server string, params *AgentServiceListAgentsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1149,7 +1200,7 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string return nil, err } - operationPath := fmt.Sprintf("/v1/metrics-write-credentials") + operationPath := fmt.Sprintf("/v1/agents") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1168,9 +1219,9 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string - if params.AgentId != nil { + if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "agentId", *params.AgentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -1180,9 +1231,9 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string } - if params.IncludeRevoked != nil { + if params.PageSize != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeRevoked", *params.IncludeRevoked, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -1192,9 +1243,9 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string } - if params.Page != nil { + if params.GatewayRegion != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "gatewayRegion", *params.GatewayRegion, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -1204,9 +1255,9 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string } - if params.PageSize != nil { + if params.Search != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != 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, "&") { @@ -1230,19 +1281,19 @@ func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string return req, nil } -// NewMetricsCredentialServiceCreateMetricsWriteCredentialRequest calls the generic MetricsCredentialServiceCreateMetricsWriteCredential builder with application/json body -func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequest(server string, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody) (*http.Request, error) { +// NewAgentServiceCreateAgentRequest calls the generic AgentServiceCreateAgent builder with application/json body +func NewAgentServiceCreateAgentRequest(server string, body AgentServiceCreateAgentJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(server, "application/json", bodyReader) + return NewAgentServiceCreateAgentRequestWithBody(server, "application/json", bodyReader) } -// NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody constructs an http.Request for the MetricsCredentialServiceCreateMetricsWriteCredential method, with any body, and a specified content type -func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewAgentServiceCreateAgentRequestWithBody constructs an http.Request for the AgentServiceCreateAgent method, with any body, and a specified content type +func NewAgentServiceCreateAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1250,7 +1301,7 @@ func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(serv return nil, err } - operationPath := fmt.Sprintf("/v1/metrics-write-credentials") + operationPath := fmt.Sprintf("/v1/agents") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1270,19 +1321,8 @@ func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(serv return req, nil } -// NewMetricsCredentialServiceRotateMetricsWriteCredentialRequest calls the generic MetricsCredentialServiceRotateMetricsWriteCredential builder with application/json body -func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequest(server string, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody constructs an http.Request for the MetricsCredentialServiceRotateMetricsWriteCredential method, with any body, and a specified content type -func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewAgentServiceDeleteAgentRequest constructs an http.Request for the AgentServiceDeleteAgent method +func NewAgentServiceDeleteAgentRequest(server string, id string) (*http.Request, error) { var err error var pathParam0 string @@ -1297,7 +1337,7 @@ func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(serv return nil, err } - operationPath := fmt.Sprintf("/v1/metrics-write-credentials/%s:rotate", pathParam0) + operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1307,26 +1347,31 @@ func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(serv return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewOrganizationServiceGetOrganizationRequest constructs an http.Request for the OrganizationServiceGetOrganization method -func NewOrganizationServiceGetOrganizationRequest(server string) (*http.Request, error) { +// NewAgentServiceGetAgentRequest constructs an http.Request for the AgentServiceGetAgent method +func NewAgentServiceGetAgentRequest(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("/v1/organization") + operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1344,16 +1389,34 @@ func NewOrganizationServiceGetOrganizationRequest(server string) (*http.Request, return req, nil } -// NewOrganizationServiceListOrganizationsRequest constructs an http.Request for the OrganizationServiceListOrganizations method -func NewOrganizationServiceListOrganizationsRequest(server string, params *OrganizationServiceListOrganizationsParams) (*http.Request, error) { +// NewAgentServiceUpdateAgentRequest calls the generic AgentServiceUpdateAgent builder with application/json body +func NewAgentServiceUpdateAgentRequest(server string, id string, body AgentServiceUpdateAgentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAgentServiceUpdateAgentRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewAgentServiceUpdateAgentRequestWithBody constructs an http.Request for the AgentServiceUpdateAgent method, with any body, and a specified content type +func NewAgentServiceUpdateAgentRequestWithBody(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("/v1/organizations") + operationPath := fmt.Sprintf("/v1/agents/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1363,63 +1426,44 @@ func NewOrganizationServiceListOrganizationsRequest(server string, params *Organ 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.Page != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.PageSize != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } - } + req.Header.Add("Content-Type", contentType) - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } + return req, nil +} - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) +// NewAgentServiceGeneratePeeringConfigRequest calls the generic AgentServiceGeneratePeeringConfig builder with application/json body +func NewAgentServiceGeneratePeeringConfigRequest(server string, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } - - return req, nil + bodyReader = bytes.NewReader(buf) + return NewAgentServiceGeneratePeeringConfigRequestWithBody(server, id, "application/json", bodyReader) } -// NewMetadataServiceGetPlatformVersionsRequest constructs an http.Request for the MetadataServiceGetPlatformVersions method -func NewMetadataServiceGetPlatformVersionsRequest(server string) (*http.Request, error) { +// NewAgentServiceGeneratePeeringConfigRequestWithBody constructs an http.Request for the AgentServiceGeneratePeeringConfig method, with any body, and a specified content type +func NewAgentServiceGeneratePeeringConfigRequestWithBody(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("/v1/platform-versions") + operationPath := fmt.Sprintf("/v1/agents/%s:generatePeeringConfig", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1429,35 +1473,44 @@ func NewMetadataServiceGetPlatformVersionsRequest(server string) (*http.Request, return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewRoleServiceReplaceRoleForServiceAccountRequest calls the generic RoleServiceReplaceRoleForServiceAccount builder with application/json body -func NewRoleServiceReplaceRoleForServiceAccountRequest(server string, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody) (*http.Request, error) { +// NewAgentServiceUploadInboundPeeringConfigRequest calls the generic AgentServiceUploadInboundPeeringConfig builder with application/json body +func NewAgentServiceUploadInboundPeeringConfigRequest(server string, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(server, "application/json", bodyReader) + return NewAgentServiceUploadInboundPeeringConfigRequestWithBody(server, id, "application/json", bodyReader) } -// NewRoleServiceReplaceRoleForServiceAccountRequestWithBody constructs an http.Request for the RoleServiceReplaceRoleForServiceAccount method, with any body, and a specified content type -func NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewAgentServiceUploadInboundPeeringConfigRequestWithBody constructs an http.Request for the AgentServiceUploadInboundPeeringConfig method, with any body, and a specified content type +func NewAgentServiceUploadInboundPeeringConfigRequestWithBody(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("/v1/roles/replace-for-service-account") + operationPath := fmt.Sprintf("/v1/agents/%s:uploadInboundPeeringConfig", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1467,7 +1520,7 @@ func NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(server string, co return nil, err } - req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -1477,8 +1530,19 @@ func NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(server string, co return req, nil } -// NewServiceAccountServiceListServiceAccountsRequest constructs an http.Request for the ServiceAccountServiceListServiceAccounts method -func NewServiceAccountServiceListServiceAccountsRequest(server string, params *ServiceAccountServiceListServiceAccountsParams) (*http.Request, error) { +// NewGroupServiceAddServiceAccountToGroupRequest calls the generic GroupServiceAddServiceAccountToGroup builder with application/json body +func NewGroupServiceAddServiceAccountToGroupRequest(server string, body GroupServiceAddServiceAccountToGroupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewGroupServiceAddServiceAccountToGroupRequestWithBody(server, "application/json", bodyReader) +} + +// NewGroupServiceAddServiceAccountToGroupRequestWithBody constructs an http.Request for the GroupServiceAddServiceAccountToGroup method, with any body, and a specified content type +func NewGroupServiceAddServiceAccountToGroupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1486,7 +1550,36 @@ func NewServiceAccountServiceListServiceAccountsRequest(server string, params *S return nil, err } - operationPath := fmt.Sprintf("/v1/service-accounts") + operationPath := fmt.Sprintf("/v1/groups/add-service-account") + 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 +} + +// NewGroupServiceRemoveServiceAccountFromGroupRequest constructs an http.Request for the GroupServiceRemoveServiceAccountFromGroup method +func NewGroupServiceRemoveServiceAccountFromGroupRequest(server string, params *GroupServiceRemoveServiceAccountFromGroupParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/groups/remove-service-account") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1505,9 +1598,87 @@ func NewServiceAccountServiceListServiceAccountsRequest(server string, params *S // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string - if params.IncludeInactive != nil { + if params.GroupId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeInactive", *params.IncludeInactive, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "groupId", *params.GroupId, 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.ServiceAccountIds != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "serviceAccountIds", *params.ServiceAccountIds, 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.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewMetricsCredentialServiceListMetricsWriteCredentialsRequest constructs an http.Request for the MetricsCredentialServiceListMetricsWriteCredentials method +func NewMetricsCredentialServiceListMetricsWriteCredentialsRequest(server string, params *MetricsCredentialServiceListMetricsWriteCredentialsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/metrics-write-credentials") + 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.AgentId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "agentId", *params.AgentId, 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.IncludeRevoked != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeRevoked", *params.IncludeRevoked, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -1555,19 +1726,19 @@ func NewServiceAccountServiceListServiceAccountsRequest(server string, params *S return req, nil } -// NewServiceAccountServiceCreateServiceAccountRequest calls the generic ServiceAccountServiceCreateServiceAccount builder with application/json body -func NewServiceAccountServiceCreateServiceAccountRequest(server string, body ServiceAccountServiceCreateServiceAccountJSONRequestBody) (*http.Request, error) { +// NewMetricsCredentialServiceCreateMetricsWriteCredentialRequest calls the generic MetricsCredentialServiceCreateMetricsWriteCredential builder with application/json body +func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequest(server string, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewServiceAccountServiceCreateServiceAccountRequestWithBody(server, "application/json", bodyReader) + return NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(server, "application/json", bodyReader) } -// NewServiceAccountServiceCreateServiceAccountRequestWithBody constructs an http.Request for the ServiceAccountServiceCreateServiceAccount method, with any body, and a specified content type -func NewServiceAccountServiceCreateServiceAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody constructs an http.Request for the MetricsCredentialServiceCreateMetricsWriteCredential method, with any body, and a specified content type +func NewMetricsCredentialServiceCreateMetricsWriteCredentialRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1575,7 +1746,7 @@ func NewServiceAccountServiceCreateServiceAccountRequestWithBody(server string, return nil, err } - operationPath := fmt.Sprintf("/v1/service-accounts") + operationPath := fmt.Sprintf("/v1/metrics-write-credentials") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1595,13 +1766,24 @@ func NewServiceAccountServiceCreateServiceAccountRequestWithBody(server string, return req, nil } -// NewServiceAccountServiceRevokeTokenRequest constructs an http.Request for the ServiceAccountServiceRevokeToken method -func NewServiceAccountServiceRevokeTokenRequest(server string, tokenId string) (*http.Request, error) { +// NewMetricsCredentialServiceRotateMetricsWriteCredentialRequest calls the generic MetricsCredentialServiceRotateMetricsWriteCredential builder with application/json body +func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequest(server string, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody constructs an http.Request for the MetricsCredentialServiceRotateMetricsWriteCredential method, with any body, and a specified content type +func NewMetricsCredentialServiceRotateMetricsWriteCredentialRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "tokenId", tokenId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -1611,7 +1793,7 @@ func NewServiceAccountServiceRevokeTokenRequest(server string, tokenId string) ( return nil, err } - operationPath := fmt.Sprintf("/v1/service-accounts/tokens/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/metrics-write-credentials/%s:rotate", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1621,31 +1803,26 @@ func NewServiceAccountServiceRevokeTokenRequest(server string, tokenId string) ( return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewServiceAccountServiceDeleteServiceAccountRequest constructs an http.Request for the ServiceAccountServiceDeleteServiceAccount method -func NewServiceAccountServiceDeleteServiceAccountRequest(server string, id string) (*http.Request, error) { +// NewOrganizationServiceGetOrganizationRequest constructs an http.Request for the OrganizationServiceGetOrganization method +func NewOrganizationServiceGetOrganizationRequest(server 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("/v1/service-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/organization") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1655,7 +1832,7 @@ func NewServiceAccountServiceDeleteServiceAccountRequest(server string, id strin return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1663,23 +1840,16 @@ func NewServiceAccountServiceDeleteServiceAccountRequest(server string, id strin return req, nil } -// NewServiceAccountServiceGetServiceAccountRequest constructs an http.Request for the ServiceAccountServiceGetServiceAccount method -func NewServiceAccountServiceGetServiceAccountRequest(server string, id string) (*http.Request, error) { +// NewOrganizationServiceListOrganizationsRequest constructs an http.Request for the OrganizationServiceListOrganizations method +func NewOrganizationServiceListOrganizationsRequest(server string, params *OrganizationServiceListOrganizationsParams) (*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("/v1/service-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/organizations") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1689,6 +1859,45 @@ func NewServiceAccountServiceGetServiceAccountRequest(server string, id string) 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.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); 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 @@ -1697,34 +1906,16 @@ func NewServiceAccountServiceGetServiceAccountRequest(server string, id string) return req, nil } -// NewServiceAccountServiceUpdateServiceAccountRequest calls the generic ServiceAccountServiceUpdateServiceAccount builder with application/json body -func NewServiceAccountServiceUpdateServiceAccountRequest(server string, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewServiceAccountServiceUpdateServiceAccountRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewServiceAccountServiceUpdateServiceAccountRequestWithBody constructs an http.Request for the ServiceAccountServiceUpdateServiceAccount method, with any body, and a specified content type -func NewServiceAccountServiceUpdateServiceAccountRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { +// NewMetadataServiceGetPlatformVersionsRequest constructs an http.Request for the MetadataServiceGetPlatformVersions method +func NewMetadataServiceGetPlatformVersionsRequest(server 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("/v1/service-accounts/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/platform-versions") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1734,33 +1925,64 @@ func NewServiceAccountServiceUpdateServiceAccountRequestWithBody(server string, return nil, err } - req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewServiceAccountServiceListTokensRequest constructs an http.Request for the ServiceAccountServiceListTokens method -func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId string, params *ServiceAccountServiceListTokensParams) (*http.Request, error) { +// NewDomainSearchServiceCheckDomainsRequest calls the generic DomainSearchServiceCheckDomains builder with application/json body +func NewDomainSearchServiceCheckDomainsRequest(server string, body DomainSearchServiceCheckDomainsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainSearchServiceCheckDomainsRequestWithBody(server, "application/json", bodyReader) +} + +// NewDomainSearchServiceCheckDomainsRequestWithBody constructs an http.Request for the DomainSearchServiceCheckDomains method, with any body, and a specified content type +func NewDomainSearchServiceCheckDomainsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "serviceAccountId", serviceAccountId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + operationPath := fmt.Sprintf("/v1/registrar/check") + 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 +} + +// NewDomainContactServiceListDomainContactsRequest constructs an http.Request for the DomainContactServiceListDomainContacts method +func NewDomainContactServiceListDomainContactsRequest(server string, params *DomainContactServiceListDomainContactsParams) (*http.Request, error) { + var err error + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/service-accounts/%s/tokens", pathParam0) + operationPath := fmt.Sprintf("/v1/registrar/contacts") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1779,9 +2001,33 @@ func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId s // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string - if params.IncludeInactive != nil { + if params.Page != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeInactive", *params.IncludeInactive, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); 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, "&") { @@ -1791,6 +2037,48 @@ func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId s } + 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 +} + +// NewRegisteredDomainServiceListRegisteredDomainsRequest constructs an http.Request for the RegisteredDomainServiceListRegisteredDomains method +func NewRegisteredDomainServiceListRegisteredDomainsRequest(server string, params *RegisteredDomainServiceListRegisteredDomainsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/registrar/domains") + 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.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { @@ -1815,6 +2103,54 @@ func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId s } + if params.States != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "states", *params.States, 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.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.ExpiringSoon != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "expiringSoon", *params.ExpiringSoon, 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.NeedsAttention != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "needsAttention", *params.NeedsAttention, 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 encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } @@ -1829,24 +2165,58 @@ func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId s return req, nil } -// NewServiceAccountServiceGenerateTokenRequest calls the generic ServiceAccountServiceGenerateToken builder with application/json body -func NewServiceAccountServiceGenerateTokenRequest(server string, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody) (*http.Request, error) { +// NewRegisteredDomainServiceGetRegisteredDomainRequest constructs an http.Request for the RegisteredDomainServiceGetRegisteredDomain method +func NewRegisteredDomainServiceGetRegisteredDomainRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, 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("/v1/registrar/domains/%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 +} + +// NewRegisteredDomainServiceGetDomainAuthCodeRequest calls the generic RegisteredDomainServiceGetDomainAuthCode builder with application/json body +func NewRegisteredDomainServiceGetDomainAuthCodeRequest(server string, name string, body RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewServiceAccountServiceGenerateTokenRequestWithBody(server, serviceAccountId, "application/json", bodyReader) + return NewRegisteredDomainServiceGetDomainAuthCodeRequestWithBody(server, name, "application/json", bodyReader) } -// NewServiceAccountServiceGenerateTokenRequestWithBody constructs an http.Request for the ServiceAccountServiceGenerateToken method, with any body, and a specified content type -func NewServiceAccountServiceGenerateTokenRequestWithBody(server string, serviceAccountId string, contentType string, body io.Reader) (*http.Request, error) { +// NewRegisteredDomainServiceGetDomainAuthCodeRequestWithBody constructs an http.Request for the RegisteredDomainServiceGetDomainAuthCode method, with any body, and a specified content type +func NewRegisteredDomainServiceGetDomainAuthCodeRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "serviceAccountId", serviceAccountId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -1856,7 +2226,7 @@ func NewServiceAccountServiceGenerateTokenRequestWithBody(server string, service return nil, err } - operationPath := fmt.Sprintf("/v1/service-accounts/%s/tokens", pathParam0) + operationPath := fmt.Sprintf("/v1/registrar/domains/%s/auth-code", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1876,245 +2246,2414 @@ func NewServiceAccountServiceGenerateTokenRequestWithBody(server string, service 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 - } +// NewRegisteredDomainServiceSetDomainAutoRenewRequest calls the generic RegisteredDomainServiceSetDomainAutoRenew builder with application/json body +func NewRegisteredDomainServiceSetDomainAutoRenewRequest(server string, name string, body RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return nil + bodyReader = bytes.NewReader(buf) + return NewRegisteredDomainServiceSetDomainAutoRenewRequestWithBody(server, name, "application/json", bodyReader) } -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} +// NewRegisteredDomainServiceSetDomainAutoRenewRequestWithBody constructs an http.Request for the RegisteredDomainServiceSetDomainAutoRenew method, with any body, and a specified content type +func NewRegisteredDomainServiceSetDomainAutoRenewRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error -// 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...) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) 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 + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // AgentServiceListAgentsWithResponse performs a GET /v1/agents (the `AgentServiceListAgents` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceListAgentsWithResponse(ctx context.Context, params *AgentServiceListAgentsParams, reqEditors ...RequestEditorFn) (*AgentServiceListAgentsResponse, error) + operationPath := fmt.Sprintf("/v1/registrar/domains/%s/auto-renew", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // AgentServiceCreateAgentWithBodyWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceCreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // AgentServiceCreateAgentWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - AgentServiceCreateAgentWithResponse(ctx context.Context, body AgentServiceCreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + if err != nil { + return nil, err + } - // AgentServiceDeleteAgentWithResponse performs a DELETE /v1/agents/{id} (the `AgentServiceDeleteAgent` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceDeleteAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceDeleteAgentResponse, error) + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewRegisteredDomainServiceSetDomainDnssecRequest calls the generic RegisteredDomainServiceSetDomainDnssec builder with application/json body +func NewRegisteredDomainServiceSetDomainDnssecRequest(server string, name string, body RegisteredDomainServiceSetDomainDnssecJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRegisteredDomainServiceSetDomainDnssecRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewRegisteredDomainServiceSetDomainDnssecRequestWithBody constructs an http.Request for the RegisteredDomainServiceSetDomainDnssec method, with any body, and a specified content type +func NewRegisteredDomainServiceSetDomainDnssecRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, 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("/v1/registrar/domains/%s/dnssec", pathParam0) + 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 +} + +// NewRegisteredDomainServiceSetDomainTransferLockRequest calls the generic RegisteredDomainServiceSetDomainTransferLock builder with application/json body +func NewRegisteredDomainServiceSetDomainTransferLockRequest(server string, name string, body RegisteredDomainServiceSetDomainTransferLockJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRegisteredDomainServiceSetDomainTransferLockRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewRegisteredDomainServiceSetDomainTransferLockRequestWithBody constructs an http.Request for the RegisteredDomainServiceSetDomainTransferLock method, with any body, and a specified content type +func NewRegisteredDomainServiceSetDomainTransferLockRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, 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("/v1/registrar/domains/%s/lock", pathParam0) + 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 +} + +// NewRegisteredDomainServiceSetDomainNameserversRequest calls the generic RegisteredDomainServiceSetDomainNameservers builder with application/json body +func NewRegisteredDomainServiceSetDomainNameserversRequest(server string, name string, body RegisteredDomainServiceSetDomainNameserversJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRegisteredDomainServiceSetDomainNameserversRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewRegisteredDomainServiceSetDomainNameserversRequestWithBody constructs an http.Request for the RegisteredDomainServiceSetDomainNameservers method, with any body, and a specified content type +func NewRegisteredDomainServiceSetDomainNameserversRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, 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("/v1/registrar/domains/%s/nameservers", pathParam0) + 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 +} + +// NewRegisteredDomainServiceRenewDomainRequest calls the generic RegisteredDomainServiceRenewDomain builder with application/json body +func NewRegisteredDomainServiceRenewDomainRequest(server string, name string, body RegisteredDomainServiceRenewDomainJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRegisteredDomainServiceRenewDomainRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewRegisteredDomainServiceRenewDomainRequestWithBody constructs an http.Request for the RegisteredDomainServiceRenewDomain method, with any body, and a specified content type +func NewRegisteredDomainServiceRenewDomainRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, 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("/v1/registrar/domains/%s/renew", 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 +} + +// NewDomainOrderServiceCreateDomainOrderRequest calls the generic DomainOrderServiceCreateDomainOrder builder with application/json body +func NewDomainOrderServiceCreateDomainOrderRequest(server string, body DomainOrderServiceCreateDomainOrderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainOrderServiceCreateDomainOrderRequestWithBody(server, "application/json", bodyReader) +} + +// NewDomainOrderServiceCreateDomainOrderRequestWithBody constructs an http.Request for the DomainOrderServiceCreateDomainOrder method, with any body, and a specified content type +func NewDomainOrderServiceCreateDomainOrderRequestWithBody(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("/v1/registrar/orders") + 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 +} + +// NewDomainOrderServiceGetDomainOrderRequest constructs an http.Request for the DomainOrderServiceGetDomainOrder method +func NewDomainOrderServiceGetDomainOrderRequest(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("/v1/registrar/orders/%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 +} + +// NewDomainOrderServiceCheckoutDomainOrderRequest calls the generic DomainOrderServiceCheckoutDomainOrder builder with application/json body +func NewDomainOrderServiceCheckoutDomainOrderRequest(server string, id string, body DomainOrderServiceCheckoutDomainOrderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainOrderServiceCheckoutDomainOrderRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewDomainOrderServiceCheckoutDomainOrderRequestWithBody constructs an http.Request for the DomainOrderServiceCheckoutDomainOrder method, with any body, and a specified content type +func NewDomainOrderServiceCheckoutDomainOrderRequestWithBody(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("/v1/registrar/orders/%s/checkout", 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 +} + +// NewDomainOrderServicePriceDomainOrderRequest calls the generic DomainOrderServicePriceDomainOrder builder with application/json body +func NewDomainOrderServicePriceDomainOrderRequest(server string, id string, body DomainOrderServicePriceDomainOrderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainOrderServicePriceDomainOrderRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewDomainOrderServicePriceDomainOrderRequestWithBody constructs an http.Request for the DomainOrderServicePriceDomainOrder method, with any body, and a specified content type +func NewDomainOrderServicePriceDomainOrderRequestWithBody(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("/v1/registrar/orders/%s/price", 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 +} + +// NewDomainSearchServiceSearchDomainsRequest calls the generic DomainSearchServiceSearchDomains builder with application/json body +func NewDomainSearchServiceSearchDomainsRequest(server string, body DomainSearchServiceSearchDomainsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainSearchServiceSearchDomainsRequestWithBody(server, "application/json", bodyReader) +} + +// NewDomainSearchServiceSearchDomainsRequestWithBody constructs an http.Request for the DomainSearchServiceSearchDomains method, with any body, and a specified content type +func NewDomainSearchServiceSearchDomainsRequestWithBody(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("/v1/registrar/search") + 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 +} + +// NewDomainSearchServiceCheckTransferRequest calls the generic DomainSearchServiceCheckTransfer builder with application/json body +func NewDomainSearchServiceCheckTransferRequest(server string, body DomainSearchServiceCheckTransferJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDomainSearchServiceCheckTransferRequestWithBody(server, "application/json", bodyReader) +} + +// NewDomainSearchServiceCheckTransferRequestWithBody constructs an http.Request for the DomainSearchServiceCheckTransfer method, with any body, and a specified content type +func NewDomainSearchServiceCheckTransferRequestWithBody(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("/v1/registrar/transfer-check") + 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 +} + +// NewRoleServiceReplaceRoleForServiceAccountRequest calls the generic RoleServiceReplaceRoleForServiceAccount builder with application/json body +func NewRoleServiceReplaceRoleForServiceAccountRequest(server string, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(server, "application/json", bodyReader) +} + +// NewRoleServiceReplaceRoleForServiceAccountRequestWithBody constructs an http.Request for the RoleServiceReplaceRoleForServiceAccount method, with any body, and a specified content type +func NewRoleServiceReplaceRoleForServiceAccountRequestWithBody(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("/v1/roles/replace-for-service-account") + 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 +} + +// NewServiceAccountServiceListServiceAccountsRequest constructs an http.Request for the ServiceAccountServiceListServiceAccounts method +func NewServiceAccountServiceListServiceAccountsRequest(server string, params *ServiceAccountServiceListServiceAccountsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/service-accounts") + 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.IncludeInactive != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeInactive", *params.IncludeInactive, 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.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); 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 +} + +// NewServiceAccountServiceCreateServiceAccountRequest calls the generic ServiceAccountServiceCreateServiceAccount builder with application/json body +func NewServiceAccountServiceCreateServiceAccountRequest(server string, body ServiceAccountServiceCreateServiceAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewServiceAccountServiceCreateServiceAccountRequestWithBody(server, "application/json", bodyReader) +} + +// NewServiceAccountServiceCreateServiceAccountRequestWithBody constructs an http.Request for the ServiceAccountServiceCreateServiceAccount method, with any body, and a specified content type +func NewServiceAccountServiceCreateServiceAccountRequestWithBody(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("/v1/service-accounts") + 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 +} + +// NewServiceAccountServiceRevokeTokenRequest constructs an http.Request for the ServiceAccountServiceRevokeToken method +func NewServiceAccountServiceRevokeTokenRequest(server string, tokenId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "tokenId", 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("/v1/service-accounts/tokens/%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 +} + +// NewServiceAccountServiceDeleteServiceAccountRequest constructs an http.Request for the ServiceAccountServiceDeleteServiceAccount method +func NewServiceAccountServiceDeleteServiceAccountRequest(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("/v1/service-accounts/%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 +} + +// NewServiceAccountServiceGetServiceAccountRequest constructs an http.Request for the ServiceAccountServiceGetServiceAccount method +func NewServiceAccountServiceGetServiceAccountRequest(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("/v1/service-accounts/%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 +} + +// NewServiceAccountServiceUpdateServiceAccountRequest calls the generic ServiceAccountServiceUpdateServiceAccount builder with application/json body +func NewServiceAccountServiceUpdateServiceAccountRequest(server string, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewServiceAccountServiceUpdateServiceAccountRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewServiceAccountServiceUpdateServiceAccountRequestWithBody constructs an http.Request for the ServiceAccountServiceUpdateServiceAccount method, with any body, and a specified content type +func NewServiceAccountServiceUpdateServiceAccountRequestWithBody(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("/v1/service-accounts/%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 +} + +// NewServiceAccountServiceListTokensRequest constructs an http.Request for the ServiceAccountServiceListTokens method +func NewServiceAccountServiceListTokensRequest(server string, serviceAccountId string, params *ServiceAccountServiceListTokensParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "serviceAccountId", serviceAccountId, 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("/v1/service-accounts/%s/tokens", 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 params.IncludeInactive != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeInactive", *params.IncludeInactive, 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.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.PageSize != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pageSize", *params.PageSize, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); 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 +} + +// NewServiceAccountServiceGenerateTokenRequest calls the generic ServiceAccountServiceGenerateToken builder with application/json body +func NewServiceAccountServiceGenerateTokenRequest(server string, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewServiceAccountServiceGenerateTokenRequestWithBody(server, serviceAccountId, "application/json", bodyReader) +} + +// NewServiceAccountServiceGenerateTokenRequestWithBody constructs an http.Request for the ServiceAccountServiceGenerateToken method, with any body, and a specified content type +func NewServiceAccountServiceGenerateTokenRequestWithBody(server string, serviceAccountId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "serviceAccountId", serviceAccountId, 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("/v1/service-accounts/%s/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(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + 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 { + + // AgentServiceListAgentsWithResponse performs a GET /v1/agents (the `AgentServiceListAgents` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceListAgentsWithResponse(ctx context.Context, params *AgentServiceListAgentsParams, reqEditors ...RequestEditorFn) (*AgentServiceListAgentsResponse, error) + + // AgentServiceCreateAgentWithBodyWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceCreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) + + // AgentServiceCreateAgentWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + AgentServiceCreateAgentWithResponse(ctx context.Context, body AgentServiceCreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) + + // AgentServiceDeleteAgentWithResponse performs a DELETE /v1/agents/{id} (the `AgentServiceDeleteAgent` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceDeleteAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceDeleteAgentResponse, error) // AgentServiceGetAgentWithResponse performs a GET /v1/agents/{id} (the `AgentServiceGetAgent` operationId) request. // // Returns a wrapper object for the known response body format(s). - AgentServiceGetAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceGetAgentResponse, error) + AgentServiceGetAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceGetAgentResponse, error) + + // AgentServiceUpdateAgentWithBodyWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceUpdateAgentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) + + // AgentServiceUpdateAgentWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + AgentServiceUpdateAgentWithResponse(ctx context.Context, id string, body AgentServiceUpdateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) + + // AgentServiceGeneratePeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceGeneratePeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) + + // AgentServiceGeneratePeeringConfigWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + AgentServiceGeneratePeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) + + // AgentServiceUploadInboundPeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AgentServiceUploadInboundPeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) + + // AgentServiceUploadInboundPeeringConfigWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + AgentServiceUploadInboundPeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) + + // GroupServiceAddServiceAccountToGroupWithBodyWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + GroupServiceAddServiceAccountToGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) + + // GroupServiceAddServiceAccountToGroupWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + GroupServiceAddServiceAccountToGroupWithResponse(ctx context.Context, body GroupServiceAddServiceAccountToGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) + + // GroupServiceRemoveServiceAccountFromGroupWithResponse performs a DELETE /v1/groups/remove-service-account (the `GroupServiceRemoveServiceAccountFromGroup` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GroupServiceRemoveServiceAccountFromGroupWithResponse(ctx context.Context, params *GroupServiceRemoveServiceAccountFromGroupParams, reqEditors ...RequestEditorFn) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) + + // MetricsCredentialServiceListMetricsWriteCredentialsWithResponse performs a GET /v1/metrics-write-credentials (the `MetricsCredentialServiceListMetricsWriteCredentials` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + MetricsCredentialServiceListMetricsWriteCredentialsWithResponse(ctx context.Context, params *MetricsCredentialServiceListMetricsWriteCredentialsParams, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) + + // MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) + + // MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse(ctx context.Context, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) + + // MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) + + // MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse(ctx context.Context, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) + + // OrganizationServiceGetOrganizationWithResponse performs a GET /v1/organization (the `OrganizationServiceGetOrganization` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + OrganizationServiceGetOrganizationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrganizationServiceGetOrganizationResponse, error) + + // OrganizationServiceListOrganizationsWithResponse performs a GET /v1/organizations (the `OrganizationServiceListOrganizations` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + OrganizationServiceListOrganizationsWithResponse(ctx context.Context, params *OrganizationServiceListOrganizationsParams, reqEditors ...RequestEditorFn) (*OrganizationServiceListOrganizationsResponse, error) + + // MetadataServiceGetPlatformVersionsWithResponse performs a GET /v1/platform-versions (the `MetadataServiceGetPlatformVersions` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + MetadataServiceGetPlatformVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MetadataServiceGetPlatformVersionsResponse, error) + + // DomainSearchServiceCheckDomainsWithBodyWithResponse performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainSearchServiceCheckDomainsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckDomainsResponse, error) + + // DomainSearchServiceCheckDomainsWithResponse performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainSearchServiceCheckDomainsWithResponse(ctx context.Context, body DomainSearchServiceCheckDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckDomainsResponse, error) + + // DomainContactServiceListDomainContactsWithResponse performs a GET /v1/registrar/contacts (the `DomainContactServiceListDomainContacts` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + DomainContactServiceListDomainContactsWithResponse(ctx context.Context, params *DomainContactServiceListDomainContactsParams, reqEditors ...RequestEditorFn) (*DomainContactServiceListDomainContactsResponse, error) + + // RegisteredDomainServiceListRegisteredDomainsWithResponse performs a GET /v1/registrar/domains (the `RegisteredDomainServiceListRegisteredDomains` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceListRegisteredDomainsWithResponse(ctx context.Context, params *RegisteredDomainServiceListRegisteredDomainsParams, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceListRegisteredDomainsResponse, error) + + // RegisteredDomainServiceGetRegisteredDomainWithResponse performs a GET /v1/registrar/domains/{name} (the `RegisteredDomainServiceGetRegisteredDomain` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceGetRegisteredDomainWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetRegisteredDomainResponse, error) + + // RegisteredDomainServiceGetDomainAuthCodeWithBodyWithResponse performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceGetDomainAuthCodeWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetDomainAuthCodeResponse, error) + + // RegisteredDomainServiceGetDomainAuthCodeWithResponse performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceGetDomainAuthCodeWithResponse(ctx context.Context, name string, body RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetDomainAuthCodeResponse, error) + + // RegisteredDomainServiceSetDomainAutoRenewWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainAutoRenewWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainAutoRenewResponse, error) + + // RegisteredDomainServiceSetDomainAutoRenewWithResponse performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainAutoRenewWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainAutoRenewResponse, error) + + // RegisteredDomainServiceSetDomainDnssecWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainDnssecWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainDnssecResponse, error) + + // RegisteredDomainServiceSetDomainDnssecWithResponse performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainDnssecWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainDnssecJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainDnssecResponse, error) + + // RegisteredDomainServiceSetDomainTransferLockWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainTransferLockWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainTransferLockResponse, error) + + // RegisteredDomainServiceSetDomainTransferLockWithResponse performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainTransferLockWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainTransferLockJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainTransferLockResponse, error) + + // RegisteredDomainServiceSetDomainNameserversWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainNameserversWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainNameserversResponse, error) + + // RegisteredDomainServiceSetDomainNameserversWithResponse performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceSetDomainNameserversWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainNameserversJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainNameserversResponse, error) + + // RegisteredDomainServiceRenewDomainWithBodyWithResponse performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RegisteredDomainServiceRenewDomainWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceRenewDomainResponse, error) + + // RegisteredDomainServiceRenewDomainWithResponse performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RegisteredDomainServiceRenewDomainWithResponse(ctx context.Context, name string, body RegisteredDomainServiceRenewDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceRenewDomainResponse, error) + + // DomainOrderServiceCreateDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainOrderServiceCreateDomainOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServiceCreateDomainOrderResponse, error) + + // DomainOrderServiceCreateDomainOrderWithResponse performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainOrderServiceCreateDomainOrderWithResponse(ctx context.Context, body DomainOrderServiceCreateDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServiceCreateDomainOrderResponse, error) + + // DomainOrderServiceGetDomainOrderWithResponse performs a GET /v1/registrar/orders/{id} (the `DomainOrderServiceGetDomainOrder` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + DomainOrderServiceGetDomainOrderWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DomainOrderServiceGetDomainOrderResponse, error) + + // DomainOrderServiceCheckoutDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainOrderServiceCheckoutDomainOrderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServiceCheckoutDomainOrderResponse, error) + + // DomainOrderServiceCheckoutDomainOrderWithResponse performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainOrderServiceCheckoutDomainOrderWithResponse(ctx context.Context, id string, body DomainOrderServiceCheckoutDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServiceCheckoutDomainOrderResponse, error) + + // DomainOrderServicePriceDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainOrderServicePriceDomainOrderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServicePriceDomainOrderResponse, error) + + // DomainOrderServicePriceDomainOrderWithResponse performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainOrderServicePriceDomainOrderWithResponse(ctx context.Context, id string, body DomainOrderServicePriceDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServicePriceDomainOrderResponse, error) + + // DomainSearchServiceSearchDomainsWithBodyWithResponse performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainSearchServiceSearchDomainsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceSearchDomainsResponse, error) + + // DomainSearchServiceSearchDomainsWithResponse performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainSearchServiceSearchDomainsWithResponse(ctx context.Context, body DomainSearchServiceSearchDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceSearchDomainsResponse, error) + + // DomainSearchServiceCheckTransferWithBodyWithResponse performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + DomainSearchServiceCheckTransferWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckTransferResponse, error) + + // DomainSearchServiceCheckTransferWithResponse performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + DomainSearchServiceCheckTransferWithResponse(ctx context.Context, body DomainSearchServiceCheckTransferJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckTransferResponse, error) + + // RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) + + // RoleServiceReplaceRoleForServiceAccountWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + RoleServiceReplaceRoleForServiceAccountWithResponse(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) + + // ServiceAccountServiceListServiceAccountsWithResponse performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceListServiceAccountsWithResponse(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListServiceAccountsResponse, error) + + // ServiceAccountServiceCreateServiceAccountWithBodyWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceCreateServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) + + // ServiceAccountServiceCreateServiceAccountWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + ServiceAccountServiceCreateServiceAccountWithResponse(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) + + // ServiceAccountServiceRevokeTokenWithResponse performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceRevokeTokenWithResponse(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceRevokeTokenResponse, error) + + // ServiceAccountServiceDeleteServiceAccountWithResponse performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceDeleteServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceDeleteServiceAccountResponse, error) + + // ServiceAccountServiceGetServiceAccountWithResponse performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceGetServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGetServiceAccountResponse, error) + + // ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) + + // ServiceAccountServiceUpdateServiceAccountWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + ServiceAccountServiceUpdateServiceAccountWithResponse(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) + + // ServiceAccountServiceListTokensWithResponse performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceListTokensWithResponse(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListTokensResponse, error) + + // ServiceAccountServiceGenerateTokenWithBodyWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + ServiceAccountServiceGenerateTokenWithBodyWithResponse(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) + + // ServiceAccountServiceGenerateTokenWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + ServiceAccountServiceGenerateTokenWithResponse(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) +} + +type AgentServiceListAgentsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1ListAgentsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceListAgentsResponse) GetJSON200() *V1ListAgentsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceListAgentsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceListAgentsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceListAgentsResponse) 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 AgentServiceListAgentsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceCreateAgentResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1GetAgentResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceCreateAgentResponse) GetJSON200() *V1GetAgentResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceCreateAgentResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceCreateAgentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceCreateAgentResponse) 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 AgentServiceCreateAgentResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceDeleteAgentResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1SuccessResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceDeleteAgentResponse) GetJSON200() *V1SuccessResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceDeleteAgentResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceDeleteAgentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceDeleteAgentResponse) 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 AgentServiceDeleteAgentResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceGetAgentResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1GetAgentResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceGetAgentResponse) GetJSON200() *V1GetAgentResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceGetAgentResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceGetAgentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceGetAgentResponse) 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 AgentServiceGetAgentResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceUpdateAgentResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1UpdateAgentResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceUpdateAgentResponse) GetJSON200() *V1UpdateAgentResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceUpdateAgentResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceUpdateAgentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceUpdateAgentResponse) 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 AgentServiceUpdateAgentResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceGeneratePeeringConfigResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1GeneratePeeringConfigResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceGeneratePeeringConfigResponse) GetJSON200() *V1GeneratePeeringConfigResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceGeneratePeeringConfigResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceGeneratePeeringConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceGeneratePeeringConfigResponse) 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 AgentServiceGeneratePeeringConfigResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type AgentServiceUploadInboundPeeringConfigResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1UploadInboundPeeringConfigResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AgentServiceUploadInboundPeeringConfigResponse) GetJSON200() *V1UploadInboundPeeringConfigResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r AgentServiceUploadInboundPeeringConfigResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AgentServiceUploadInboundPeeringConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AgentServiceUploadInboundPeeringConfigResponse) 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 AgentServiceUploadInboundPeeringConfigResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GroupServiceAddServiceAccountToGroupResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1SuccessResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GroupServiceAddServiceAccountToGroupResponse) GetJSON200() *V1SuccessResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GroupServiceAddServiceAccountToGroupResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GroupServiceAddServiceAccountToGroupResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GroupServiceAddServiceAccountToGroupResponse) 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 GroupServiceAddServiceAccountToGroupResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GroupServiceRemoveServiceAccountFromGroupResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1SuccessResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GroupServiceRemoveServiceAccountFromGroupResponse) GetJSON200() *V1SuccessResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r GroupServiceRemoveServiceAccountFromGroupResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GroupServiceRemoveServiceAccountFromGroupResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GroupServiceRemoveServiceAccountFromGroupResponse) 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 GroupServiceRemoveServiceAccountFromGroupResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MetricsCredentialServiceListMetricsWriteCredentialsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1ListMetricsWriteCredentialsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) GetJSON200() *V1ListMetricsWriteCredentialsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) 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 MetricsCredentialServiceListMetricsWriteCredentialsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MetricsCredentialServiceCreateMetricsWriteCredentialResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1CreateMetricsWriteCredentialResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) GetJSON200() *V1CreateMetricsWriteCredentialResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) 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 MetricsCredentialServiceCreateMetricsWriteCredentialResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MetricsCredentialServiceRotateMetricsWriteCredentialResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1CreateMetricsWriteCredentialResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) GetJSON200() *V1CreateMetricsWriteCredentialResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) 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 MetricsCredentialServiceRotateMetricsWriteCredentialResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type OrganizationServiceGetOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1GetOrganizationResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r OrganizationServiceGetOrganizationResponse) GetJSON200() *V1GetOrganizationResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r OrganizationServiceGetOrganizationResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r OrganizationServiceGetOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r OrganizationServiceGetOrganizationResponse) 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 OrganizationServiceGetOrganizationResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type OrganizationServiceListOrganizationsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1ListOrganizationsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r OrganizationServiceListOrganizationsResponse) GetJSON200() *V1ListOrganizationsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r OrganizationServiceListOrganizationsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r OrganizationServiceListOrganizationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r OrganizationServiceListOrganizationsResponse) 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 OrganizationServiceListOrganizationsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MetadataServiceGetPlatformVersionsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1PlatformVersions +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MetadataServiceGetPlatformVersionsResponse) GetJSON200() *V1PlatformVersions { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r MetadataServiceGetPlatformVersionsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MetadataServiceGetPlatformVersionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MetadataServiceGetPlatformVersionsResponse) 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 MetadataServiceGetPlatformVersionsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DomainSearchServiceCheckDomainsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1CheckDomainsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DomainSearchServiceCheckDomainsResponse) GetJSON200() *V1CheckDomainsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DomainSearchServiceCheckDomainsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DomainSearchServiceCheckDomainsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DomainSearchServiceCheckDomainsResponse) 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 DomainSearchServiceCheckDomainsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DomainContactServiceListDomainContactsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1ListDomainContactsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DomainContactServiceListDomainContactsResponse) GetJSON200() *V1ListDomainContactsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r DomainContactServiceListDomainContactsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DomainContactServiceListDomainContactsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DomainContactServiceListDomainContactsResponse) 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 DomainContactServiceListDomainContactsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RegisteredDomainServiceListRegisteredDomainsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1ListRegisteredDomainsResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceListRegisteredDomainsResponse) GetJSON200() *V1ListRegisteredDomainsResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceListRegisteredDomainsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceListRegisteredDomainsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceListRegisteredDomainsResponse) 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 RegisteredDomainServiceListRegisteredDomainsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RegisteredDomainServiceGetRegisteredDomainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1RegisteredDomain +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceGetRegisteredDomainResponse) GetJSON200() *V1RegisteredDomain { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceGetRegisteredDomainResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceGetRegisteredDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceGetRegisteredDomainResponse) 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 RegisteredDomainServiceGetRegisteredDomainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RegisteredDomainServiceGetDomainAuthCodeResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1GetDomainAuthCodeResponse +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceGetDomainAuthCodeResponse) GetJSON200() *V1GetDomainAuthCodeResponse { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceGetDomainAuthCodeResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceGetDomainAuthCodeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceGetDomainAuthCodeResponse) 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 RegisteredDomainServiceGetDomainAuthCodeResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RegisteredDomainServiceSetDomainAutoRenewResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1RegisteredDomain +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceSetDomainAutoRenewResponse) GetJSON200() *V1RegisteredDomain { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceSetDomainAutoRenewResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceSetDomainAutoRenewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceSetDomainAutoRenewResponse) 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 RegisteredDomainServiceSetDomainAutoRenewResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RegisteredDomainServiceSetDomainDnssecResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1RegisteredDomain +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceSetDomainDnssecResponse) GetJSON200() *V1RegisteredDomain { + return r.JSON200 +} + +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceSetDomainDnssecResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceSetDomainDnssecResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceSetDomainDnssecResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // AgentServiceUpdateAgentWithBodyWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceUpdateAgentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RegisteredDomainServiceSetDomainDnssecResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // AgentServiceUpdateAgentWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - AgentServiceUpdateAgentWithResponse(ctx context.Context, id string, body AgentServiceUpdateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) +type RegisteredDomainServiceSetDomainTransferLockResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1RegisteredDomain +} - // AgentServiceGeneratePeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceGeneratePeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceSetDomainTransferLockResponse) GetJSON200() *V1RegisteredDomain { + return r.JSON200 +} - // AgentServiceGeneratePeeringConfigWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - AgentServiceGeneratePeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceSetDomainTransferLockResponse) GetBody() []byte { + return r.Body +} - // AgentServiceUploadInboundPeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - AgentServiceUploadInboundPeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceSetDomainTransferLockResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // AgentServiceUploadInboundPeeringConfigWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - AgentServiceUploadInboundPeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceSetDomainTransferLockResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // GroupServiceAddServiceAccountToGroupWithBodyWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - GroupServiceAddServiceAccountToGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RegisteredDomainServiceSetDomainTransferLockResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // GroupServiceAddServiceAccountToGroupWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - GroupServiceAddServiceAccountToGroupWithResponse(ctx context.Context, body GroupServiceAddServiceAccountToGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) +type RegisteredDomainServiceSetDomainNameserversResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1RegisteredDomain +} - // GroupServiceRemoveServiceAccountFromGroupWithResponse performs a DELETE /v1/groups/remove-service-account (the `GroupServiceRemoveServiceAccountFromGroup` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - GroupServiceRemoveServiceAccountFromGroupWithResponse(ctx context.Context, params *GroupServiceRemoveServiceAccountFromGroupParams, reqEditors ...RequestEditorFn) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceSetDomainNameserversResponse) GetJSON200() *V1RegisteredDomain { + return r.JSON200 +} - // MetricsCredentialServiceListMetricsWriteCredentialsWithResponse performs a GET /v1/metrics-write-credentials (the `MetricsCredentialServiceListMetricsWriteCredentials` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - MetricsCredentialServiceListMetricsWriteCredentialsWithResponse(ctx context.Context, params *MetricsCredentialServiceListMetricsWriteCredentialsParams, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceSetDomainNameserversResponse) GetBody() []byte { + return r.Body +} - // MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceSetDomainNameserversResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse(ctx context.Context, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceSetDomainNameserversResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RegisteredDomainServiceSetDomainNameserversResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse(ctx context.Context, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) +type RegisteredDomainServiceRenewDomainResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1DomainOrder +} - // OrganizationServiceGetOrganizationWithResponse performs a GET /v1/organization (the `OrganizationServiceGetOrganization` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - OrganizationServiceGetOrganizationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrganizationServiceGetOrganizationResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RegisteredDomainServiceRenewDomainResponse) GetJSON200() *V1DomainOrder { + return r.JSON200 +} - // OrganizationServiceListOrganizationsWithResponse performs a GET /v1/organizations (the `OrganizationServiceListOrganizations` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - OrganizationServiceListOrganizationsWithResponse(ctx context.Context, params *OrganizationServiceListOrganizationsParams, reqEditors ...RequestEditorFn) (*OrganizationServiceListOrganizationsResponse, error) +// GetBody returns the raw response body bytes +func (r RegisteredDomainServiceRenewDomainResponse) GetBody() []byte { + return r.Body +} - // MetadataServiceGetPlatformVersionsWithResponse performs a GET /v1/platform-versions (the `MetadataServiceGetPlatformVersions` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - MetadataServiceGetPlatformVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MetadataServiceGetPlatformVersionsResponse, error) +// Status returns HTTPResponse.Status +func (r RegisteredDomainServiceRenewDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r RegisteredDomainServiceRenewDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // RoleServiceReplaceRoleForServiceAccountWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - RoleServiceReplaceRoleForServiceAccountWithResponse(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RegisteredDomainServiceRenewDomainResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // ServiceAccountServiceListServiceAccountsWithResponse performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceListServiceAccountsWithResponse(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListServiceAccountsResponse, error) +type DomainOrderServiceCreateDomainOrderResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1DomainOrder +} - // ServiceAccountServiceCreateServiceAccountWithBodyWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceCreateServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DomainOrderServiceCreateDomainOrderResponse) GetJSON200() *V1DomainOrder { + return r.JSON200 +} - // ServiceAccountServiceCreateServiceAccountWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - ServiceAccountServiceCreateServiceAccountWithResponse(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) +// GetBody returns the raw response body bytes +func (r DomainOrderServiceCreateDomainOrderResponse) GetBody() []byte { + return r.Body +} - // ServiceAccountServiceRevokeTokenWithResponse performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceRevokeTokenWithResponse(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceRevokeTokenResponse, error) +// Status returns HTTPResponse.Status +func (r DomainOrderServiceCreateDomainOrderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ServiceAccountServiceDeleteServiceAccountWithResponse performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceDeleteServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceDeleteServiceAccountResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r DomainOrderServiceCreateDomainOrderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ServiceAccountServiceGetServiceAccountWithResponse performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceGetServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGetServiceAccountResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DomainOrderServiceCreateDomainOrderResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) +type DomainOrderServiceGetDomainOrderResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *V1DomainOrder +} - // ServiceAccountServiceUpdateServiceAccountWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - ServiceAccountServiceUpdateServiceAccountWithResponse(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r DomainOrderServiceGetDomainOrderResponse) GetJSON200() *V1DomainOrder { + return r.JSON200 +} - // ServiceAccountServiceListTokensWithResponse performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceListTokensWithResponse(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListTokensResponse, error) +// GetBody returns the raw response body bytes +func (r DomainOrderServiceGetDomainOrderResponse) GetBody() []byte { + return r.Body +} - // ServiceAccountServiceGenerateTokenWithBodyWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, - // with any type of body and a specified content type. - // - // Returns a wrapper object for the known response body format(s). - ServiceAccountServiceGenerateTokenWithBodyWithResponse(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) +// Status returns HTTPResponse.Status +func (r DomainOrderServiceGetDomainOrderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DomainOrderServiceGetDomainOrderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ServiceAccountServiceGenerateTokenWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - ServiceAccountServiceGenerateTokenWithResponse(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DomainOrderServiceGetDomainOrderResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" } -type AgentServiceListAgentsResponse struct { +type DomainOrderServiceCheckoutDomainOrderResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ListAgentsResponse + JSON200 *V1CheckoutDomainOrderResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceListAgentsResponse) GetJSON200() *V1ListAgentsResponse { +func (r DomainOrderServiceCheckoutDomainOrderResponse) GetJSON200() *V1CheckoutDomainOrderResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceListAgentsResponse) GetBody() []byte { +func (r DomainOrderServiceCheckoutDomainOrderResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceListAgentsResponse) Status() string { +func (r DomainOrderServiceCheckoutDomainOrderResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2122,7 +4661,7 @@ func (r AgentServiceListAgentsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceListAgentsResponse) StatusCode() int { +func (r DomainOrderServiceCheckoutDomainOrderResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2130,32 +4669,32 @@ func (r AgentServiceListAgentsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceListAgentsResponse) ContentType() string { +func (r DomainOrderServiceCheckoutDomainOrderResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceCreateAgentResponse struct { +type DomainOrderServicePriceDomainOrderResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1GetAgentResponse + JSON200 *V1DomainOrderQuote } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceCreateAgentResponse) GetJSON200() *V1GetAgentResponse { +func (r DomainOrderServicePriceDomainOrderResponse) GetJSON200() *V1DomainOrderQuote { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceCreateAgentResponse) GetBody() []byte { +func (r DomainOrderServicePriceDomainOrderResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceCreateAgentResponse) Status() string { +func (r DomainOrderServicePriceDomainOrderResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2163,7 +4702,7 @@ func (r AgentServiceCreateAgentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceCreateAgentResponse) StatusCode() int { +func (r DomainOrderServicePriceDomainOrderResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2171,32 +4710,32 @@ func (r AgentServiceCreateAgentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceCreateAgentResponse) ContentType() string { +func (r DomainOrderServicePriceDomainOrderResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceDeleteAgentResponse struct { +type DomainSearchServiceSearchDomainsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1SuccessResponse + JSON200 *V1SearchDomainsResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceDeleteAgentResponse) GetJSON200() *V1SuccessResponse { +func (r DomainSearchServiceSearchDomainsResponse) GetJSON200() *V1SearchDomainsResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceDeleteAgentResponse) GetBody() []byte { +func (r DomainSearchServiceSearchDomainsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceDeleteAgentResponse) Status() string { +func (r DomainSearchServiceSearchDomainsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2204,7 +4743,7 @@ func (r AgentServiceDeleteAgentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceDeleteAgentResponse) StatusCode() int { +func (r DomainSearchServiceSearchDomainsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2212,32 +4751,32 @@ func (r AgentServiceDeleteAgentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceDeleteAgentResponse) ContentType() string { +func (r DomainSearchServiceSearchDomainsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceGetAgentResponse struct { +type DomainSearchServiceCheckTransferResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1GetAgentResponse + JSON200 *V1CheckTransferResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceGetAgentResponse) GetJSON200() *V1GetAgentResponse { +func (r DomainSearchServiceCheckTransferResponse) GetJSON200() *V1CheckTransferResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceGetAgentResponse) GetBody() []byte { +func (r DomainSearchServiceCheckTransferResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceGetAgentResponse) Status() string { +func (r DomainSearchServiceCheckTransferResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2245,7 +4784,7 @@ func (r AgentServiceGetAgentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceGetAgentResponse) StatusCode() int { +func (r DomainSearchServiceCheckTransferResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2253,32 +4792,32 @@ func (r AgentServiceGetAgentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceGetAgentResponse) ContentType() string { +func (r DomainSearchServiceCheckTransferResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceUpdateAgentResponse struct { +type RoleServiceReplaceRoleForServiceAccountResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1UpdateAgentResponse + JSON200 *V1SuccessResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceUpdateAgentResponse) GetJSON200() *V1UpdateAgentResponse { +func (r RoleServiceReplaceRoleForServiceAccountResponse) GetJSON200() *V1SuccessResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceUpdateAgentResponse) GetBody() []byte { +func (r RoleServiceReplaceRoleForServiceAccountResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceUpdateAgentResponse) Status() string { +func (r RoleServiceReplaceRoleForServiceAccountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2286,7 +4825,7 @@ func (r AgentServiceUpdateAgentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceUpdateAgentResponse) StatusCode() int { +func (r RoleServiceReplaceRoleForServiceAccountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2294,32 +4833,32 @@ func (r AgentServiceUpdateAgentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceUpdateAgentResponse) ContentType() string { +func (r RoleServiceReplaceRoleForServiceAccountResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceGeneratePeeringConfigResponse struct { +type ServiceAccountServiceListServiceAccountsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1GeneratePeeringConfigResponse + JSON200 *V1ListServiceAccountsResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceGeneratePeeringConfigResponse) GetJSON200() *V1GeneratePeeringConfigResponse { +func (r ServiceAccountServiceListServiceAccountsResponse) GetJSON200() *V1ListServiceAccountsResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceGeneratePeeringConfigResponse) GetBody() []byte { +func (r ServiceAccountServiceListServiceAccountsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceGeneratePeeringConfigResponse) Status() string { +func (r ServiceAccountServiceListServiceAccountsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2327,7 +4866,7 @@ func (r AgentServiceGeneratePeeringConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceGeneratePeeringConfigResponse) StatusCode() int { +func (r ServiceAccountServiceListServiceAccountsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2335,32 +4874,32 @@ func (r AgentServiceGeneratePeeringConfigResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceGeneratePeeringConfigResponse) ContentType() string { +func (r ServiceAccountServiceListServiceAccountsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AgentServiceUploadInboundPeeringConfigResponse struct { +type ServiceAccountServiceCreateServiceAccountResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1UploadInboundPeeringConfigResponse + JSON200 *V1ServiceAccountResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r AgentServiceUploadInboundPeeringConfigResponse) GetJSON200() *V1UploadInboundPeeringConfigResponse { +func (r ServiceAccountServiceCreateServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r AgentServiceUploadInboundPeeringConfigResponse) GetBody() []byte { +func (r ServiceAccountServiceCreateServiceAccountResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AgentServiceUploadInboundPeeringConfigResponse) Status() string { +func (r ServiceAccountServiceCreateServiceAccountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2368,7 +4907,7 @@ func (r AgentServiceUploadInboundPeeringConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AgentServiceUploadInboundPeeringConfigResponse) StatusCode() int { +func (r ServiceAccountServiceCreateServiceAccountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2376,32 +4915,32 @@ func (r AgentServiceUploadInboundPeeringConfigResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AgentServiceUploadInboundPeeringConfigResponse) ContentType() string { +func (r ServiceAccountServiceCreateServiceAccountResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GroupServiceAddServiceAccountToGroupResponse struct { +type ServiceAccountServiceRevokeTokenResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1SuccessResponse + JSON200 *map[string]interface{} } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GroupServiceAddServiceAccountToGroupResponse) GetJSON200() *V1SuccessResponse { +func (r ServiceAccountServiceRevokeTokenResponse) GetJSON200() *map[string]interface{} { return r.JSON200 } // GetBody returns the raw response body bytes -func (r GroupServiceAddServiceAccountToGroupResponse) GetBody() []byte { +func (r ServiceAccountServiceRevokeTokenResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GroupServiceAddServiceAccountToGroupResponse) Status() string { +func (r ServiceAccountServiceRevokeTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2409,7 +4948,7 @@ func (r GroupServiceAddServiceAccountToGroupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GroupServiceAddServiceAccountToGroupResponse) StatusCode() int { +func (r ServiceAccountServiceRevokeTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2417,32 +4956,32 @@ func (r GroupServiceAddServiceAccountToGroupResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GroupServiceAddServiceAccountToGroupResponse) ContentType() string { +func (r ServiceAccountServiceRevokeTokenResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GroupServiceRemoveServiceAccountFromGroupResponse struct { +type ServiceAccountServiceDeleteServiceAccountResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1SuccessResponse + JSON200 *map[string]interface{} } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GroupServiceRemoveServiceAccountFromGroupResponse) GetJSON200() *V1SuccessResponse { +func (r ServiceAccountServiceDeleteServiceAccountResponse) GetJSON200() *map[string]interface{} { return r.JSON200 } // GetBody returns the raw response body bytes -func (r GroupServiceRemoveServiceAccountFromGroupResponse) GetBody() []byte { +func (r ServiceAccountServiceDeleteServiceAccountResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GroupServiceRemoveServiceAccountFromGroupResponse) Status() string { +func (r ServiceAccountServiceDeleteServiceAccountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2450,7 +4989,7 @@ func (r GroupServiceRemoveServiceAccountFromGroupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GroupServiceRemoveServiceAccountFromGroupResponse) StatusCode() int { +func (r ServiceAccountServiceDeleteServiceAccountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2458,32 +4997,32 @@ func (r GroupServiceRemoveServiceAccountFromGroupResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GroupServiceRemoveServiceAccountFromGroupResponse) ContentType() string { +func (r ServiceAccountServiceDeleteServiceAccountResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type MetricsCredentialServiceListMetricsWriteCredentialsResponse struct { +type ServiceAccountServiceGetServiceAccountResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ListMetricsWriteCredentialsResponse + JSON200 *V1ServiceAccountResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) GetJSON200() *V1ListMetricsWriteCredentialsResponse { +func (r ServiceAccountServiceGetServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) GetBody() []byte { +func (r ServiceAccountServiceGetServiceAccountResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) Status() string { +func (r ServiceAccountServiceGetServiceAccountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2491,7 +5030,7 @@ func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) Status() st } // StatusCode returns HTTPResponse.StatusCode -func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) StatusCode() int { +func (r ServiceAccountServiceGetServiceAccountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2499,32 +5038,32 @@ func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) StatusCode( } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r MetricsCredentialServiceListMetricsWriteCredentialsResponse) ContentType() string { +func (r ServiceAccountServiceGetServiceAccountResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type MetricsCredentialServiceCreateMetricsWriteCredentialResponse struct { +type ServiceAccountServiceUpdateServiceAccountResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1CreateMetricsWriteCredentialResponse + JSON200 *V1ServiceAccountResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) GetJSON200() *V1CreateMetricsWriteCredentialResponse { +func (r ServiceAccountServiceUpdateServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) GetBody() []byte { +func (r ServiceAccountServiceUpdateServiceAccountResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) Status() string { +func (r ServiceAccountServiceUpdateServiceAccountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2532,7 +5071,7 @@ func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) Status() s } // StatusCode returns HTTPResponse.StatusCode -func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) StatusCode() int { +func (r ServiceAccountServiceUpdateServiceAccountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2540,32 +5079,32 @@ func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) StatusCode } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r MetricsCredentialServiceCreateMetricsWriteCredentialResponse) ContentType() string { +func (r ServiceAccountServiceUpdateServiceAccountResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type MetricsCredentialServiceRotateMetricsWriteCredentialResponse struct { +type ServiceAccountServiceListTokensResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1CreateMetricsWriteCredentialResponse + JSON200 *V1ListServiceAccountTokensResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) GetJSON200() *V1CreateMetricsWriteCredentialResponse { +func (r ServiceAccountServiceListTokensResponse) GetJSON200() *V1ListServiceAccountTokensResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) GetBody() []byte { +func (r ServiceAccountServiceListTokensResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) Status() string { +func (r ServiceAccountServiceListTokensResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2573,7 +5112,7 @@ func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) Status() s } // StatusCode returns HTTPResponse.StatusCode -func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) StatusCode() int { +func (r ServiceAccountServiceListTokensResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -2581,32 +5120,32 @@ func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) StatusCode } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r MetricsCredentialServiceRotateMetricsWriteCredentialResponse) ContentType() string { +func (r ServiceAccountServiceListTokensResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type OrganizationServiceGetOrganizationResponse struct { +type ServiceAccountServiceGenerateTokenResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1GetOrganizationResponse + JSON200 *V1GenerateServiceAccountTokenResponse } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r OrganizationServiceGetOrganizationResponse) GetJSON200() *V1GetOrganizationResponse { +func (r ServiceAccountServiceGenerateTokenResponse) GetJSON200() *V1GenerateServiceAccountTokenResponse { return r.JSON200 } // GetBody returns the raw response body bytes -func (r OrganizationServiceGetOrganizationResponse) GetBody() []byte { +func (r ServiceAccountServiceGenerateTokenResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r OrganizationServiceGetOrganizationResponse) Status() string { +func (r ServiceAccountServiceGenerateTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2614,873 +5153,1146 @@ func (r OrganizationServiceGetOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r OrganizationServiceGetOrganizationResponse) StatusCode() int { +func (r ServiceAccountServiceGenerateTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } - return 0 + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ServiceAccountServiceGenerateTokenResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// AgentServiceListAgentsWithResponse performs a GET /v1/agents (the `AgentServiceListAgents` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceListAgentsWithResponse(ctx context.Context, params *AgentServiceListAgentsParams, reqEditors ...RequestEditorFn) (*AgentServiceListAgentsResponse, error) { + rsp, err := c.AgentServiceListAgents(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceListAgentsResponse(rsp) +} + +// AgentServiceCreateAgentWithBodyWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceCreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) { + rsp, err := c.AgentServiceCreateAgentWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceCreateAgentResponse(rsp) +} + +// AgentServiceCreateAgentWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceCreateAgentWithResponse(ctx context.Context, body AgentServiceCreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) { + rsp, err := c.AgentServiceCreateAgent(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceCreateAgentResponse(rsp) +} + +// AgentServiceDeleteAgentWithResponse performs a DELETE /v1/agents/{id} (the `AgentServiceDeleteAgent` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceDeleteAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceDeleteAgentResponse, error) { + rsp, err := c.AgentServiceDeleteAgent(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceDeleteAgentResponse(rsp) +} + +// AgentServiceGetAgentWithResponse performs a GET /v1/agents/{id} (the `AgentServiceGetAgent` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceGetAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceGetAgentResponse, error) { + rsp, err := c.AgentServiceGetAgent(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceGetAgentResponse(rsp) +} + +// AgentServiceUpdateAgentWithBodyWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceUpdateAgentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) { + rsp, err := c.AgentServiceUpdateAgentWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceUpdateAgentResponse(rsp) +} + +// AgentServiceUpdateAgentWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceUpdateAgentWithResponse(ctx context.Context, id string, body AgentServiceUpdateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) { + rsp, err := c.AgentServiceUpdateAgent(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceUpdateAgentResponse(rsp) +} + +// AgentServiceGeneratePeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceGeneratePeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) { + rsp, err := c.AgentServiceGeneratePeeringConfigWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceGeneratePeeringConfigResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r OrganizationServiceGetOrganizationResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// AgentServiceGeneratePeeringConfigWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceGeneratePeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) { + rsp, err := c.AgentServiceGeneratePeeringConfig(ctx, id, body, reqEditors...) + if err != nil { + return nil, err } - return "" -} - -type OrganizationServiceListOrganizationsResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ListOrganizationsResponse + return ParseAgentServiceGeneratePeeringConfigResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r OrganizationServiceListOrganizationsResponse) GetJSON200() *V1ListOrganizationsResponse { - return r.JSON200 +// AgentServiceUploadInboundPeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceUploadInboundPeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) { + rsp, err := c.AgentServiceUploadInboundPeeringConfigWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceUploadInboundPeeringConfigResponse(rsp) } -// GetBody returns the raw response body bytes -func (r OrganizationServiceListOrganizationsResponse) GetBody() []byte { - return r.Body +// AgentServiceUploadInboundPeeringConfigWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) AgentServiceUploadInboundPeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) { + rsp, err := c.AgentServiceUploadInboundPeeringConfig(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAgentServiceUploadInboundPeeringConfigResponse(rsp) } -// Status returns HTTPResponse.Status -func (r OrganizationServiceListOrganizationsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GroupServiceAddServiceAccountToGroupWithBodyWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) GroupServiceAddServiceAccountToGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) { + rsp, err := c.GroupServiceAddServiceAccountToGroupWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGroupServiceAddServiceAccountToGroupResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r OrganizationServiceListOrganizationsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GroupServiceAddServiceAccountToGroupWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) GroupServiceAddServiceAccountToGroupWithResponse(ctx context.Context, body GroupServiceAddServiceAccountToGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) { + rsp, err := c.GroupServiceAddServiceAccountToGroup(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGroupServiceAddServiceAccountToGroupResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r OrganizationServiceListOrganizationsResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// GroupServiceRemoveServiceAccountFromGroupWithResponse performs a DELETE /v1/groups/remove-service-account (the `GroupServiceRemoveServiceAccountFromGroup` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) GroupServiceRemoveServiceAccountFromGroupWithResponse(ctx context.Context, params *GroupServiceRemoveServiceAccountFromGroupParams, reqEditors ...RequestEditorFn) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) { + rsp, err := c.GroupServiceRemoveServiceAccountFromGroup(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseGroupServiceRemoveServiceAccountFromGroupResponse(rsp) } -type MetadataServiceGetPlatformVersionsResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1PlatformVersions +// MetricsCredentialServiceListMetricsWriteCredentialsWithResponse performs a GET /v1/metrics-write-credentials (the `MetricsCredentialServiceListMetricsWriteCredentials` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetricsCredentialServiceListMetricsWriteCredentialsWithResponse(ctx context.Context, params *MetricsCredentialServiceListMetricsWriteCredentialsParams, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) { + rsp, err := c.MetricsCredentialServiceListMetricsWriteCredentials(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r MetadataServiceGetPlatformVersionsResponse) GetJSON200() *V1PlatformVersions { - return r.JSON200 +// MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { + rsp, err := c.MetricsCredentialServiceCreateMetricsWriteCredentialWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp) } -// GetBody returns the raw response body bytes -func (r MetadataServiceGetPlatformVersionsResponse) GetBody() []byte { - return r.Body +// MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse(ctx context.Context, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { + rsp, err := c.MetricsCredentialServiceCreateMetricsWriteCredential(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp) } -// Status returns HTTPResponse.Status -func (r MetadataServiceGetPlatformVersionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { + rsp, err := c.MetricsCredentialServiceRotateMetricsWriteCredentialWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r MetadataServiceGetPlatformVersionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse(ctx context.Context, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { + rsp, err := c.MetricsCredentialServiceRotateMetricsWriteCredential(ctx, id, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r MetadataServiceGetPlatformVersionsResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// OrganizationServiceGetOrganizationWithResponse performs a GET /v1/organization (the `OrganizationServiceGetOrganization` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) OrganizationServiceGetOrganizationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrganizationServiceGetOrganizationResponse, error) { + rsp, err := c.OrganizationServiceGetOrganization(ctx, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseOrganizationServiceGetOrganizationResponse(rsp) } -type RoleServiceReplaceRoleForServiceAccountResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1SuccessResponse +// OrganizationServiceListOrganizationsWithResponse performs a GET /v1/organizations (the `OrganizationServiceListOrganizations` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) OrganizationServiceListOrganizationsWithResponse(ctx context.Context, params *OrganizationServiceListOrganizationsParams, reqEditors ...RequestEditorFn) (*OrganizationServiceListOrganizationsResponse, error) { + rsp, err := c.OrganizationServiceListOrganizations(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseOrganizationServiceListOrganizationsResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r RoleServiceReplaceRoleForServiceAccountResponse) GetJSON200() *V1SuccessResponse { - return r.JSON200 +// MetadataServiceGetPlatformVersionsWithResponse performs a GET /v1/platform-versions (the `MetadataServiceGetPlatformVersions` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) MetadataServiceGetPlatformVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MetadataServiceGetPlatformVersionsResponse, error) { + rsp, err := c.MetadataServiceGetPlatformVersions(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseMetadataServiceGetPlatformVersionsResponse(rsp) } -// GetBody returns the raw response body bytes -func (r RoleServiceReplaceRoleForServiceAccountResponse) GetBody() []byte { - return r.Body +// DomainSearchServiceCheckDomainsWithBodyWithResponse performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceCheckDomainsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckDomainsResponse, error) { + rsp, err := c.DomainSearchServiceCheckDomainsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainSearchServiceCheckDomainsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r RoleServiceReplaceRoleForServiceAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DomainSearchServiceCheckDomainsWithResponse performs a POST /v1/registrar/check (the `DomainSearchServiceCheckDomains` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceCheckDomainsWithResponse(ctx context.Context, body DomainSearchServiceCheckDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckDomainsResponse, error) { + rsp, err := c.DomainSearchServiceCheckDomains(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDomainSearchServiceCheckDomainsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r RoleServiceReplaceRoleForServiceAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DomainContactServiceListDomainContactsWithResponse performs a GET /v1/registrar/contacts (the `DomainContactServiceListDomainContacts` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainContactServiceListDomainContactsWithResponse(ctx context.Context, params *DomainContactServiceListDomainContactsParams, reqEditors ...RequestEditorFn) (*DomainContactServiceListDomainContactsResponse, error) { + rsp, err := c.DomainContactServiceListDomainContacts(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDomainContactServiceListDomainContactsResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r RoleServiceReplaceRoleForServiceAccountResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// RegisteredDomainServiceListRegisteredDomainsWithResponse performs a GET /v1/registrar/domains (the `RegisteredDomainServiceListRegisteredDomains` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceListRegisteredDomainsWithResponse(ctx context.Context, params *RegisteredDomainServiceListRegisteredDomainsParams, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceListRegisteredDomainsResponse, error) { + rsp, err := c.RegisteredDomainServiceListRegisteredDomains(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseRegisteredDomainServiceListRegisteredDomainsResponse(rsp) } -type ServiceAccountServiceListServiceAccountsResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ListServiceAccountsResponse +// RegisteredDomainServiceGetRegisteredDomainWithResponse performs a GET /v1/registrar/domains/{name} (the `RegisteredDomainServiceGetRegisteredDomain` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceGetRegisteredDomainWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetRegisteredDomainResponse, error) { + rsp, err := c.RegisteredDomainServiceGetRegisteredDomain(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceGetRegisteredDomainResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceListServiceAccountsResponse) GetJSON200() *V1ListServiceAccountsResponse { - return r.JSON200 +// RegisteredDomainServiceGetDomainAuthCodeWithBodyWithResponse performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceGetDomainAuthCodeWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetDomainAuthCodeResponse, error) { + rsp, err := c.RegisteredDomainServiceGetDomainAuthCodeWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceGetDomainAuthCodeResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceListServiceAccountsResponse) GetBody() []byte { - return r.Body +// RegisteredDomainServiceGetDomainAuthCodeWithResponse performs a POST /v1/registrar/domains/{name}/auth-code (the `RegisteredDomainServiceGetDomainAuthCode` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceGetDomainAuthCodeWithResponse(ctx context.Context, name string, body RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceGetDomainAuthCodeResponse, error) { + rsp, err := c.RegisteredDomainServiceGetDomainAuthCode(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceGetDomainAuthCodeResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceListServiceAccountsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// RegisteredDomainServiceSetDomainAutoRenewWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainAutoRenewWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainAutoRenewResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainAutoRenewWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseRegisteredDomainServiceSetDomainAutoRenewResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceListServiceAccountsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// RegisteredDomainServiceSetDomainAutoRenewWithResponse performs a PUT /v1/registrar/domains/{name}/auto-renew (the `RegisteredDomainServiceSetDomainAutoRenew` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainAutoRenewWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainAutoRenewResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainAutoRenew(ctx, name, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseRegisteredDomainServiceSetDomainAutoRenewResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceListServiceAccountsResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// RegisteredDomainServiceSetDomainDnssecWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainDnssecWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainDnssecResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainDnssecWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseRegisteredDomainServiceSetDomainDnssecResponse(rsp) } -type ServiceAccountServiceCreateServiceAccountResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ServiceAccountResponse +// RegisteredDomainServiceSetDomainDnssecWithResponse performs a PUT /v1/registrar/domains/{name}/dnssec (the `RegisteredDomainServiceSetDomainDnssec` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainDnssecWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainDnssecJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainDnssecResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainDnssec(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceSetDomainDnssecResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceCreateServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { - return r.JSON200 +// RegisteredDomainServiceSetDomainTransferLockWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainTransferLockWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainTransferLockResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainTransferLockWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceSetDomainTransferLockResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceCreateServiceAccountResponse) GetBody() []byte { - return r.Body +// RegisteredDomainServiceSetDomainTransferLockWithResponse performs a PUT /v1/registrar/domains/{name}/lock (the `RegisteredDomainServiceSetDomainTransferLock` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainTransferLockWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainTransferLockJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainTransferLockResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainTransferLock(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceSetDomainTransferLockResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceCreateServiceAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// RegisteredDomainServiceSetDomainNameserversWithBodyWithResponse performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainNameserversWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainNameserversResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainNameserversWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseRegisteredDomainServiceSetDomainNameserversResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceCreateServiceAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// RegisteredDomainServiceSetDomainNameserversWithResponse performs a PUT /v1/registrar/domains/{name}/nameservers (the `RegisteredDomainServiceSetDomainNameservers` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceSetDomainNameserversWithResponse(ctx context.Context, name string, body RegisteredDomainServiceSetDomainNameserversJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceSetDomainNameserversResponse, error) { + rsp, err := c.RegisteredDomainServiceSetDomainNameservers(ctx, name, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseRegisteredDomainServiceSetDomainNameserversResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceCreateServiceAccountResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// RegisteredDomainServiceRenewDomainWithBodyWithResponse performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceRenewDomainWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceRenewDomainResponse, error) { + rsp, err := c.RegisteredDomainServiceRenewDomainWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseRegisteredDomainServiceRenewDomainResponse(rsp) } -type ServiceAccountServiceRevokeTokenResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *map[string]interface{} +// RegisteredDomainServiceRenewDomainWithResponse performs a POST /v1/registrar/domains/{name}/renew (the `RegisteredDomainServiceRenewDomain` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RegisteredDomainServiceRenewDomainWithResponse(ctx context.Context, name string, body RegisteredDomainServiceRenewDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*RegisteredDomainServiceRenewDomainResponse, error) { + rsp, err := c.RegisteredDomainServiceRenewDomain(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRegisteredDomainServiceRenewDomainResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceRevokeTokenResponse) GetJSON200() *map[string]interface{} { - return r.JSON200 +// DomainOrderServiceCreateDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServiceCreateDomainOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServiceCreateDomainOrderResponse, error) { + rsp, err := c.DomainOrderServiceCreateDomainOrderWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainOrderServiceCreateDomainOrderResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceRevokeTokenResponse) GetBody() []byte { - return r.Body +// DomainOrderServiceCreateDomainOrderWithResponse performs a POST /v1/registrar/orders (the `DomainOrderServiceCreateDomainOrder` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServiceCreateDomainOrderWithResponse(ctx context.Context, body DomainOrderServiceCreateDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServiceCreateDomainOrderResponse, error) { + rsp, err := c.DomainOrderServiceCreateDomainOrder(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainOrderServiceCreateDomainOrderResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceRevokeTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DomainOrderServiceGetDomainOrderWithResponse performs a GET /v1/registrar/orders/{id} (the `DomainOrderServiceGetDomainOrder` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServiceGetDomainOrderWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DomainOrderServiceGetDomainOrderResponse, error) { + rsp, err := c.DomainOrderServiceGetDomainOrder(ctx, id, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDomainOrderServiceGetDomainOrderResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceRevokeTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DomainOrderServiceCheckoutDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServiceCheckoutDomainOrderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServiceCheckoutDomainOrderResponse, error) { + rsp, err := c.DomainOrderServiceCheckoutDomainOrderWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDomainOrderServiceCheckoutDomainOrderResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceRevokeTokenResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// DomainOrderServiceCheckoutDomainOrderWithResponse performs a POST /v1/registrar/orders/{id}/checkout (the `DomainOrderServiceCheckoutDomainOrder` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServiceCheckoutDomainOrderWithResponse(ctx context.Context, id string, body DomainOrderServiceCheckoutDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServiceCheckoutDomainOrderResponse, error) { + rsp, err := c.DomainOrderServiceCheckoutDomainOrder(ctx, id, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseDomainOrderServiceCheckoutDomainOrderResponse(rsp) } -type ServiceAccountServiceDeleteServiceAccountResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *map[string]interface{} +// DomainOrderServicePriceDomainOrderWithBodyWithResponse performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServicePriceDomainOrderWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainOrderServicePriceDomainOrderResponse, error) { + rsp, err := c.DomainOrderServicePriceDomainOrderWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainOrderServicePriceDomainOrderResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceDeleteServiceAccountResponse) GetJSON200() *map[string]interface{} { - return r.JSON200 +// DomainOrderServicePriceDomainOrderWithResponse performs a POST /v1/registrar/orders/{id}/price (the `DomainOrderServicePriceDomainOrder` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainOrderServicePriceDomainOrderWithResponse(ctx context.Context, id string, body DomainOrderServicePriceDomainOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainOrderServicePriceDomainOrderResponse, error) { + rsp, err := c.DomainOrderServicePriceDomainOrder(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainOrderServicePriceDomainOrderResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceDeleteServiceAccountResponse) GetBody() []byte { - return r.Body +// DomainSearchServiceSearchDomainsWithBodyWithResponse performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceSearchDomainsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceSearchDomainsResponse, error) { + rsp, err := c.DomainSearchServiceSearchDomainsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDomainSearchServiceSearchDomainsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceDeleteServiceAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DomainSearchServiceSearchDomainsWithResponse performs a POST /v1/registrar/search (the `DomainSearchServiceSearchDomains` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceSearchDomainsWithResponse(ctx context.Context, body DomainSearchServiceSearchDomainsJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceSearchDomainsResponse, error) { + rsp, err := c.DomainSearchServiceSearchDomains(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDomainSearchServiceSearchDomainsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceDeleteServiceAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DomainSearchServiceCheckTransferWithBodyWithResponse performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceCheckTransferWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckTransferResponse, error) { + rsp, err := c.DomainSearchServiceCheckTransferWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDomainSearchServiceCheckTransferResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceDeleteServiceAccountResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// DomainSearchServiceCheckTransferWithResponse performs a POST /v1/registrar/transfer-check (the `DomainSearchServiceCheckTransfer` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) DomainSearchServiceCheckTransferWithResponse(ctx context.Context, body DomainSearchServiceCheckTransferJSONRequestBody, reqEditors ...RequestEditorFn) (*DomainSearchServiceCheckTransferResponse, error) { + rsp, err := c.DomainSearchServiceCheckTransfer(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseDomainSearchServiceCheckTransferResponse(rsp) } -type ServiceAccountServiceGetServiceAccountResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ServiceAccountResponse +// RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) { + rsp, err := c.RoleServiceReplaceRoleForServiceAccountWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRoleServiceReplaceRoleForServiceAccountResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceGetServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { - return r.JSON200 +// RoleServiceReplaceRoleForServiceAccountWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) RoleServiceReplaceRoleForServiceAccountWithResponse(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) { + rsp, err := c.RoleServiceReplaceRoleForServiceAccount(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRoleServiceReplaceRoleForServiceAccountResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceGetServiceAccountResponse) GetBody() []byte { - return r.Body +// ServiceAccountServiceListServiceAccountsWithResponse performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceListServiceAccountsWithResponse(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListServiceAccountsResponse, error) { + rsp, err := c.ServiceAccountServiceListServiceAccounts(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseServiceAccountServiceListServiceAccountsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceGetServiceAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ServiceAccountServiceCreateServiceAccountWithBodyWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceCreateServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceCreateServiceAccountWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseServiceAccountServiceCreateServiceAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceGetServiceAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ServiceAccountServiceCreateServiceAccountWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceCreateServiceAccountWithResponse(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceCreateServiceAccount(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseServiceAccountServiceCreateServiceAccountResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceGetServiceAccountResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// ServiceAccountServiceRevokeTokenWithResponse performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceRevokeTokenWithResponse(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceRevokeTokenResponse, error) { + rsp, err := c.ServiceAccountServiceRevokeToken(ctx, tokenId, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseServiceAccountServiceRevokeTokenResponse(rsp) } -type ServiceAccountServiceUpdateServiceAccountResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ServiceAccountResponse +// ServiceAccountServiceDeleteServiceAccountWithResponse performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceDeleteServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceDeleteServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceDeleteServiceAccount(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseServiceAccountServiceDeleteServiceAccountResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceUpdateServiceAccountResponse) GetJSON200() *V1ServiceAccountResponse { - return r.JSON200 +// ServiceAccountServiceGetServiceAccountWithResponse performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceGetServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGetServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceGetServiceAccount(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseServiceAccountServiceGetServiceAccountResponse(rsp) } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceUpdateServiceAccountResponse) GetBody() []byte { - return r.Body +// ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceUpdateServiceAccountWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseServiceAccountServiceUpdateServiceAccountResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceUpdateServiceAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ServiceAccountServiceUpdateServiceAccountWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceUpdateServiceAccountWithResponse(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) { + rsp, err := c.ServiceAccountServiceUpdateServiceAccount(ctx, id, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseServiceAccountServiceUpdateServiceAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceUpdateServiceAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ServiceAccountServiceListTokensWithResponse performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceListTokensWithResponse(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListTokensResponse, error) { + rsp, err := c.ServiceAccountServiceListTokens(ctx, serviceAccountId, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseServiceAccountServiceListTokensResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceUpdateServiceAccountResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// ServiceAccountServiceGenerateTokenWithBodyWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceGenerateTokenWithBodyWithResponse(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) { + rsp, err := c.ServiceAccountServiceGenerateTokenWithBody(ctx, serviceAccountId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseServiceAccountServiceGenerateTokenResponse(rsp) } -type ServiceAccountServiceListTokensResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1ListServiceAccountTokensResponse +// ServiceAccountServiceGenerateTokenWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +func (c *ClientWithResponses) ServiceAccountServiceGenerateTokenWithResponse(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) { + rsp, err := c.ServiceAccountServiceGenerateToken(ctx, serviceAccountId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseServiceAccountServiceGenerateTokenResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceListTokensResponse) GetJSON200() *V1ListServiceAccountTokensResponse { - return r.JSON200 -} +// ParseAgentServiceListAgentsResponse parses an HTTP response from a AgentServiceListAgentsWithResponse call +func ParseAgentServiceListAgentsResponse(rsp *http.Response) (*AgentServiceListAgentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceListTokensResponse) GetBody() []byte { - return r.Body -} + response := &AgentServiceListAgentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ListAgentsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceListTokensResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) + + return response, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceListTokensResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ParseAgentServiceCreateAgentResponse parses an HTTP response from a AgentServiceCreateAgentWithResponse call +func ParseAgentServiceCreateAgentResponse(rsp *http.Response) (*AgentServiceCreateAgentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err } - return 0 -} -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceListTokensResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") + response := &AgentServiceCreateAgentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return "" -} -type ServiceAccountServiceGenerateTokenResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *V1GenerateServiceAccountTokenResponse -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1GetAgentResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ServiceAccountServiceGenerateTokenResponse) GetJSON200() *V1GenerateServiceAccountTokenResponse { - return r.JSON200 -} + } -// GetBody returns the raw response body bytes -func (r ServiceAccountServiceGenerateTokenResponse) GetBody() []byte { - return r.Body + return response, nil } -// Status returns HTTPResponse.Status -func (r ServiceAccountServiceGenerateTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ParseAgentServiceDeleteAgentResponse parses an HTTP response from a AgentServiceDeleteAgentWithResponse call +func ParseAgentServiceDeleteAgentResponse(rsp *http.Response) (*AgentServiceDeleteAgentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ServiceAccountServiceGenerateTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + response := &AgentServiceDeleteAgentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return 0 -} -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ServiceAccountServiceGenerateTokenResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1SuccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return "" + + return response, nil } -// AgentServiceListAgentsWithResponse performs a GET /v1/agents (the `AgentServiceListAgents` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceListAgentsWithResponse(ctx context.Context, params *AgentServiceListAgentsParams, reqEditors ...RequestEditorFn) (*AgentServiceListAgentsResponse, error) { - rsp, err := c.AgentServiceListAgents(ctx, params, reqEditors...) +// ParseAgentServiceGetAgentResponse parses an HTTP response from a AgentServiceGetAgentWithResponse call +func ParseAgentServiceGetAgentResponse(rsp *http.Response) (*AgentServiceGetAgentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAgentServiceListAgentsResponse(rsp) + + response := &AgentServiceGetAgentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1GetAgentResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// AgentServiceCreateAgentWithBodyWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceCreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) { - rsp, err := c.AgentServiceCreateAgentWithBody(ctx, contentType, body, reqEditors...) +// ParseAgentServiceUpdateAgentResponse parses an HTTP response from a AgentServiceUpdateAgentWithResponse call +func ParseAgentServiceUpdateAgentResponse(rsp *http.Response) (*AgentServiceUpdateAgentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAgentServiceCreateAgentResponse(rsp) -} -// AgentServiceCreateAgentWithResponse performs a POST /v1/agents (the `AgentServiceCreateAgent` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceCreateAgentWithResponse(ctx context.Context, body AgentServiceCreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceCreateAgentResponse, error) { - rsp, err := c.AgentServiceCreateAgent(ctx, body, reqEditors...) - if err != nil { - return nil, err + response := &AgentServiceUpdateAgentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1UpdateAgentResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseAgentServiceCreateAgentResponse(rsp) + + return response, nil } -// AgentServiceDeleteAgentWithResponse performs a DELETE /v1/agents/{id} (the `AgentServiceDeleteAgent` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceDeleteAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceDeleteAgentResponse, error) { - rsp, err := c.AgentServiceDeleteAgent(ctx, id, reqEditors...) +// ParseAgentServiceGeneratePeeringConfigResponse parses an HTTP response from a AgentServiceGeneratePeeringConfigWithResponse call +func ParseAgentServiceGeneratePeeringConfigResponse(rsp *http.Response) (*AgentServiceGeneratePeeringConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAgentServiceDeleteAgentResponse(rsp) -} -// AgentServiceGetAgentWithResponse performs a GET /v1/agents/{id} (the `AgentServiceGetAgent` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceGetAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*AgentServiceGetAgentResponse, error) { - rsp, err := c.AgentServiceGetAgent(ctx, id, reqEditors...) - if err != nil { - return nil, err + response := &AgentServiceGeneratePeeringConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseAgentServiceGetAgentResponse(rsp) -} -// AgentServiceUpdateAgentWithBodyWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceUpdateAgentWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) { - rsp, err := c.AgentServiceUpdateAgentWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1GeneratePeeringConfigResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseAgentServiceUpdateAgentResponse(rsp) + + return response, nil } -// AgentServiceUpdateAgentWithResponse performs a PATCH /v1/agents/{id} (the `AgentServiceUpdateAgent` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceUpdateAgentWithResponse(ctx context.Context, id string, body AgentServiceUpdateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUpdateAgentResponse, error) { - rsp, err := c.AgentServiceUpdateAgent(ctx, id, body, reqEditors...) +// ParseAgentServiceUploadInboundPeeringConfigResponse parses an HTTP response from a AgentServiceUploadInboundPeeringConfigWithResponse call +func ParseAgentServiceUploadInboundPeeringConfigResponse(rsp *http.Response) (*AgentServiceUploadInboundPeeringConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAgentServiceUpdateAgentResponse(rsp) -} -// AgentServiceGeneratePeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceGeneratePeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) { - rsp, err := c.AgentServiceGeneratePeeringConfigWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &AgentServiceUploadInboundPeeringConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseAgentServiceGeneratePeeringConfigResponse(rsp) -} -// AgentServiceGeneratePeeringConfigWithResponse performs a POST /v1/agents/{id}:generatePeeringConfig (the `AgentServiceGeneratePeeringConfig` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceGeneratePeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceGeneratePeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceGeneratePeeringConfigResponse, error) { - rsp, err := c.AgentServiceGeneratePeeringConfig(ctx, id, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1UploadInboundPeeringConfigResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseAgentServiceGeneratePeeringConfigResponse(rsp) + + return response, nil } -// AgentServiceUploadInboundPeeringConfigWithBodyWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceUploadInboundPeeringConfigWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) { - rsp, err := c.AgentServiceUploadInboundPeeringConfigWithBody(ctx, id, contentType, body, reqEditors...) +// ParseGroupServiceAddServiceAccountToGroupResponse parses an HTTP response from a GroupServiceAddServiceAccountToGroupWithResponse call +func ParseGroupServiceAddServiceAccountToGroupResponse(rsp *http.Response) (*GroupServiceAddServiceAccountToGroupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAgentServiceUploadInboundPeeringConfigResponse(rsp) -} -// AgentServiceUploadInboundPeeringConfigWithResponse performs a POST /v1/agents/{id}:uploadInboundPeeringConfig (the `AgentServiceUploadInboundPeeringConfig` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) AgentServiceUploadInboundPeeringConfigWithResponse(ctx context.Context, id string, body AgentServiceUploadInboundPeeringConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentServiceUploadInboundPeeringConfigResponse, error) { - rsp, err := c.AgentServiceUploadInboundPeeringConfig(ctx, id, body, reqEditors...) - if err != nil { - return nil, err + response := &GroupServiceAddServiceAccountToGroupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseAgentServiceUploadInboundPeeringConfigResponse(rsp) -} -// GroupServiceAddServiceAccountToGroupWithBodyWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) GroupServiceAddServiceAccountToGroupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) { - rsp, err := c.GroupServiceAddServiceAccountToGroupWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1SuccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseGroupServiceAddServiceAccountToGroupResponse(rsp) + + return response, nil } -// GroupServiceAddServiceAccountToGroupWithResponse performs a POST /v1/groups/add-service-account (the `GroupServiceAddServiceAccountToGroup` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) GroupServiceAddServiceAccountToGroupWithResponse(ctx context.Context, body GroupServiceAddServiceAccountToGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*GroupServiceAddServiceAccountToGroupResponse, error) { - rsp, err := c.GroupServiceAddServiceAccountToGroup(ctx, body, reqEditors...) +// ParseGroupServiceRemoveServiceAccountFromGroupResponse parses an HTTP response from a GroupServiceRemoveServiceAccountFromGroupWithResponse call +func ParseGroupServiceRemoveServiceAccountFromGroupResponse(rsp *http.Response) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGroupServiceAddServiceAccountToGroupResponse(rsp) -} -// GroupServiceRemoveServiceAccountFromGroupWithResponse performs a DELETE /v1/groups/remove-service-account (the `GroupServiceRemoveServiceAccountFromGroup` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) GroupServiceRemoveServiceAccountFromGroupWithResponse(ctx context.Context, params *GroupServiceRemoveServiceAccountFromGroupParams, reqEditors ...RequestEditorFn) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) { - rsp, err := c.GroupServiceRemoveServiceAccountFromGroup(ctx, params, reqEditors...) - if err != nil { - return nil, err + response := &GroupServiceRemoveServiceAccountFromGroupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGroupServiceRemoveServiceAccountFromGroupResponse(rsp) -} -// MetricsCredentialServiceListMetricsWriteCredentialsWithResponse performs a GET /v1/metrics-write-credentials (the `MetricsCredentialServiceListMetricsWriteCredentials` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetricsCredentialServiceListMetricsWriteCredentialsWithResponse(ctx context.Context, params *MetricsCredentialServiceListMetricsWriteCredentialsParams, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) { - rsp, err := c.MetricsCredentialServiceListMetricsWriteCredentials(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1SuccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse(rsp) + + return response, nil } -// MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetricsCredentialServiceCreateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { - rsp, err := c.MetricsCredentialServiceCreateMetricsWriteCredentialWithBody(ctx, contentType, body, reqEditors...) +// ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse parses an HTTP response from a MetricsCredentialServiceListMetricsWriteCredentialsWithResponse call +func ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse(rsp *http.Response) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp) -} -// MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials (the `MetricsCredentialServiceCreateMetricsWriteCredential` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse(ctx context.Context, body MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { - rsp, err := c.MetricsCredentialServiceCreateMetricsWriteCredential(ctx, body, reqEditors...) - if err != nil { - return nil, err + response := &MetricsCredentialServiceListMetricsWriteCredentialsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp) -} -// MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetricsCredentialServiceRotateMetricsWriteCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { - rsp, err := c.MetricsCredentialServiceRotateMetricsWriteCredentialWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ListMetricsWriteCredentialsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp) + + return response, nil } -// MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse performs a POST /v1/metrics-write-credentials/{id}:rotate (the `MetricsCredentialServiceRotateMetricsWriteCredential` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse(ctx context.Context, id string, body MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { - rsp, err := c.MetricsCredentialServiceRotateMetricsWriteCredential(ctx, id, body, reqEditors...) +// ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse parses an HTTP response from a MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse call +func ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp *http.Response) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp) -} -// OrganizationServiceGetOrganizationWithResponse performs a GET /v1/organization (the `OrganizationServiceGetOrganization` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) OrganizationServiceGetOrganizationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrganizationServiceGetOrganizationResponse, error) { - rsp, err := c.OrganizationServiceGetOrganization(ctx, reqEditors...) - if err != nil { - return nil, err + response := &MetricsCredentialServiceCreateMetricsWriteCredentialResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseOrganizationServiceGetOrganizationResponse(rsp) -} -// OrganizationServiceListOrganizationsWithResponse performs a GET /v1/organizations (the `OrganizationServiceListOrganizations` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) OrganizationServiceListOrganizationsWithResponse(ctx context.Context, params *OrganizationServiceListOrganizationsParams, reqEditors ...RequestEditorFn) (*OrganizationServiceListOrganizationsResponse, error) { - rsp, err := c.OrganizationServiceListOrganizations(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1CreateMetricsWriteCredentialResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseOrganizationServiceListOrganizationsResponse(rsp) + + return response, nil } -// MetadataServiceGetPlatformVersionsWithResponse performs a GET /v1/platform-versions (the `MetadataServiceGetPlatformVersions` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) MetadataServiceGetPlatformVersionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MetadataServiceGetPlatformVersionsResponse, error) { - rsp, err := c.MetadataServiceGetPlatformVersions(ctx, reqEditors...) +// ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse parses an HTTP response from a MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse call +func ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp *http.Response) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseMetadataServiceGetPlatformVersionsResponse(rsp) -} -// RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) RoleServiceReplaceRoleForServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) { - rsp, err := c.RoleServiceReplaceRoleForServiceAccountWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &MetricsCredentialServiceRotateMetricsWriteCredentialResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseRoleServiceReplaceRoleForServiceAccountResponse(rsp) -} -// RoleServiceReplaceRoleForServiceAccountWithResponse performs a PUT /v1/roles/replace-for-service-account (the `RoleServiceReplaceRoleForServiceAccount` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) RoleServiceReplaceRoleForServiceAccountWithResponse(ctx context.Context, body RoleServiceReplaceRoleForServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*RoleServiceReplaceRoleForServiceAccountResponse, error) { - rsp, err := c.RoleServiceReplaceRoleForServiceAccount(ctx, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1CreateMetricsWriteCredentialResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseRoleServiceReplaceRoleForServiceAccountResponse(rsp) + + return response, nil } -// ServiceAccountServiceListServiceAccountsWithResponse performs a GET /v1/service-accounts (the `ServiceAccountServiceListServiceAccounts` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceListServiceAccountsWithResponse(ctx context.Context, params *ServiceAccountServiceListServiceAccountsParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListServiceAccountsResponse, error) { - rsp, err := c.ServiceAccountServiceListServiceAccounts(ctx, params, reqEditors...) +// ParseOrganizationServiceGetOrganizationResponse parses an HTTP response from a OrganizationServiceGetOrganizationWithResponse call +func ParseOrganizationServiceGetOrganizationResponse(rsp *http.Response) (*OrganizationServiceGetOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseServiceAccountServiceListServiceAccountsResponse(rsp) -} -// ServiceAccountServiceCreateServiceAccountWithBodyWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceCreateServiceAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceCreateServiceAccountWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &OrganizationServiceGetOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseServiceAccountServiceCreateServiceAccountResponse(rsp) -} -// ServiceAccountServiceCreateServiceAccountWithResponse performs a POST /v1/service-accounts (the `ServiceAccountServiceCreateServiceAccount` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceCreateServiceAccountWithResponse(ctx context.Context, body ServiceAccountServiceCreateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceCreateServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceCreateServiceAccount(ctx, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1GetOrganizationResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseServiceAccountServiceCreateServiceAccountResponse(rsp) + + return response, nil } -// ServiceAccountServiceRevokeTokenWithResponse performs a DELETE /v1/service-accounts/tokens/{tokenId} (the `ServiceAccountServiceRevokeToken` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceRevokeTokenWithResponse(ctx context.Context, tokenId string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceRevokeTokenResponse, error) { - rsp, err := c.ServiceAccountServiceRevokeToken(ctx, tokenId, reqEditors...) +// ParseOrganizationServiceListOrganizationsResponse parses an HTTP response from a OrganizationServiceListOrganizationsWithResponse call +func ParseOrganizationServiceListOrganizationsResponse(rsp *http.Response) (*OrganizationServiceListOrganizationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseServiceAccountServiceRevokeTokenResponse(rsp) -} -// ServiceAccountServiceDeleteServiceAccountWithResponse performs a DELETE /v1/service-accounts/{id} (the `ServiceAccountServiceDeleteServiceAccount` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceDeleteServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceDeleteServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceDeleteServiceAccount(ctx, id, reqEditors...) - if err != nil { - return nil, err + response := &OrganizationServiceListOrganizationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseServiceAccountServiceDeleteServiceAccountResponse(rsp) -} -// ServiceAccountServiceGetServiceAccountWithResponse performs a GET /v1/service-accounts/{id} (the `ServiceAccountServiceGetServiceAccount` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceGetServiceAccountWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGetServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceGetServiceAccount(ctx, id, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ListOrganizationsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseServiceAccountServiceGetServiceAccountResponse(rsp) + + return response, nil } -// ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceUpdateServiceAccountWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceUpdateServiceAccountWithBody(ctx, id, contentType, body, reqEditors...) +// ParseMetadataServiceGetPlatformVersionsResponse parses an HTTP response from a MetadataServiceGetPlatformVersionsWithResponse call +func ParseMetadataServiceGetPlatformVersionsResponse(rsp *http.Response) (*MetadataServiceGetPlatformVersionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseServiceAccountServiceUpdateServiceAccountResponse(rsp) -} -// ServiceAccountServiceUpdateServiceAccountWithResponse performs a PATCH /v1/service-accounts/{id} (the `ServiceAccountServiceUpdateServiceAccount` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceUpdateServiceAccountWithResponse(ctx context.Context, id string, body ServiceAccountServiceUpdateServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceUpdateServiceAccountResponse, error) { - rsp, err := c.ServiceAccountServiceUpdateServiceAccount(ctx, id, body, reqEditors...) - if err != nil { - return nil, err + response := &MetadataServiceGetPlatformVersionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseServiceAccountServiceUpdateServiceAccountResponse(rsp) -} -// ServiceAccountServiceListTokensWithResponse performs a GET /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceListTokens` operationId) request. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceListTokensWithResponse(ctx context.Context, serviceAccountId string, params *ServiceAccountServiceListTokensParams, reqEditors ...RequestEditorFn) (*ServiceAccountServiceListTokensResponse, error) { - rsp, err := c.ServiceAccountServiceListTokens(ctx, serviceAccountId, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1PlatformVersions + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseServiceAccountServiceListTokensResponse(rsp) + + return response, nil } -// ServiceAccountServiceGenerateTokenWithBodyWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request, -// with any type of body and a specified content type. -// -// Returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceGenerateTokenWithBodyWithResponse(ctx context.Context, serviceAccountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) { - rsp, err := c.ServiceAccountServiceGenerateTokenWithBody(ctx, serviceAccountId, contentType, body, reqEditors...) +// ParseDomainSearchServiceCheckDomainsResponse parses an HTTP response from a DomainSearchServiceCheckDomainsWithResponse call +func ParseDomainSearchServiceCheckDomainsResponse(rsp *http.Response) (*DomainSearchServiceCheckDomainsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseServiceAccountServiceGenerateTokenResponse(rsp) -} -// ServiceAccountServiceGenerateTokenWithResponse performs a POST /v1/service-accounts/{serviceAccountId}/tokens (the `ServiceAccountServiceGenerateToken` operationId) request. -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -func (c *ClientWithResponses) ServiceAccountServiceGenerateTokenWithResponse(ctx context.Context, serviceAccountId string, body ServiceAccountServiceGenerateTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*ServiceAccountServiceGenerateTokenResponse, error) { - rsp, err := c.ServiceAccountServiceGenerateToken(ctx, serviceAccountId, body, reqEditors...) - if err != nil { - return nil, err + response := &DomainSearchServiceCheckDomainsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseServiceAccountServiceGenerateTokenResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1CheckDomainsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ParseAgentServiceListAgentsResponse parses an HTTP response from a AgentServiceListAgentsWithResponse call -func ParseAgentServiceListAgentsResponse(rsp *http.Response) (*AgentServiceListAgentsResponse, error) { +// ParseDomainContactServiceListDomainContactsResponse parses an HTTP response from a DomainContactServiceListDomainContactsWithResponse call +func ParseDomainContactServiceListDomainContactsResponse(rsp *http.Response) (*DomainContactServiceListDomainContactsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceListAgentsResponse{ + response := &DomainContactServiceListDomainContactsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1ListAgentsResponse + var dest V1ListDomainContactsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3491,22 +6303,22 @@ func ParseAgentServiceListAgentsResponse(rsp *http.Response) (*AgentServiceListA return response, nil } -// ParseAgentServiceCreateAgentResponse parses an HTTP response from a AgentServiceCreateAgentWithResponse call -func ParseAgentServiceCreateAgentResponse(rsp *http.Response) (*AgentServiceCreateAgentResponse, error) { +// ParseRegisteredDomainServiceListRegisteredDomainsResponse parses an HTTP response from a RegisteredDomainServiceListRegisteredDomainsWithResponse call +func ParseRegisteredDomainServiceListRegisteredDomainsResponse(rsp *http.Response) (*RegisteredDomainServiceListRegisteredDomainsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceCreateAgentResponse{ + response := &RegisteredDomainServiceListRegisteredDomainsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1GetAgentResponse + var dest V1ListRegisteredDomainsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3517,22 +6329,22 @@ func ParseAgentServiceCreateAgentResponse(rsp *http.Response) (*AgentServiceCrea return response, nil } -// ParseAgentServiceDeleteAgentResponse parses an HTTP response from a AgentServiceDeleteAgentWithResponse call -func ParseAgentServiceDeleteAgentResponse(rsp *http.Response) (*AgentServiceDeleteAgentResponse, error) { +// ParseRegisteredDomainServiceGetRegisteredDomainResponse parses an HTTP response from a RegisteredDomainServiceGetRegisteredDomainWithResponse call +func ParseRegisteredDomainServiceGetRegisteredDomainResponse(rsp *http.Response) (*RegisteredDomainServiceGetRegisteredDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceDeleteAgentResponse{ + response := &RegisteredDomainServiceGetRegisteredDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1SuccessResponse + var dest V1RegisteredDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3543,22 +6355,22 @@ func ParseAgentServiceDeleteAgentResponse(rsp *http.Response) (*AgentServiceDele return response, nil } -// ParseAgentServiceGetAgentResponse parses an HTTP response from a AgentServiceGetAgentWithResponse call -func ParseAgentServiceGetAgentResponse(rsp *http.Response) (*AgentServiceGetAgentResponse, error) { +// ParseRegisteredDomainServiceGetDomainAuthCodeResponse parses an HTTP response from a RegisteredDomainServiceGetDomainAuthCodeWithResponse call +func ParseRegisteredDomainServiceGetDomainAuthCodeResponse(rsp *http.Response) (*RegisteredDomainServiceGetDomainAuthCodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceGetAgentResponse{ + response := &RegisteredDomainServiceGetDomainAuthCodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1GetAgentResponse + var dest V1GetDomainAuthCodeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3569,22 +6381,22 @@ func ParseAgentServiceGetAgentResponse(rsp *http.Response) (*AgentServiceGetAgen return response, nil } -// ParseAgentServiceUpdateAgentResponse parses an HTTP response from a AgentServiceUpdateAgentWithResponse call -func ParseAgentServiceUpdateAgentResponse(rsp *http.Response) (*AgentServiceUpdateAgentResponse, error) { +// ParseRegisteredDomainServiceSetDomainAutoRenewResponse parses an HTTP response from a RegisteredDomainServiceSetDomainAutoRenewWithResponse call +func ParseRegisteredDomainServiceSetDomainAutoRenewResponse(rsp *http.Response) (*RegisteredDomainServiceSetDomainAutoRenewResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceUpdateAgentResponse{ + response := &RegisteredDomainServiceSetDomainAutoRenewResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1UpdateAgentResponse + var dest V1RegisteredDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3595,22 +6407,22 @@ func ParseAgentServiceUpdateAgentResponse(rsp *http.Response) (*AgentServiceUpda return response, nil } -// ParseAgentServiceGeneratePeeringConfigResponse parses an HTTP response from a AgentServiceGeneratePeeringConfigWithResponse call -func ParseAgentServiceGeneratePeeringConfigResponse(rsp *http.Response) (*AgentServiceGeneratePeeringConfigResponse, error) { +// ParseRegisteredDomainServiceSetDomainDnssecResponse parses an HTTP response from a RegisteredDomainServiceSetDomainDnssecWithResponse call +func ParseRegisteredDomainServiceSetDomainDnssecResponse(rsp *http.Response) (*RegisteredDomainServiceSetDomainDnssecResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceGeneratePeeringConfigResponse{ + response := &RegisteredDomainServiceSetDomainDnssecResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1GeneratePeeringConfigResponse + var dest V1RegisteredDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3621,22 +6433,22 @@ func ParseAgentServiceGeneratePeeringConfigResponse(rsp *http.Response) (*AgentS return response, nil } -// ParseAgentServiceUploadInboundPeeringConfigResponse parses an HTTP response from a AgentServiceUploadInboundPeeringConfigWithResponse call -func ParseAgentServiceUploadInboundPeeringConfigResponse(rsp *http.Response) (*AgentServiceUploadInboundPeeringConfigResponse, error) { +// ParseRegisteredDomainServiceSetDomainTransferLockResponse parses an HTTP response from a RegisteredDomainServiceSetDomainTransferLockWithResponse call +func ParseRegisteredDomainServiceSetDomainTransferLockResponse(rsp *http.Response) (*RegisteredDomainServiceSetDomainTransferLockResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AgentServiceUploadInboundPeeringConfigResponse{ + response := &RegisteredDomainServiceSetDomainTransferLockResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1UploadInboundPeeringConfigResponse + var dest V1RegisteredDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3647,22 +6459,22 @@ func ParseAgentServiceUploadInboundPeeringConfigResponse(rsp *http.Response) (*A return response, nil } -// ParseGroupServiceAddServiceAccountToGroupResponse parses an HTTP response from a GroupServiceAddServiceAccountToGroupWithResponse call -func ParseGroupServiceAddServiceAccountToGroupResponse(rsp *http.Response) (*GroupServiceAddServiceAccountToGroupResponse, error) { +// ParseRegisteredDomainServiceSetDomainNameserversResponse parses an HTTP response from a RegisteredDomainServiceSetDomainNameserversWithResponse call +func ParseRegisteredDomainServiceSetDomainNameserversResponse(rsp *http.Response) (*RegisteredDomainServiceSetDomainNameserversResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GroupServiceAddServiceAccountToGroupResponse{ + response := &RegisteredDomainServiceSetDomainNameserversResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1SuccessResponse + var dest V1RegisteredDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3673,22 +6485,22 @@ func ParseGroupServiceAddServiceAccountToGroupResponse(rsp *http.Response) (*Gro return response, nil } -// ParseGroupServiceRemoveServiceAccountFromGroupResponse parses an HTTP response from a GroupServiceRemoveServiceAccountFromGroupWithResponse call -func ParseGroupServiceRemoveServiceAccountFromGroupResponse(rsp *http.Response) (*GroupServiceRemoveServiceAccountFromGroupResponse, error) { +// ParseRegisteredDomainServiceRenewDomainResponse parses an HTTP response from a RegisteredDomainServiceRenewDomainWithResponse call +func ParseRegisteredDomainServiceRenewDomainResponse(rsp *http.Response) (*RegisteredDomainServiceRenewDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GroupServiceRemoveServiceAccountFromGroupResponse{ + response := &RegisteredDomainServiceRenewDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1SuccessResponse + var dest V1DomainOrder if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3699,22 +6511,22 @@ func ParseGroupServiceRemoveServiceAccountFromGroupResponse(rsp *http.Response) return response, nil } -// ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse parses an HTTP response from a MetricsCredentialServiceListMetricsWriteCredentialsWithResponse call -func ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse(rsp *http.Response) (*MetricsCredentialServiceListMetricsWriteCredentialsResponse, error) { +// ParseDomainOrderServiceCreateDomainOrderResponse parses an HTTP response from a DomainOrderServiceCreateDomainOrderWithResponse call +func ParseDomainOrderServiceCreateDomainOrderResponse(rsp *http.Response) (*DomainOrderServiceCreateDomainOrderResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MetricsCredentialServiceListMetricsWriteCredentialsResponse{ + response := &DomainOrderServiceCreateDomainOrderResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1ListMetricsWriteCredentialsResponse + var dest V1DomainOrder if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3725,22 +6537,22 @@ func ParseMetricsCredentialServiceListMetricsWriteCredentialsResponse(rsp *http. return response, nil } -// ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse parses an HTTP response from a MetricsCredentialServiceCreateMetricsWriteCredentialWithResponse call -func ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp *http.Response) (*MetricsCredentialServiceCreateMetricsWriteCredentialResponse, error) { +// ParseDomainOrderServiceGetDomainOrderResponse parses an HTTP response from a DomainOrderServiceGetDomainOrderWithResponse call +func ParseDomainOrderServiceGetDomainOrderResponse(rsp *http.Response) (*DomainOrderServiceGetDomainOrderResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MetricsCredentialServiceCreateMetricsWriteCredentialResponse{ + response := &DomainOrderServiceGetDomainOrderResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1CreateMetricsWriteCredentialResponse + var dest V1DomainOrder if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3751,22 +6563,22 @@ func ParseMetricsCredentialServiceCreateMetricsWriteCredentialResponse(rsp *http return response, nil } -// ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse parses an HTTP response from a MetricsCredentialServiceRotateMetricsWriteCredentialWithResponse call -func ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp *http.Response) (*MetricsCredentialServiceRotateMetricsWriteCredentialResponse, error) { +// ParseDomainOrderServiceCheckoutDomainOrderResponse parses an HTTP response from a DomainOrderServiceCheckoutDomainOrderWithResponse call +func ParseDomainOrderServiceCheckoutDomainOrderResponse(rsp *http.Response) (*DomainOrderServiceCheckoutDomainOrderResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MetricsCredentialServiceRotateMetricsWriteCredentialResponse{ + response := &DomainOrderServiceCheckoutDomainOrderResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1CreateMetricsWriteCredentialResponse + var dest V1CheckoutDomainOrderResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3777,22 +6589,22 @@ func ParseMetricsCredentialServiceRotateMetricsWriteCredentialResponse(rsp *http return response, nil } -// ParseOrganizationServiceGetOrganizationResponse parses an HTTP response from a OrganizationServiceGetOrganizationWithResponse call -func ParseOrganizationServiceGetOrganizationResponse(rsp *http.Response) (*OrganizationServiceGetOrganizationResponse, error) { +// ParseDomainOrderServicePriceDomainOrderResponse parses an HTTP response from a DomainOrderServicePriceDomainOrderWithResponse call +func ParseDomainOrderServicePriceDomainOrderResponse(rsp *http.Response) (*DomainOrderServicePriceDomainOrderResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &OrganizationServiceGetOrganizationResponse{ + response := &DomainOrderServicePriceDomainOrderResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1GetOrganizationResponse + var dest V1DomainOrderQuote if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3803,22 +6615,22 @@ func ParseOrganizationServiceGetOrganizationResponse(rsp *http.Response) (*Organ return response, nil } -// ParseOrganizationServiceListOrganizationsResponse parses an HTTP response from a OrganizationServiceListOrganizationsWithResponse call -func ParseOrganizationServiceListOrganizationsResponse(rsp *http.Response) (*OrganizationServiceListOrganizationsResponse, error) { +// ParseDomainSearchServiceSearchDomainsResponse parses an HTTP response from a DomainSearchServiceSearchDomainsWithResponse call +func ParseDomainSearchServiceSearchDomainsResponse(rsp *http.Response) (*DomainSearchServiceSearchDomainsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &OrganizationServiceListOrganizationsResponse{ + response := &DomainSearchServiceSearchDomainsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1ListOrganizationsResponse + var dest V1SearchDomainsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3829,22 +6641,22 @@ func ParseOrganizationServiceListOrganizationsResponse(rsp *http.Response) (*Org return response, nil } -// ParseMetadataServiceGetPlatformVersionsResponse parses an HTTP response from a MetadataServiceGetPlatformVersionsWithResponse call -func ParseMetadataServiceGetPlatformVersionsResponse(rsp *http.Response) (*MetadataServiceGetPlatformVersionsResponse, error) { +// ParseDomainSearchServiceCheckTransferResponse parses an HTTP response from a DomainSearchServiceCheckTransferWithResponse call +func ParseDomainSearchServiceCheckTransferResponse(rsp *http.Response) (*DomainSearchServiceCheckTransferResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MetadataServiceGetPlatformVersionsResponse{ + response := &DomainSearchServiceCheckTransferResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1PlatformVersions + var dest V1CheckTransferResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/internal/api/generated/openapi3.yaml b/internal/api/generated/openapi3.yaml index c6d7dd0..dc582af 100644 --- a/internal/api/generated/openapi3.yaml +++ b/internal/api/generated/openapi3.yaml @@ -15,6 +15,10 @@ tags: - name: MetadataService - name: AgentService - name: MetricsCredentialService +- name: DomainSearchService +- name: DomainOrderService +- name: RegisteredDomainService +- name: DomainContactService paths: /v1/agents: get: @@ -347,40 +351,65 @@ paths: description: '' tags: - MetadataService - /v1/roles/replace-for-service-account: - put: - operationId: RoleService_ReplaceRoleForServiceAccount + /v1/registrar/check: + post: + operationId: DomainSearchService_CheckDomains responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1SuccessResponse' + $ref: '#/components/schemas/v1CheckDomainsResponse' description: '' requestBody: content: application/json: schema: - $ref: '#/components/schemas/v1ReplaceRoleForServiceAccountRequest' + $ref: '#/components/schemas/v1CheckDomainsRequest' required: true tags: - - RoleService - /v1/service-accounts: + - DomainSearchService + /v1/registrar/contacts: get: - operationId: ServiceAccountService_ListServiceAccounts + operationId: DomainContactService_ListDomainContacts responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1ListServiceAccountsResponse' + $ref: '#/components/schemas/v1ListDomainContactsResponse' description: '' parameters: - - name: includeInactive + - name: page in: query required: false schema: - type: boolean + type: integer + format: int32 + - name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + - name: search + in: query + required: false + schema: + type: string + tags: + - DomainContactService + /v1/registrar/domains: + get: + operationId: RegisteredDomainService_ListRegisteredDomains + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1ListRegisteredDomainsResponse' + description: '' + parameters: - name: page in: query required: false @@ -393,71 +422,233 @@ paths: schema: type: integer format: int32 + - name: states + in: query + required: false + explode: true + schema: + type: array + items: + type: string + enum: + - REGISTERED_DOMAIN_STATE_UNSPECIFIED + - REGISTERED_DOMAIN_STATE_REGISTERING + - REGISTERED_DOMAIN_STATE_ACTIVE + - REGISTERED_DOMAIN_STATE_TRANSFER_IN_PENDING + - REGISTERED_DOMAIN_STATE_TRANSFER_OUT_PENDING + - REGISTERED_DOMAIN_STATE_EXPIRING + - REGISTERED_DOMAIN_STATE_EXPIRED + - REGISTERED_DOMAIN_STATE_REDEMPTION + - REGISTERED_DOMAIN_STATE_PENDING_DELETE + - REGISTERED_DOMAIN_STATE_TRANSFERRED_OUT + - REGISTERED_DOMAIN_STATE_DELETED + - REGISTERED_DOMAIN_STATE_FAILED + - name: search + in: query + required: false + schema: + type: string + - name: expiringSoon + in: query + required: false + schema: + type: boolean + - name: needsAttention + in: query + required: false + schema: + type: boolean tags: - - ServiceAccountService + - RegisteredDomainService + /v1/registrar/domains/{name}: + get: + operationId: RegisteredDomainService_GetRegisteredDomain + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1RegisteredDomain' + description: '' + parameters: + - name: name + in: path + required: true + schema: + type: string + tags: + - RegisteredDomainService + /v1/registrar/domains/{name}/auth-code: post: - operationId: ServiceAccountService_CreateServiceAccount + operationId: RegisteredDomainService_GetDomainAuthCode responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1ServiceAccountResponse' + $ref: '#/components/schemas/v1GetDomainAuthCodeResponse' description: '' + parameters: + - name: name + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/v1CreateServiceAccountRequest' + $ref: '#/components/schemas/RegisteredDomainServiceGetDomainAuthCodeBody' required: true tags: - - ServiceAccountService - /v1/service-accounts/tokens/{tokenId}: - delete: - operationId: ServiceAccountService_RevokeToken + - RegisteredDomainService + /v1/registrar/domains/{name}/auto-renew: + put: + operationId: RegisteredDomainService_SetDomainAutoRenew responses: '200': content: application/json: schema: - type: object - properties: {} + $ref: '#/components/schemas/v1RegisteredDomain' description: '' parameters: - - name: tokenId + - name: name in: path required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredDomainServiceSetDomainAutoRenewBody' + required: true tags: - - ServiceAccountService - /v1/service-accounts/{id}: - get: - operationId: ServiceAccountService_GetServiceAccount + - RegisteredDomainService + /v1/registrar/domains/{name}/dnssec: + put: + operationId: RegisteredDomainService_SetDomainDnssec responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1ServiceAccountResponse' + $ref: '#/components/schemas/v1RegisteredDomain' description: '' parameters: - - name: id + - name: name in: path required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredDomainServiceSetDomainDnssecBody' + required: true tags: - - ServiceAccountService - delete: - operationId: ServiceAccountService_DeleteServiceAccount + - RegisteredDomainService + /v1/registrar/domains/{name}/lock: + put: + operationId: RegisteredDomainService_SetDomainTransferLock responses: '200': content: application/json: schema: - type: object - properties: {} + $ref: '#/components/schemas/v1RegisteredDomain' + description: '' + parameters: + - name: name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredDomainServiceSetDomainTransferLockBody' + required: true + tags: + - RegisteredDomainService + /v1/registrar/domains/{name}/nameservers: + put: + operationId: RegisteredDomainService_SetDomainNameservers + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1RegisteredDomain' + description: '' + parameters: + - name: name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredDomainServiceSetDomainNameserversBody' + required: true + tags: + - RegisteredDomainService + /v1/registrar/domains/{name}/renew: + post: + operationId: RegisteredDomainService_RenewDomain + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1DomainOrder' + description: '' + parameters: + - name: name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredDomainServiceRenewDomainBody' + required: true + tags: + - RegisteredDomainService + /v1/registrar/orders: + post: + operationId: DomainOrderService_CreateDomainOrder + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1DomainOrder' + description: '' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1CreateDomainOrderRequest' + required: true + tags: + - DomainOrderService + /v1/registrar/orders/{id}: + get: + operationId: DomainOrderService_GetDomainOrder + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1DomainOrder' description: '' parameters: - name: id @@ -466,15 +657,16 @@ paths: schema: type: string tags: - - ServiceAccountService - patch: - operationId: ServiceAccountService_UpdateServiceAccount + - DomainOrderService + /v1/registrar/orders/{id}/checkout: + post: + operationId: DomainOrderService_CheckoutDomainOrder responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1ServiceAccountResponse' + $ref: '#/components/schemas/v1CheckoutDomainOrderResponse' description: '' parameters: - name: id @@ -486,26 +678,99 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountServiceUpdateServiceAccountBody' + $ref: '#/components/schemas/DomainOrderServiceCheckoutDomainOrderBody' required: true tags: - - ServiceAccountService - /v1/service-accounts/{serviceAccountId}/tokens: - get: - operationId: ServiceAccountService_ListTokens + - DomainOrderService + /v1/registrar/orders/{id}/price: + post: + operationId: DomainOrderService_PriceDomainOrder responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1ListServiceAccountTokensResponse' + $ref: '#/components/schemas/v1DomainOrderQuote' description: '' parameters: - - name: serviceAccountId + - name: id in: path required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DomainOrderServicePriceDomainOrderBody' + required: true + tags: + - DomainOrderService + /v1/registrar/search: + post: + operationId: DomainSearchService_SearchDomains + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1SearchDomainsResponse' + description: '' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1SearchDomainsRequest' + required: true + tags: + - DomainSearchService + /v1/registrar/transfer-check: + post: + operationId: DomainSearchService_CheckTransfer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1CheckTransferResponse' + description: '' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1CheckTransferRequest' + required: true + tags: + - DomainSearchService + /v1/roles/replace-for-service-account: + put: + operationId: RoleService_ReplaceRoleForServiceAccount + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1SuccessResponse' + description: '' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1ReplaceRoleForServiceAccountRequest' + required: true + tags: + - RoleService + /v1/service-accounts: + get: + operationId: ServiceAccountService_ListServiceAccounts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1ListServiceAccountsResponse' + description: '' + parameters: - name: includeInactive in: query required: false @@ -526,16 +791,146 @@ paths: tags: - ServiceAccountService post: - operationId: ServiceAccountService_GenerateToken + operationId: ServiceAccountService_CreateServiceAccount responses: '200': content: application/json: schema: - $ref: '#/components/schemas/v1GenerateServiceAccountTokenResponse' + $ref: '#/components/schemas/v1ServiceAccountResponse' description: '' - parameters: - - name: serviceAccountId + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1CreateServiceAccountRequest' + required: true + tags: + - ServiceAccountService + /v1/service-accounts/tokens/{tokenId}: + delete: + operationId: ServiceAccountService_RevokeToken + responses: + '200': + content: + application/json: + schema: + type: object + properties: {} + description: '' + parameters: + - name: tokenId + in: path + required: true + schema: + type: string + tags: + - ServiceAccountService + /v1/service-accounts/{id}: + get: + operationId: ServiceAccountService_GetServiceAccount + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1ServiceAccountResponse' + description: '' + parameters: + - name: id + in: path + required: true + schema: + type: string + tags: + - ServiceAccountService + delete: + operationId: ServiceAccountService_DeleteServiceAccount + responses: + '200': + content: + application/json: + schema: + type: object + properties: {} + description: '' + parameters: + - name: id + in: path + required: true + schema: + type: string + tags: + - ServiceAccountService + patch: + operationId: ServiceAccountService_UpdateServiceAccount + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1ServiceAccountResponse' + description: '' + parameters: + - name: id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceAccountServiceUpdateServiceAccountBody' + required: true + tags: + - ServiceAccountService + /v1/service-accounts/{serviceAccountId}/tokens: + get: + operationId: ServiceAccountService_ListTokens + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1ListServiceAccountTokensResponse' + description: '' + parameters: + - name: serviceAccountId + in: path + required: true + schema: + type: string + - name: includeInactive + in: query + required: false + schema: + type: boolean + - name: page + in: query + required: false + schema: + type: integer + format: int32 + - name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + tags: + - ServiceAccountService + post: + operationId: ServiceAccountService_GenerateToken + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/v1GenerateServiceAccountTokenResponse' + description: '' + parameters: + - name: serviceAccountId in: path required: true schema: @@ -578,8 +973,85 @@ components: properties: kubeconfig: type: string + DomainOrderServiceCheckoutDomainOrderBody: + type: object + properties: + paymentMethodId: + type: string + idempotencyKey: + type: string + acceptTermsVersion: + type: string + mitConsent: + type: boolean + confirmBillingCountry: + type: boolean + evidenceCountry: + type: string + DomainOrderServicePriceDomainOrderBody: + type: object + properties: + paymentMethodId: + type: string + confirmBillingCountry: + type: boolean + evidenceCountry: + type: string MetricsCredentialServiceRotateMetricsWriteCredentialBody: type: object + RegisteredDomainServiceGetDomainAuthCodeBody: + type: object + properties: + reauthToken: + type: string + RegisteredDomainServiceRenewDomainBody: + type: object + properties: + years: + type: integer + format: int32 + idempotencyKey: + type: string + RegisteredDomainServiceSetDomainAutoRenewBody: + type: object + properties: + autoRenew: + type: boolean + paymentMethodId: + type: string + mitConsent: + type: boolean + whoisPrivacyAutoRenew: + type: boolean + RegisteredDomainServiceSetDomainDnssecBody: + type: object + properties: + mode: + $ref: '#/components/schemas/v1DomainDnssecMode' + dnskeys: + type: array + items: + $ref: '#/components/schemas/v1DomainDnskeyRecord' + dsRecords: + type: array + items: + $ref: '#/components/schemas/v1DomainDsRecord' + RegisteredDomainServiceSetDomainNameserversBody: + type: object + properties: + nsMode: + $ref: '#/components/schemas/v1DomainNsMode' + nameservers: + type: array + items: + type: string + RegisteredDomainServiceSetDomainTransferLockBody: + type: object + properties: + locked: + type: boolean + reauthToken: + type: string ServiceAccountServiceGenerateTokenBody: type: object properties: @@ -613,106 +1085,773 @@ components: v1AddServiceAccountToGroupRequest: type: object properties: - groupId: + groupId: + type: string + serviceAccountIds: + type: array + items: + type: string + v1Agent: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + gatewayRegion: + $ref: '#/components/schemas/v1AgentGatewayRegion' + agentPublicIp: + type: string + gwServerServicePort: + type: integer + format: int32 + organizationId: + type: string + metadata: + type: object + status: + $ref: '#/components/schemas/protov1Status' + timestamps: + $ref: '#/components/schemas/v1Timestamps' + provisioned: + type: boolean + inboundPeeringState: + $ref: '#/components/schemas/v1InboundPeeringState' + inboundPeeringError: + type: string + serviceStatus: + $ref: '#/components/schemas/v1ServiceStatus' + hypervisorDriver: + $ref: '#/components/schemas/v1PlatformDriver' + v1AgentGatewayRegion: + type: string + enum: + - AGENT_GATEWAY_REGION_UNSPECIFIED + - AGENT_GATEWAY_REGION_AMS01 + default: AGENT_GATEWAY_REGION_UNSPECIFIED + v1CheckDomainsRequest: + type: object + properties: + names: + type: array + items: + type: string + v1CheckDomainsResponse: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/v1DomainSearchResult' + v1CheckTransferRequest: + type: object + properties: + names: + type: array + items: + type: string + v1CheckTransferResponse: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/v1TransferCheckResult' + v1CheckoutDomainOrderResponse: + type: object + properties: + state: + $ref: '#/components/schemas/v1DomainOrderState' + order: + $ref: '#/components/schemas/v1DomainOrder' + requiresAction: + type: boolean + paymentIntentId: + type: string + v1ComponentVersion: + type: object + properties: + name: + type: string + version: + type: string + minVersion: + type: string + downloadUrl: + type: string + checksumSha256: + type: string + v1CreateAgentRequest: + type: object + properties: + name: + type: string + description: + type: string + agentPublicIp: + type: string + gatewayRegion: + $ref: '#/components/schemas/v1AgentGatewayRegion' + hypervisorDriver: + $ref: '#/components/schemas/v1PlatformDriver' + v1CreateDomainOrderRequest: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/v1DomainOrderItemInput' + idempotencyKey: + type: string + contactId: + type: string + nsMode: + $ref: '#/components/schemas/v1DomainNsMode' + nameservers: + type: array + items: + type: string + v1CreateMetricsWriteCredentialRequest: + type: object + properties: + name: + type: string + agentId: + type: string + expiresAt: + type: string + format: date-time + v1CreateMetricsWriteCredentialResponse: + type: object + properties: + credential: + $ref: '#/components/schemas/v1MetricsWriteCredential' + token: + type: string + v1CreateServiceAccountRequest: + type: object + properties: + name: + type: string + description: + type: string + allowedIps: + type: array + items: + type: string + v1DomainAvailability: + type: string + enum: + - DOMAIN_AVAILABILITY_UNSPECIFIED + - DOMAIN_AVAILABILITY_AVAILABLE + - DOMAIN_AVAILABILITY_TAKEN + - DOMAIN_AVAILABILITY_PREMIUM + - DOMAIN_AVAILABILITY_UNSUPPORTED + - DOMAIN_AVAILABILITY_RESERVED + - DOMAIN_AVAILABILITY_INVALID + - DOMAIN_AVAILABILITY_BLOCKED + - DOMAIN_AVAILABILITY_UNKNOWN + default: DOMAIN_AVAILABILITY_UNSPECIFIED + v1DomainContact: + type: object + properties: + id: + type: string + readOnly: true + organizationId: + type: string + readOnly: true + kind: + $ref: '#/components/schemas/v1DomainContactKind' + label: + type: string + firstName: + type: string + lastName: + type: string + organization: + type: string + email: + type: string + phone: + type: string + phoneExt: + type: string + fax: + type: string + street: + type: string + street2: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + country: + type: string + vatId: + type: string + extensionData: + type: object + isDefault: + type: boolean + emailVerified: + type: boolean + emailVerifiedAt: + type: string + format: date-time + consentPublish: + type: boolean + domainCount: + type: integer + format: int32 + readOnly: true + timestamps: + $ref: '#/components/schemas/v1Timestamps' + v1DomainContactKind: + type: string + enum: + - DOMAIN_CONTACT_KIND_UNSPECIFIED + - DOMAIN_CONTACT_KIND_INDIVIDUAL + - DOMAIN_CONTACT_KIND_ORGANIZATION + default: DOMAIN_CONTACT_KIND_UNSPECIFIED + v1DomainDnskeyRecord: + type: object + properties: + flags: + type: integer + format: int64 + protocol: + type: integer + format: int64 + algorithm: + type: integer + format: int64 + publicKey: + type: string + v1DomainDnssec: + type: object + properties: + mode: + $ref: '#/components/schemas/v1DomainDnssecMode' + status: + $ref: '#/components/schemas/v1DomainDnssecStatus' + dsRecords: + type: array + items: + $ref: '#/components/schemas/v1DomainDsRecord' + dnskeys: + type: array + items: + $ref: '#/components/schemas/v1DomainDnskeyRecord' + dsAtParent: + type: boolean + allowed: + type: boolean + dsDataSupported: + type: boolean + safeToDisableAt: + type: string + format: date-time + v1DomainDnssecMode: + type: string + enum: + - DOMAIN_DNSSEC_MODE_UNSPECIFIED + - DOMAIN_DNSSEC_MODE_OFF + - DOMAIN_DNSSEC_MODE_MANAGED + - DOMAIN_DNSSEC_MODE_CUSTOM + default: DOMAIN_DNSSEC_MODE_UNSPECIFIED + v1DomainDnssecStatus: + type: string + enum: + - DOMAIN_DNSSEC_STATUS_UNSPECIFIED + - DOMAIN_DNSSEC_STATUS_UNSIGNED + - DOMAIN_DNSSEC_STATUS_PENDING + - DOMAIN_DNSSEC_STATUS_ACTIVE + - DOMAIN_DNSSEC_STATUS_MISMATCH + - DOMAIN_DNSSEC_STATUS_DISABLING + default: DOMAIN_DNSSEC_STATUS_UNSPECIFIED + v1DomainDsRecord: + type: object + properties: + keyTag: + type: integer + format: int64 + algorithm: + type: integer + format: int64 + digestType: + type: integer + format: int64 + digest: + type: string + v1DomainHold: + type: string + enum: + - DOMAIN_HOLD_UNSPECIFIED + - DOMAIN_HOLD_VERIFICATION + - DOMAIN_HOLD_ABUSE + - DOMAIN_HOLD_PAYMENT_DISPUTE + - DOMAIN_HOLD_UNPAID + - DOMAIN_HOLD_UDRP + - DOMAIN_HOLD_ADMIN + default: DOMAIN_HOLD_UNSPECIFIED + v1DomainNsMode: + type: string + enum: + - DOMAIN_NS_MODE_UNSPECIFIED + - DOMAIN_NS_MODE_NODERINGS + - DOMAIN_NS_MODE_CUSTOM + default: DOMAIN_NS_MODE_UNSPECIFIED + v1DomainOrder: + type: object + properties: + id: + type: string + readOnly: true + organizationId: + type: string + readOnly: true + state: + $ref: '#/components/schemas/v1DomainOrderState' + currency: + type: string + subtotal: + type: string + taxAmount: + type: string + total: + type: string + quoteExpiresAt: + type: string + format: date-time + items: + type: array + items: + $ref: '#/components/schemas/v1DomainOrderItem' + paymentMethodId: + type: string + failureCode: + type: string + failureMessage: + type: string + termsVersion: + type: string + mitConsent: + type: boolean + termsAcceptedAt: + type: string + format: date-time + completedAt: + type: string + format: date-time + timestamps: + $ref: '#/components/schemas/v1Timestamps' + idempotencyKey: + type: string + v1DomainOrderItem: + type: object + properties: + id: + type: string + readOnly: true + kind: + $ref: '#/components/schemas/v1DomainOrderItemKind' + domainName: + type: string + tld: + type: string + years: + type: integer + format: int32 + currency: + type: string + sellPrice: + type: string + privacyPrice: + type: string + renewalPrice: + type: string + taxAmount: + type: string + lineTotal: + type: string + availability: + $ref: '#/components/schemas/v1DomainAvailability' + unavailableReason: + type: string + nsMode: + $ref: '#/components/schemas/v1DomainNsMode' + nameservers: + type: array + items: + type: string + dnssec: + type: boolean + whoisPrivacy: + type: boolean + autoRenew: + type: boolean + contactId: + type: string + state: + $ref: '#/components/schemas/v1DomainOrderItemState' + failureCode: + type: string + failureMessage: + type: string + registeredDomainId: + type: string + zoneCreated: + type: boolean + hasAuthCode: + type: boolean + minYears: + type: integer + format: int32 + maxYears: + type: integer + format: int32 + privacyAllowed: + type: boolean + dnssecAllowed: + type: boolean + importNameserversFromRegistry: + type: boolean + extensionData: + type: object + starterRecords: + type: array + items: + $ref: '#/components/schemas/v1DomainStarterRecord' + requiresExtensionData: + type: boolean + dnssecPublished: + type: boolean + stage: + $ref: '#/components/schemas/v1DomainOrderItemStage' + v1DomainOrderItemInput: + type: object + properties: + kind: + $ref: '#/components/schemas/v1DomainOrderItemKind' + domainName: + type: string + years: + type: integer + format: int32 + whoisPrivacy: + type: boolean + autoRenew: + type: boolean + contactId: + type: string + nsMode: + $ref: '#/components/schemas/v1DomainNsMode' + nameservers: + type: array + items: + type: string + dnssec: + type: boolean + authCode: + type: string + importNameserversFromRegistry: + type: boolean + extensionData: + type: object + starterRecords: + type: array + items: + $ref: '#/components/schemas/v1DomainStarterRecord' + v1DomainOrderItemKind: + type: string + enum: + - DOMAIN_ORDER_ITEM_KIND_UNSPECIFIED + - DOMAIN_ORDER_ITEM_KIND_REGISTER + - DOMAIN_ORDER_ITEM_KIND_TRANSFER_IN + - DOMAIN_ORDER_ITEM_KIND_RENEW + - DOMAIN_ORDER_ITEM_KIND_RESTORE + - DOMAIN_ORDER_ITEM_KIND_PRIVACY + default: DOMAIN_ORDER_ITEM_KIND_UNSPECIFIED + v1DomainOrderItemStage: + type: string + enum: + - DOMAIN_ORDER_ITEM_STAGE_UNSPECIFIED + - DOMAIN_ORDER_ITEM_STAGE_PENDING + - DOMAIN_ORDER_ITEM_STAGE_REGISTERING + - DOMAIN_ORDER_ITEM_STAGE_DNS + - DOMAIN_ORDER_ITEM_STAGE_DNSSEC + - DOMAIN_ORDER_ITEM_STAGE_DONE + - DOMAIN_ORDER_ITEM_STAGE_FAILED + default: DOMAIN_ORDER_ITEM_STAGE_UNSPECIFIED + v1DomainOrderItemState: + type: string + enum: + - DOMAIN_ORDER_ITEM_STATE_UNSPECIFIED + - DOMAIN_ORDER_ITEM_STATE_PENDING + - DOMAIN_ORDER_ITEM_STATE_SUBMITTED + - DOMAIN_ORDER_ITEM_STATE_SUCCEEDED + - DOMAIN_ORDER_ITEM_STATE_FAILED + - DOMAIN_ORDER_ITEM_STATE_CANCELED + default: DOMAIN_ORDER_ITEM_STATE_UNSPECIFIED + v1DomainOrderQuote: + type: object + properties: + orderId: type: string - serviceAccountIds: + currency: + type: string + lines: type: array items: - type: string - v1Agent: + $ref: '#/components/schemas/v1DomainOrderQuoteLine' + subtotal: + type: string + taxAmount: + type: string + total: + type: string + taxBreakdown: + type: array + items: + $ref: '#/components/schemas/v1DomainTaxLine' + quoteExpiresAt: + type: string + format: date-time + taxRequiresAddress: + type: boolean + billingCountryConfirmationRequired: + type: boolean + mitConsentRequired: + type: boolean + termsVersion: + type: string + mitConsentText: + type: string + state: + $ref: '#/components/schemas/v1DomainOrderState' + termsUrl: + type: string + v1DomainOrderQuoteLine: type: object properties: - id: + itemId: type: string - name: + domainName: type: string + kind: + $ref: '#/components/schemas/v1DomainOrderItemKind' + years: + type: integer + format: int32 description: type: string - gatewayRegion: - $ref: '#/components/schemas/v1AgentGatewayRegion' - agentPublicIp: + sellPrice: type: string - gwServerServicePort: - type: integer - format: int32 - organizationId: + privacyPrice: type: string - metadata: - type: object - status: - $ref: '#/components/schemas/protov1Status' - timestamps: - $ref: '#/components/schemas/v1Timestamps' - provisioned: + subtotal: + type: string + taxAmount: + type: string + total: + type: string + renewalPrice: + type: string + available: type: boolean - inboundPeeringState: - $ref: '#/components/schemas/v1InboundPeeringState' - inboundPeeringError: + unavailableReason: type: string - serviceStatus: - $ref: '#/components/schemas/v1ServiceStatus' - hypervisorDriver: - $ref: '#/components/schemas/v1PlatformDriver' - v1AgentGatewayRegion: + priceChanged: + type: boolean + v1DomainOrderState: type: string enum: - - AGENT_GATEWAY_REGION_UNSPECIFIED - - AGENT_GATEWAY_REGION_AMS01 - default: AGENT_GATEWAY_REGION_UNSPECIFIED - v1ComponentVersion: + - DOMAIN_ORDER_STATE_UNSPECIFIED + - DOMAIN_ORDER_STATE_DRAFT + - DOMAIN_ORDER_STATE_QUOTED + - DOMAIN_ORDER_STATE_AWAITING_PAYMENT + - DOMAIN_ORDER_STATE_AUTHORIZED + - DOMAIN_ORDER_STATE_IN_REVIEW + - DOMAIN_ORDER_STATE_PROCESSING + - DOMAIN_ORDER_STATE_COMPLETED + - DOMAIN_ORDER_STATE_PARTIALLY_COMPLETED + - DOMAIN_ORDER_STATE_FAILED + - DOMAIN_ORDER_STATE_CANCELED + - DOMAIN_ORDER_STATE_EXPIRED + default: DOMAIN_ORDER_STATE_UNSPECIFIED + v1DomainRenewalInfo: type: object properties: - name: + currency: type: string - version: + renewalPrice: type: string - minVersion: + privacyPrice: type: string - downloadUrl: + nextAttemptAt: type: string - checksumSha256: + format: date-time + restorePrice: type: string - v1CreateAgentRequest: + maxExtendYears: + type: integer + format: int32 + v1DomainSearchResult: type: object properties: name: type: string - description: + tld: type: string - agentPublicIp: + availability: + $ref: '#/components/schemas/v1DomainAvailability' + reason: type: string - gatewayRegion: - $ref: '#/components/schemas/v1AgentGatewayRegion' - hypervisorDriver: - $ref: '#/components/schemas/v1PlatformDriver' - v1CreateMetricsWriteCredentialRequest: + exactMatch: + type: boolean + featured: + type: boolean + suggestion: + type: boolean + currency: + type: string + firstYearPrice: + type: string + renewalPrice: + type: string + transferPrice: + type: string + privacyPrice: + type: string + privacyAllowed: + type: boolean + dnssecAllowed: + type: boolean + isPromotion: + type: boolean + priceGapWarning: + type: boolean + eligibility: + $ref: '#/components/schemas/v1TldEligibility' + eligibilityNote: + type: string + riskTier: + $ref: '#/components/schemas/v1TldRiskTier' + riskNote: + type: string + minYears: + type: integer + format: int32 + maxYears: + type: integer + format: int32 + requiresExtensionData: + type: boolean + category: + $ref: '#/components/schemas/v1TldCategory' + eligibleCountries: + type: array + items: + type: string + ownedByCaller: + type: boolean + v1DomainStarterRecord: type: object properties: name: type: string - agentId: + type: type: string - expiresAt: + value: + type: string + virtualMachineId: + type: string + v1DomainTaxLine: + type: object + properties: + jurisdiction: + type: string + taxType: + type: string + ratePercent: + type: string + amount: + type: string + reverseCharge: + type: boolean + taxabilityReason: + type: string + v1DomainTransferIn: + type: object + properties: + state: + $ref: '#/components/schemas/v1DomainTransferInState' + failureReason: + type: string + startedAt: type: string format: date-time - v1CreateMetricsWriteCredentialResponse: + orderId: + type: string + orderItemId: + type: string + v1DomainTransferInState: + type: string + enum: + - DOMAIN_TRANSFER_IN_STATE_UNSPECIFIED + - DOMAIN_TRANSFER_IN_STATE_NONE + - DOMAIN_TRANSFER_IN_STATE_PENDING + - DOMAIN_TRANSFER_IN_STATE_AUTH_CODE_REJECTED + - DOMAIN_TRANSFER_IN_STATE_COMPLETED + - DOMAIN_TRANSFER_IN_STATE_FAILED + default: DOMAIN_TRANSFER_IN_STATE_UNSPECIFIED + v1DomainTransferOut: type: object properties: - credential: - $ref: '#/components/schemas/v1MetricsWriteCredential' - token: + state: + $ref: '#/components/schemas/v1DomainTransferOutState' + completesAt: type: string - v1CreateServiceAccountRequest: + format: date-time + gainingRegistrar: + type: string + v1DomainTransferOutState: + type: string + enum: + - DOMAIN_TRANSFER_OUT_STATE_UNSPECIFIED + - DOMAIN_TRANSFER_OUT_STATE_NONE + - DOMAIN_TRANSFER_OUT_STATE_PENDING + - DOMAIN_TRANSFER_OUT_STATE_APPROVED + - DOMAIN_TRANSFER_OUT_STATE_COMPLETED + - DOMAIN_TRANSFER_OUT_STATE_REJECTED + default: DOMAIN_TRANSFER_OUT_STATE_UNSPECIFIED + v1DomainVerification: type: object properties: - name: + status: + $ref: '#/components/schemas/v1DomainVerificationStatus' + email: type: string - description: + deadline: type: string - allowedIps: - type: array - items: - type: string + format: date-time + lastSentAt: + type: string + format: date-time + v1DomainVerificationStatus: + type: string + enum: + - DOMAIN_VERIFICATION_STATUS_UNSPECIFIED + - DOMAIN_VERIFICATION_STATUS_VERIFIED + - DOMAIN_VERIFICATION_STATUS_PENDING + - DOMAIN_VERIFICATION_STATUS_FAILED + default: DOMAIN_VERIFICATION_STATUS_UNSPECIFIED v1GeneratePeeringConfigResponse: type: object properties: @@ -738,6 +1877,14 @@ components: properties: agent: $ref: '#/components/schemas/v1Agent' + v1GetDomainAuthCodeResponse: + type: object + properties: + authCode: + type: string + expiresAt: + type: string + format: date-time v1GetOrganizationResponse: type: object properties: @@ -762,6 +1909,22 @@ components: totalCount: type: integer format: int32 + v1ListDomainContactsResponse: + type: object + properties: + contacts: + type: array + items: + $ref: '#/components/schemas/v1DomainContact' + totalCount: + type: integer + format: int32 + page: + type: integer + format: int32 + pageSize: + type: integer + format: int32 v1ListMetricsWriteCredentialsResponse: type: object properties: @@ -782,6 +1945,22 @@ components: totalCount: type: integer format: int32 + v1ListRegisteredDomainsResponse: + type: object + properties: + domains: + type: array + items: + $ref: '#/components/schemas/v1RegisteredDomain' + totalCount: + type: integer + format: int32 + page: + type: integer + format: int32 + pageSize: + type: integer + format: int32 v1ListServiceAccountTokensResponse: type: object properties: @@ -926,6 +2105,124 @@ components: $ref: '#/components/schemas/v1ComponentVersion' schemaVersion: type: string + v1RegisteredDomain: + type: object + properties: + id: + type: string + readOnly: true + name: + type: string + tld: + type: string + organizationId: + type: string + readOnly: true + state: + $ref: '#/components/schemas/v1RegisteredDomainState' + holds: + type: array + items: + $ref: '#/components/schemas/v1DomainHold' + registrarName: + type: string + registeredAt: + type: string + format: date-time + expiresAt: + type: string + format: date-time + renewBy: + type: string + format: date-time + autoRenew: + type: boolean + renewal: + $ref: '#/components/schemas/v1DomainRenewalInfo' + transferLock: + type: boolean + transferLockUntil: + type: string + format: date-time + whoisPrivacy: + type: boolean + whoisPrivacyAutoRenew: + type: boolean + whoisPrivacyPaidUntil: + type: string + format: date-time + privacyAllowed: + type: boolean + nsMode: + $ref: '#/components/schemas/v1DomainNsMode' + nameservers: + type: array + items: + type: string + dnsZoneId: + type: string + dnssec: + $ref: '#/components/schemas/v1DomainDnssec' + registrant: + $ref: '#/components/schemas/v1DomainContact' + techContact: + $ref: '#/components/schemas/v1DomainContact' + verification: + $ref: '#/components/schemas/v1DomainVerification' + transferOut: + $ref: '#/components/schemas/v1DomainTransferOut' + transferIn: + $ref: '#/components/schemas/v1DomainTransferIn' + registrantChange: + $ref: '#/components/schemas/v1RegistrantChange' + operationPending: + type: boolean + lastSyncedAt: + type: string + format: date-time + timestamps: + $ref: '#/components/schemas/v1Timestamps' + registrantContactId: + type: string + readOnly: true + registrantDisplayName: + type: string + readOnly: true + v1RegisteredDomainState: + type: string + enum: + - REGISTERED_DOMAIN_STATE_UNSPECIFIED + - REGISTERED_DOMAIN_STATE_REGISTERING + - REGISTERED_DOMAIN_STATE_ACTIVE + - REGISTERED_DOMAIN_STATE_TRANSFER_IN_PENDING + - REGISTERED_DOMAIN_STATE_TRANSFER_OUT_PENDING + - REGISTERED_DOMAIN_STATE_EXPIRING + - REGISTERED_DOMAIN_STATE_EXPIRED + - REGISTERED_DOMAIN_STATE_REDEMPTION + - REGISTERED_DOMAIN_STATE_PENDING_DELETE + - REGISTERED_DOMAIN_STATE_TRANSFERRED_OUT + - REGISTERED_DOMAIN_STATE_DELETED + - REGISTERED_DOMAIN_STATE_FAILED + default: REGISTERED_DOMAIN_STATE_UNSPECIFIED + v1RegistrantChange: + type: object + properties: + state: + $ref: '#/components/schemas/v1RegistrantChangeState' + newContactId: + type: string + expiresAt: + type: string + format: date-time + v1RegistrantChangeState: + type: string + enum: + - REGISTRANT_CHANGE_STATE_UNSPECIFIED + - REGISTRANT_CHANGE_STATE_PENDING + - REGISTRANT_CHANGE_STATE_APPROVED + - REGISTRANT_CHANGE_STATE_REJECTED + - REGISTRANT_CHANGE_STATE_EXPIRED + default: REGISTRANT_CHANGE_STATE_UNSPECIFIED v1ReplaceRoleForServiceAccountRequest: type: object properties: @@ -933,6 +2230,34 @@ components: type: string serviceAccountId: type: string + v1SearchDomainsRequest: + type: object + properties: + query: + type: string + turnstileToken: + type: string + tlds: + type: array + items: + type: string + includeSuggestions: + type: boolean + exactOnly: + type: boolean + category: + $ref: '#/components/schemas/v1TldCategory' + v1SearchDomainsResponse: + type: object + properties: + query: + type: string + normalizedLabel: + type: string + results: + type: array + items: + $ref: '#/components/schemas/v1DomainSearchResult' v1ServiceAccountResponse: type: object properties: @@ -1017,6 +2342,68 @@ components: updateTime: type: string format: date-time + v1TldCategory: + type: string + enum: + - TLD_CATEGORY_UNSPECIFIED + - TLD_CATEGORY_GENERIC + - TLD_CATEGORY_COUNTRY + - TLD_CATEGORY_TECH + - TLD_CATEGORY_BUSINESS + - TLD_CATEGORY_CREATIVE + - TLD_CATEGORY_COMMUNITY + - TLD_CATEGORY_GEOGRAPHIC + - TLD_CATEGORY_LIFESTYLE + - TLD_CATEGORY_SHOPPING + - TLD_CATEGORY_OTHER + default: TLD_CATEGORY_UNSPECIFIED + v1TldEligibility: + type: string + enum: + - TLD_ELIGIBILITY_UNSPECIFIED + - TLD_ELIGIBILITY_ANYONE + - TLD_ELIGIBILITY_RESIDENTS_ONLY + default: TLD_ELIGIBILITY_UNSPECIFIED + v1TldRiskTier: + type: string + enum: + - TLD_RISK_TIER_UNSPECIFIED + - TLD_RISK_TIER_NORMAL + - TLD_RISK_TIER_HIGH + default: TLD_RISK_TIER_UNSPECIFIED + v1TransferCheckResult: + type: object + properties: + name: + type: string + transferable: + type: boolean + reason: + type: string + currency: + type: string + transferPrice: + type: string + includesRenewalYear: + type: boolean + authCodeRequired: + type: boolean + warnings: + type: array + items: + type: string + currentNameservers: + type: array + items: + type: string + eligibility: + $ref: '#/components/schemas/v1TldEligibility' + eligibilityNote: + type: string + eligibleCountries: + type: array + items: + type: string v1UpdateAgentResponse: type: object properties: diff --git a/internal/api/generated/types.gen.go b/internal/api/generated/types.gen.go index a6307df..730330f 100644 --- a/internal/api/generated/types.gen.go +++ b/internal/api/generated/types.gen.go @@ -52,6 +52,399 @@ func (e V1AgentGatewayRegion) Valid() bool { } } +// Defines values for V1DomainAvailability. +const ( + DOMAINAVAILABILITYAVAILABLE V1DomainAvailability = "DOMAIN_AVAILABILITY_AVAILABLE" + DOMAINAVAILABILITYBLOCKED V1DomainAvailability = "DOMAIN_AVAILABILITY_BLOCKED" + DOMAINAVAILABILITYINVALID V1DomainAvailability = "DOMAIN_AVAILABILITY_INVALID" + DOMAINAVAILABILITYPREMIUM V1DomainAvailability = "DOMAIN_AVAILABILITY_PREMIUM" + DOMAINAVAILABILITYRESERVED V1DomainAvailability = "DOMAIN_AVAILABILITY_RESERVED" + DOMAINAVAILABILITYTAKEN V1DomainAvailability = "DOMAIN_AVAILABILITY_TAKEN" + DOMAINAVAILABILITYUNKNOWN V1DomainAvailability = "DOMAIN_AVAILABILITY_UNKNOWN" + DOMAINAVAILABILITYUNSPECIFIED V1DomainAvailability = "DOMAIN_AVAILABILITY_UNSPECIFIED" + DOMAINAVAILABILITYUNSUPPORTED V1DomainAvailability = "DOMAIN_AVAILABILITY_UNSUPPORTED" +) + +// Valid indicates whether the value is a known member of the V1DomainAvailability enum. +func (e V1DomainAvailability) Valid() bool { + switch e { + case DOMAINAVAILABILITYAVAILABLE: + return true + case DOMAINAVAILABILITYBLOCKED: + return true + case DOMAINAVAILABILITYINVALID: + return true + case DOMAINAVAILABILITYPREMIUM: + return true + case DOMAINAVAILABILITYRESERVED: + return true + case DOMAINAVAILABILITYTAKEN: + return true + case DOMAINAVAILABILITYUNKNOWN: + return true + case DOMAINAVAILABILITYUNSPECIFIED: + return true + case DOMAINAVAILABILITYUNSUPPORTED: + return true + default: + return false + } +} + +// Defines values for V1DomainContactKind. +const ( + DOMAINCONTACTKINDINDIVIDUAL V1DomainContactKind = "DOMAIN_CONTACT_KIND_INDIVIDUAL" + DOMAINCONTACTKINDORGANIZATION V1DomainContactKind = "DOMAIN_CONTACT_KIND_ORGANIZATION" + DOMAINCONTACTKINDUNSPECIFIED V1DomainContactKind = "DOMAIN_CONTACT_KIND_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainContactKind enum. +func (e V1DomainContactKind) Valid() bool { + switch e { + case DOMAINCONTACTKINDINDIVIDUAL: + return true + case DOMAINCONTACTKINDORGANIZATION: + return true + case DOMAINCONTACTKINDUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainDnssecMode. +const ( + DOMAINDNSSECMODECUSTOM V1DomainDnssecMode = "DOMAIN_DNSSEC_MODE_CUSTOM" + DOMAINDNSSECMODEMANAGED V1DomainDnssecMode = "DOMAIN_DNSSEC_MODE_MANAGED" + DOMAINDNSSECMODEOFF V1DomainDnssecMode = "DOMAIN_DNSSEC_MODE_OFF" + DOMAINDNSSECMODEUNSPECIFIED V1DomainDnssecMode = "DOMAIN_DNSSEC_MODE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainDnssecMode enum. +func (e V1DomainDnssecMode) Valid() bool { + switch e { + case DOMAINDNSSECMODECUSTOM: + return true + case DOMAINDNSSECMODEMANAGED: + return true + case DOMAINDNSSECMODEOFF: + return true + case DOMAINDNSSECMODEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainDnssecStatus. +const ( + DOMAINDNSSECSTATUSACTIVE V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_ACTIVE" + DOMAINDNSSECSTATUSDISABLING V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_DISABLING" + DOMAINDNSSECSTATUSMISMATCH V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_MISMATCH" + DOMAINDNSSECSTATUSPENDING V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_PENDING" + DOMAINDNSSECSTATUSUNSIGNED V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_UNSIGNED" + DOMAINDNSSECSTATUSUNSPECIFIED V1DomainDnssecStatus = "DOMAIN_DNSSEC_STATUS_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainDnssecStatus enum. +func (e V1DomainDnssecStatus) Valid() bool { + switch e { + case DOMAINDNSSECSTATUSACTIVE: + return true + case DOMAINDNSSECSTATUSDISABLING: + return true + case DOMAINDNSSECSTATUSMISMATCH: + return true + case DOMAINDNSSECSTATUSPENDING: + return true + case DOMAINDNSSECSTATUSUNSIGNED: + return true + case DOMAINDNSSECSTATUSUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainHold. +const ( + DOMAINHOLDABUSE V1DomainHold = "DOMAIN_HOLD_ABUSE" + DOMAINHOLDADMIN V1DomainHold = "DOMAIN_HOLD_ADMIN" + DOMAINHOLDPAYMENTDISPUTE V1DomainHold = "DOMAIN_HOLD_PAYMENT_DISPUTE" + DOMAINHOLDUDRP V1DomainHold = "DOMAIN_HOLD_UDRP" + DOMAINHOLDUNPAID V1DomainHold = "DOMAIN_HOLD_UNPAID" + DOMAINHOLDUNSPECIFIED V1DomainHold = "DOMAIN_HOLD_UNSPECIFIED" + DOMAINHOLDVERIFICATION V1DomainHold = "DOMAIN_HOLD_VERIFICATION" +) + +// Valid indicates whether the value is a known member of the V1DomainHold enum. +func (e V1DomainHold) Valid() bool { + switch e { + case DOMAINHOLDABUSE: + return true + case DOMAINHOLDADMIN: + return true + case DOMAINHOLDPAYMENTDISPUTE: + return true + case DOMAINHOLDUDRP: + return true + case DOMAINHOLDUNPAID: + return true + case DOMAINHOLDUNSPECIFIED: + return true + case DOMAINHOLDVERIFICATION: + return true + default: + return false + } +} + +// Defines values for V1DomainNsMode. +const ( + DOMAINNSMODECUSTOM V1DomainNsMode = "DOMAIN_NS_MODE_CUSTOM" + DOMAINNSMODENODERINGS V1DomainNsMode = "DOMAIN_NS_MODE_NODERINGS" + DOMAINNSMODEUNSPECIFIED V1DomainNsMode = "DOMAIN_NS_MODE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainNsMode enum. +func (e V1DomainNsMode) Valid() bool { + switch e { + case DOMAINNSMODECUSTOM: + return true + case DOMAINNSMODENODERINGS: + return true + case DOMAINNSMODEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainOrderItemKind. +const ( + DOMAINORDERITEMKINDPRIVACY V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_PRIVACY" + DOMAINORDERITEMKINDREGISTER V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_REGISTER" + DOMAINORDERITEMKINDRENEW V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_RENEW" + DOMAINORDERITEMKINDRESTORE V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_RESTORE" + DOMAINORDERITEMKINDTRANSFERIN V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_TRANSFER_IN" + DOMAINORDERITEMKINDUNSPECIFIED V1DomainOrderItemKind = "DOMAIN_ORDER_ITEM_KIND_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainOrderItemKind enum. +func (e V1DomainOrderItemKind) Valid() bool { + switch e { + case DOMAINORDERITEMKINDPRIVACY: + return true + case DOMAINORDERITEMKINDREGISTER: + return true + case DOMAINORDERITEMKINDRENEW: + return true + case DOMAINORDERITEMKINDRESTORE: + return true + case DOMAINORDERITEMKINDTRANSFERIN: + return true + case DOMAINORDERITEMKINDUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainOrderItemStage. +const ( + DOMAINORDERITEMSTAGEDNS V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_DNS" + DOMAINORDERITEMSTAGEDNSSEC V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_DNSSEC" + DOMAINORDERITEMSTAGEDONE V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_DONE" + DOMAINORDERITEMSTAGEFAILED V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_FAILED" + DOMAINORDERITEMSTAGEPENDING V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_PENDING" + DOMAINORDERITEMSTAGEREGISTERING V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_REGISTERING" + DOMAINORDERITEMSTAGEUNSPECIFIED V1DomainOrderItemStage = "DOMAIN_ORDER_ITEM_STAGE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainOrderItemStage enum. +func (e V1DomainOrderItemStage) Valid() bool { + switch e { + case DOMAINORDERITEMSTAGEDNS: + return true + case DOMAINORDERITEMSTAGEDNSSEC: + return true + case DOMAINORDERITEMSTAGEDONE: + return true + case DOMAINORDERITEMSTAGEFAILED: + return true + case DOMAINORDERITEMSTAGEPENDING: + return true + case DOMAINORDERITEMSTAGEREGISTERING: + return true + case DOMAINORDERITEMSTAGEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainOrderItemState. +const ( + DOMAINORDERITEMSTATECANCELED V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_CANCELED" + DOMAINORDERITEMSTATEFAILED V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_FAILED" + DOMAINORDERITEMSTATEPENDING V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_PENDING" + DOMAINORDERITEMSTATESUBMITTED V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_SUBMITTED" + DOMAINORDERITEMSTATESUCCEEDED V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_SUCCEEDED" + DOMAINORDERITEMSTATEUNSPECIFIED V1DomainOrderItemState = "DOMAIN_ORDER_ITEM_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainOrderItemState enum. +func (e V1DomainOrderItemState) Valid() bool { + switch e { + case DOMAINORDERITEMSTATECANCELED: + return true + case DOMAINORDERITEMSTATEFAILED: + return true + case DOMAINORDERITEMSTATEPENDING: + return true + case DOMAINORDERITEMSTATESUBMITTED: + return true + case DOMAINORDERITEMSTATESUCCEEDED: + return true + case DOMAINORDERITEMSTATEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainOrderState. +const ( + DOMAINORDERSTATEAUTHORIZED V1DomainOrderState = "DOMAIN_ORDER_STATE_AUTHORIZED" + DOMAINORDERSTATEAWAITINGPAYMENT V1DomainOrderState = "DOMAIN_ORDER_STATE_AWAITING_PAYMENT" + DOMAINORDERSTATECANCELED V1DomainOrderState = "DOMAIN_ORDER_STATE_CANCELED" + DOMAINORDERSTATECOMPLETED V1DomainOrderState = "DOMAIN_ORDER_STATE_COMPLETED" + DOMAINORDERSTATEDRAFT V1DomainOrderState = "DOMAIN_ORDER_STATE_DRAFT" + DOMAINORDERSTATEEXPIRED V1DomainOrderState = "DOMAIN_ORDER_STATE_EXPIRED" + DOMAINORDERSTATEFAILED V1DomainOrderState = "DOMAIN_ORDER_STATE_FAILED" + DOMAINORDERSTATEINREVIEW V1DomainOrderState = "DOMAIN_ORDER_STATE_IN_REVIEW" + DOMAINORDERSTATEPARTIALLYCOMPLETED V1DomainOrderState = "DOMAIN_ORDER_STATE_PARTIALLY_COMPLETED" + DOMAINORDERSTATEPROCESSING V1DomainOrderState = "DOMAIN_ORDER_STATE_PROCESSING" + DOMAINORDERSTATEQUOTED V1DomainOrderState = "DOMAIN_ORDER_STATE_QUOTED" + DOMAINORDERSTATEUNSPECIFIED V1DomainOrderState = "DOMAIN_ORDER_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainOrderState enum. +func (e V1DomainOrderState) Valid() bool { + switch e { + case DOMAINORDERSTATEAUTHORIZED: + return true + case DOMAINORDERSTATEAWAITINGPAYMENT: + return true + case DOMAINORDERSTATECANCELED: + return true + case DOMAINORDERSTATECOMPLETED: + return true + case DOMAINORDERSTATEDRAFT: + return true + case DOMAINORDERSTATEEXPIRED: + return true + case DOMAINORDERSTATEFAILED: + return true + case DOMAINORDERSTATEINREVIEW: + return true + case DOMAINORDERSTATEPARTIALLYCOMPLETED: + return true + case DOMAINORDERSTATEPROCESSING: + return true + case DOMAINORDERSTATEQUOTED: + return true + case DOMAINORDERSTATEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainTransferInState. +const ( + DOMAINTRANSFERINSTATEAUTHCODEREJECTED V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_AUTH_CODE_REJECTED" + DOMAINTRANSFERINSTATECOMPLETED V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_COMPLETED" + DOMAINTRANSFERINSTATEFAILED V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_FAILED" + DOMAINTRANSFERINSTATENONE V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_NONE" + DOMAINTRANSFERINSTATEPENDING V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_PENDING" + DOMAINTRANSFERINSTATEUNSPECIFIED V1DomainTransferInState = "DOMAIN_TRANSFER_IN_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainTransferInState enum. +func (e V1DomainTransferInState) Valid() bool { + switch e { + case DOMAINTRANSFERINSTATEAUTHCODEREJECTED: + return true + case DOMAINTRANSFERINSTATECOMPLETED: + return true + case DOMAINTRANSFERINSTATEFAILED: + return true + case DOMAINTRANSFERINSTATENONE: + return true + case DOMAINTRANSFERINSTATEPENDING: + return true + case DOMAINTRANSFERINSTATEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainTransferOutState. +const ( + DOMAINTRANSFEROUTSTATEAPPROVED V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_APPROVED" + DOMAINTRANSFEROUTSTATECOMPLETED V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_COMPLETED" + DOMAINTRANSFEROUTSTATENONE V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_NONE" + DOMAINTRANSFEROUTSTATEPENDING V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_PENDING" + DOMAINTRANSFEROUTSTATEREJECTED V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_REJECTED" + DOMAINTRANSFEROUTSTATEUNSPECIFIED V1DomainTransferOutState = "DOMAIN_TRANSFER_OUT_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainTransferOutState enum. +func (e V1DomainTransferOutState) Valid() bool { + switch e { + case DOMAINTRANSFEROUTSTATEAPPROVED: + return true + case DOMAINTRANSFEROUTSTATECOMPLETED: + return true + case DOMAINTRANSFEROUTSTATENONE: + return true + case DOMAINTRANSFEROUTSTATEPENDING: + return true + case DOMAINTRANSFEROUTSTATEREJECTED: + return true + case DOMAINTRANSFEROUTSTATEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1DomainVerificationStatus. +const ( + DOMAINVERIFICATIONSTATUSFAILED V1DomainVerificationStatus = "DOMAIN_VERIFICATION_STATUS_FAILED" + DOMAINVERIFICATIONSTATUSPENDING V1DomainVerificationStatus = "DOMAIN_VERIFICATION_STATUS_PENDING" + DOMAINVERIFICATIONSTATUSUNSPECIFIED V1DomainVerificationStatus = "DOMAIN_VERIFICATION_STATUS_UNSPECIFIED" + DOMAINVERIFICATIONSTATUSVERIFIED V1DomainVerificationStatus = "DOMAIN_VERIFICATION_STATUS_VERIFIED" +) + +// Valid indicates whether the value is a known member of the V1DomainVerificationStatus enum. +func (e V1DomainVerificationStatus) Valid() bool { + switch e { + case DOMAINVERIFICATIONSTATUSFAILED: + return true + case DOMAINVERIFICATIONSTATUSPENDING: + return true + case DOMAINVERIFICATIONSTATUSUNSPECIFIED: + return true + case DOMAINVERIFICATIONSTATUSVERIFIED: + return true + default: + return false + } +} + // Defines values for V1InboundPeeringState. const ( INBOUNDPEERINGSTATEFAILED V1InboundPeeringState = "INBOUND_PEERING_STATE_FAILED" @@ -127,6 +520,81 @@ func (e V1PlatformDriver) Valid() bool { } } +// Defines values for V1RegisteredDomainState. +const ( + V1RegisteredDomainStateREGISTEREDDOMAINSTATEACTIVE V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_ACTIVE" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEDELETED V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_DELETED" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEEXPIRED V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_EXPIRED" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEEXPIRING V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_EXPIRING" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEFAILED V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_FAILED" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEPENDINGDELETE V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_PENDING_DELETE" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEREDEMPTION V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_REDEMPTION" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEREGISTERING V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_REGISTERING" + V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFERINPENDING V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_TRANSFER_IN_PENDING" + V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFEROUTPENDING V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_TRANSFER_OUT_PENDING" + V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFERREDOUT V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_TRANSFERRED_OUT" + V1RegisteredDomainStateREGISTEREDDOMAINSTATEUNSPECIFIED V1RegisteredDomainState = "REGISTERED_DOMAIN_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1RegisteredDomainState enum. +func (e V1RegisteredDomainState) Valid() bool { + switch e { + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEACTIVE: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEDELETED: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEEXPIRED: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEEXPIRING: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEFAILED: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEPENDINGDELETE: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEREDEMPTION: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEREGISTERING: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFERINPENDING: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFEROUTPENDING: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATETRANSFERREDOUT: + return true + case V1RegisteredDomainStateREGISTEREDDOMAINSTATEUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1RegistrantChangeState. +const ( + REGISTRANTCHANGESTATEAPPROVED V1RegistrantChangeState = "REGISTRANT_CHANGE_STATE_APPROVED" + REGISTRANTCHANGESTATEEXPIRED V1RegistrantChangeState = "REGISTRANT_CHANGE_STATE_EXPIRED" + REGISTRANTCHANGESTATEPENDING V1RegistrantChangeState = "REGISTRANT_CHANGE_STATE_PENDING" + REGISTRANTCHANGESTATEREJECTED V1RegistrantChangeState = "REGISTRANT_CHANGE_STATE_REJECTED" + REGISTRANTCHANGESTATEUNSPECIFIED V1RegistrantChangeState = "REGISTRANT_CHANGE_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1RegistrantChangeState enum. +func (e V1RegistrantChangeState) Valid() bool { + switch e { + case REGISTRANTCHANGESTATEAPPROVED: + return true + case REGISTRANTCHANGESTATEEXPIRED: + return true + case REGISTRANTCHANGESTATEPENDING: + return true + case REGISTRANTCHANGESTATEREJECTED: + return true + case REGISTRANTCHANGESTATEUNSPECIFIED: + return true + default: + return false + } +} + // Defines values for V1ServiceStatus. const ( SERVICESTATUSMAINTENANCE V1ServiceStatus = "SERVICE_STATUS_MAINTENANCE" @@ -151,6 +619,93 @@ func (e V1ServiceStatus) Valid() bool { } } +// Defines values for V1TldCategory. +const ( + TLDCATEGORYBUSINESS V1TldCategory = "TLD_CATEGORY_BUSINESS" + TLDCATEGORYCOMMUNITY V1TldCategory = "TLD_CATEGORY_COMMUNITY" + TLDCATEGORYCOUNTRY V1TldCategory = "TLD_CATEGORY_COUNTRY" + TLDCATEGORYCREATIVE V1TldCategory = "TLD_CATEGORY_CREATIVE" + TLDCATEGORYGENERIC V1TldCategory = "TLD_CATEGORY_GENERIC" + TLDCATEGORYGEOGRAPHIC V1TldCategory = "TLD_CATEGORY_GEOGRAPHIC" + TLDCATEGORYLIFESTYLE V1TldCategory = "TLD_CATEGORY_LIFESTYLE" + TLDCATEGORYOTHER V1TldCategory = "TLD_CATEGORY_OTHER" + TLDCATEGORYSHOPPING V1TldCategory = "TLD_CATEGORY_SHOPPING" + TLDCATEGORYTECH V1TldCategory = "TLD_CATEGORY_TECH" + TLDCATEGORYUNSPECIFIED V1TldCategory = "TLD_CATEGORY_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1TldCategory enum. +func (e V1TldCategory) Valid() bool { + switch e { + case TLDCATEGORYBUSINESS: + return true + case TLDCATEGORYCOMMUNITY: + return true + case TLDCATEGORYCOUNTRY: + return true + case TLDCATEGORYCREATIVE: + return true + case TLDCATEGORYGENERIC: + return true + case TLDCATEGORYGEOGRAPHIC: + return true + case TLDCATEGORYLIFESTYLE: + return true + case TLDCATEGORYOTHER: + return true + case TLDCATEGORYSHOPPING: + return true + case TLDCATEGORYTECH: + return true + case TLDCATEGORYUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1TldEligibility. +const ( + TLDELIGIBILITYANYONE V1TldEligibility = "TLD_ELIGIBILITY_ANYONE" + TLDELIGIBILITYRESIDENTSONLY V1TldEligibility = "TLD_ELIGIBILITY_RESIDENTS_ONLY" + TLDELIGIBILITYUNSPECIFIED V1TldEligibility = "TLD_ELIGIBILITY_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1TldEligibility enum. +func (e V1TldEligibility) Valid() bool { + switch e { + case TLDELIGIBILITYANYONE: + return true + case TLDELIGIBILITYRESIDENTSONLY: + return true + case TLDELIGIBILITYUNSPECIFIED: + return true + default: + return false + } +} + +// Defines values for V1TldRiskTier. +const ( + TLDRISKTIERHIGH V1TldRiskTier = "TLD_RISK_TIER_HIGH" + TLDRISKTIERNORMAL V1TldRiskTier = "TLD_RISK_TIER_NORMAL" + TLDRISKTIERUNSPECIFIED V1TldRiskTier = "TLD_RISK_TIER_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the V1TldRiskTier enum. +func (e V1TldRiskTier) Valid() bool { + switch e { + case TLDRISKTIERHIGH: + return true + case TLDRISKTIERNORMAL: + return true + case TLDRISKTIERUNSPECIFIED: + return true + default: + return false + } +} + // Defines values for AgentServiceListAgentsParamsGatewayRegion. const ( AgentServiceListAgentsParamsGatewayRegionAGENTGATEWAYREGIONAMS01 AgentServiceListAgentsParamsGatewayRegion = "AGENT_GATEWAY_REGION_AMS01" @@ -169,6 +724,54 @@ func (e AgentServiceListAgentsParamsGatewayRegion) Valid() bool { } } +// Defines values for RegisteredDomainServiceListRegisteredDomainsParamsStates. +const ( + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEACTIVE RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_ACTIVE" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEDELETED RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_DELETED" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEEXPIRED RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_EXPIRED" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEEXPIRING RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_EXPIRING" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEFAILED RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_FAILED" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEPENDINGDELETE RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_PENDING_DELETE" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEREDEMPTION RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_REDEMPTION" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEREGISTERING RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_REGISTERING" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFERINPENDING RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_TRANSFER_IN_PENDING" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFEROUTPENDING RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_TRANSFER_OUT_PENDING" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFERREDOUT RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_TRANSFERRED_OUT" + RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEUNSPECIFIED RegisteredDomainServiceListRegisteredDomainsParamsStates = "REGISTERED_DOMAIN_STATE_UNSPECIFIED" +) + +// Valid indicates whether the value is a known member of the RegisteredDomainServiceListRegisteredDomainsParamsStates enum. +func (e RegisteredDomainServiceListRegisteredDomainsParamsStates) Valid() bool { + switch e { + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEACTIVE: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEDELETED: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEEXPIRED: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEEXPIRING: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEFAILED: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEPENDINGDELETE: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEREDEMPTION: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEREGISTERING: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFERINPENDING: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFEROUTPENDING: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATETRANSFERREDOUT: + return true + case RegisteredDomainServiceListRegisteredDomainsParamsStatesREGISTEREDDOMAINSTATEUNSPECIFIED: + return true + default: + return false + } +} + // AgentServiceGeneratePeeringConfigBody defines model for AgentServiceGeneratePeeringConfigBody. type AgentServiceGeneratePeeringConfigBody = map[string]interface{} @@ -184,9 +787,64 @@ type AgentServiceUploadInboundPeeringConfigBody struct { Kubeconfig *string `json:"kubeconfig,omitempty"` } +// DomainOrderServiceCheckoutDomainOrderBody defines model for DomainOrderServiceCheckoutDomainOrderBody. +type DomainOrderServiceCheckoutDomainOrderBody struct { + AcceptTermsVersion *string `json:"acceptTermsVersion,omitempty"` + ConfirmBillingCountry *bool `json:"confirmBillingCountry,omitempty"` + EvidenceCountry *string `json:"evidenceCountry,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty"` + MitConsent *bool `json:"mitConsent,omitempty"` + PaymentMethodId *string `json:"paymentMethodId,omitempty"` +} + +// DomainOrderServicePriceDomainOrderBody defines model for DomainOrderServicePriceDomainOrderBody. +type DomainOrderServicePriceDomainOrderBody struct { + ConfirmBillingCountry *bool `json:"confirmBillingCountry,omitempty"` + EvidenceCountry *string `json:"evidenceCountry,omitempty"` + PaymentMethodId *string `json:"paymentMethodId,omitempty"` +} + // MetricsCredentialServiceRotateMetricsWriteCredentialBody defines model for MetricsCredentialServiceRotateMetricsWriteCredentialBody. type MetricsCredentialServiceRotateMetricsWriteCredentialBody = map[string]interface{} +// RegisteredDomainServiceGetDomainAuthCodeBody defines model for RegisteredDomainServiceGetDomainAuthCodeBody. +type RegisteredDomainServiceGetDomainAuthCodeBody struct { + ReauthToken *string `json:"reauthToken,omitempty"` +} + +// RegisteredDomainServiceRenewDomainBody defines model for RegisteredDomainServiceRenewDomainBody. +type RegisteredDomainServiceRenewDomainBody struct { + IdempotencyKey *string `json:"idempotencyKey,omitempty"` + Years *int32 `json:"years,omitempty"` +} + +// RegisteredDomainServiceSetDomainAutoRenewBody defines model for RegisteredDomainServiceSetDomainAutoRenewBody. +type RegisteredDomainServiceSetDomainAutoRenewBody struct { + AutoRenew *bool `json:"autoRenew,omitempty"` + MitConsent *bool `json:"mitConsent,omitempty"` + PaymentMethodId *string `json:"paymentMethodId,omitempty"` + WhoisPrivacyAutoRenew *bool `json:"whoisPrivacyAutoRenew,omitempty"` +} + +// RegisteredDomainServiceSetDomainDnssecBody defines model for RegisteredDomainServiceSetDomainDnssecBody. +type RegisteredDomainServiceSetDomainDnssecBody struct { + Dnskeys *[]V1DomainDnskeyRecord `json:"dnskeys,omitempty"` + DsRecords *[]V1DomainDsRecord `json:"dsRecords,omitempty"` + Mode *V1DomainDnssecMode `json:"mode,omitempty"` +} + +// RegisteredDomainServiceSetDomainNameserversBody defines model for RegisteredDomainServiceSetDomainNameserversBody. +type RegisteredDomainServiceSetDomainNameserversBody struct { + Nameservers *[]string `json:"nameservers,omitempty"` + NsMode *V1DomainNsMode `json:"nsMode,omitempty"` +} + +// RegisteredDomainServiceSetDomainTransferLockBody defines model for RegisteredDomainServiceSetDomainTransferLockBody. +type RegisteredDomainServiceSetDomainTransferLockBody struct { + Locked *bool `json:"locked,omitempty"` + ReauthToken *string `json:"reauthToken,omitempty"` +} + // ServiceAccountServiceGenerateTokenBody defines model for ServiceAccountServiceGenerateTokenBody. type ServiceAccountServiceGenerateTokenBody struct { ExpiresInDays *int32 `json:"expiresInDays,omitempty"` @@ -232,6 +890,34 @@ type V1Agent struct { // V1AgentGatewayRegion defines model for v1AgentGatewayRegion. type V1AgentGatewayRegion string +// V1CheckDomainsRequest defines model for v1CheckDomainsRequest. +type V1CheckDomainsRequest struct { + Names *[]string `json:"names,omitempty"` +} + +// V1CheckDomainsResponse defines model for v1CheckDomainsResponse. +type V1CheckDomainsResponse struct { + Results *[]V1DomainSearchResult `json:"results,omitempty"` +} + +// V1CheckTransferRequest defines model for v1CheckTransferRequest. +type V1CheckTransferRequest struct { + Names *[]string `json:"names,omitempty"` +} + +// V1CheckTransferResponse defines model for v1CheckTransferResponse. +type V1CheckTransferResponse struct { + Results *[]V1TransferCheckResult `json:"results,omitempty"` +} + +// V1CheckoutDomainOrderResponse defines model for v1CheckoutDomainOrderResponse. +type V1CheckoutDomainOrderResponse struct { + Order *V1DomainOrder `json:"order,omitempty"` + PaymentIntentId *string `json:"paymentIntentId,omitempty"` + RequiresAction *bool `json:"requiresAction,omitempty"` + State *V1DomainOrderState `json:"state,omitempty"` +} + // V1ComponentVersion defines model for v1ComponentVersion. type V1ComponentVersion struct { ChecksumSha256 *string `json:"checksumSha256,omitempty"` @@ -250,6 +936,15 @@ type V1CreateAgentRequest struct { Name *string `json:"name,omitempty"` } +// V1CreateDomainOrderRequest defines model for v1CreateDomainOrderRequest. +type V1CreateDomainOrderRequest struct { + ContactId *string `json:"contactId,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty"` + Items *[]V1DomainOrderItemInput `json:"items,omitempty"` + Nameservers *[]string `json:"nameservers,omitempty"` + NsMode *V1DomainNsMode `json:"nsMode,omitempty"` +} + // V1CreateMetricsWriteCredentialRequest defines model for v1CreateMetricsWriteCredentialRequest. type V1CreateMetricsWriteCredentialRequest struct { AgentId *string `json:"agentId,omitempty"` @@ -270,6 +965,299 @@ type V1CreateServiceAccountRequest struct { Name *string `json:"name,omitempty"` } +// V1DomainAvailability defines model for v1DomainAvailability. +type V1DomainAvailability string + +// V1DomainContact defines model for v1DomainContact. +type V1DomainContact struct { + City *string `json:"city,omitempty"` + ConsentPublish *bool `json:"consentPublish,omitempty"` + Country *string `json:"country,omitempty"` + DomainCount *int32 `json:"domainCount,omitempty"` + Email *string `json:"email,omitempty"` + EmailVerified *bool `json:"emailVerified,omitempty"` + EmailVerifiedAt *time.Time `json:"emailVerifiedAt,omitempty"` + ExtensionData *map[string]interface{} `json:"extensionData,omitempty"` + Fax *string `json:"fax,omitempty"` + FirstName *string `json:"firstName,omitempty"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"isDefault,omitempty"` + Kind *V1DomainContactKind `json:"kind,omitempty"` + Label *string `json:"label,omitempty"` + LastName *string `json:"lastName,omitempty"` + Organization *string `json:"organization,omitempty"` + OrganizationId *string `json:"organizationId,omitempty"` + Phone *string `json:"phone,omitempty"` + PhoneExt *string `json:"phoneExt,omitempty"` + PostalCode *string `json:"postalCode,omitempty"` + State *string `json:"state,omitempty"` + Street *string `json:"street,omitempty"` + Street2 *string `json:"street2,omitempty"` + Timestamps *V1Timestamps `json:"timestamps,omitempty"` + VatId *string `json:"vatId,omitempty"` +} + +// V1DomainContactKind defines model for v1DomainContactKind. +type V1DomainContactKind string + +// V1DomainDnskeyRecord defines model for v1DomainDnskeyRecord. +type V1DomainDnskeyRecord struct { + Algorithm *int64 `json:"algorithm,omitempty"` + Flags *int64 `json:"flags,omitempty"` + Protocol *int64 `json:"protocol,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` +} + +// V1DomainDnssec defines model for v1DomainDnssec. +type V1DomainDnssec struct { + Allowed *bool `json:"allowed,omitempty"` + Dnskeys *[]V1DomainDnskeyRecord `json:"dnskeys,omitempty"` + DsAtParent *bool `json:"dsAtParent,omitempty"` + DsDataSupported *bool `json:"dsDataSupported,omitempty"` + DsRecords *[]V1DomainDsRecord `json:"dsRecords,omitempty"` + Mode *V1DomainDnssecMode `json:"mode,omitempty"` + SafeToDisableAt *time.Time `json:"safeToDisableAt,omitempty"` + Status *V1DomainDnssecStatus `json:"status,omitempty"` +} + +// V1DomainDnssecMode defines model for v1DomainDnssecMode. +type V1DomainDnssecMode string + +// V1DomainDnssecStatus defines model for v1DomainDnssecStatus. +type V1DomainDnssecStatus string + +// V1DomainDsRecord defines model for v1DomainDsRecord. +type V1DomainDsRecord struct { + Algorithm *int64 `json:"algorithm,omitempty"` + Digest *string `json:"digest,omitempty"` + DigestType *int64 `json:"digestType,omitempty"` + KeyTag *int64 `json:"keyTag,omitempty"` +} + +// V1DomainHold defines model for v1DomainHold. +type V1DomainHold string + +// V1DomainNsMode defines model for v1DomainNsMode. +type V1DomainNsMode string + +// V1DomainOrder defines model for v1DomainOrder. +type V1DomainOrder struct { + CompletedAt *time.Time `json:"completedAt,omitempty"` + Currency *string `json:"currency,omitempty"` + FailureCode *string `json:"failureCode,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + Id *string `json:"id,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty"` + Items *[]V1DomainOrderItem `json:"items,omitempty"` + MitConsent *bool `json:"mitConsent,omitempty"` + OrganizationId *string `json:"organizationId,omitempty"` + PaymentMethodId *string `json:"paymentMethodId,omitempty"` + QuoteExpiresAt *time.Time `json:"quoteExpiresAt,omitempty"` + State *V1DomainOrderState `json:"state,omitempty"` + Subtotal *string `json:"subtotal,omitempty"` + TaxAmount *string `json:"taxAmount,omitempty"` + TermsAcceptedAt *time.Time `json:"termsAcceptedAt,omitempty"` + TermsVersion *string `json:"termsVersion,omitempty"` + Timestamps *V1Timestamps `json:"timestamps,omitempty"` + Total *string `json:"total,omitempty"` +} + +// V1DomainOrderItem defines model for v1DomainOrderItem. +type V1DomainOrderItem struct { + AutoRenew *bool `json:"autoRenew,omitempty"` + Availability *V1DomainAvailability `json:"availability,omitempty"` + ContactId *string `json:"contactId,omitempty"` + Currency *string `json:"currency,omitempty"` + Dnssec *bool `json:"dnssec,omitempty"` + DnssecAllowed *bool `json:"dnssecAllowed,omitempty"` + DnssecPublished *bool `json:"dnssecPublished,omitempty"` + DomainName *string `json:"domainName,omitempty"` + ExtensionData *map[string]interface{} `json:"extensionData,omitempty"` + FailureCode *string `json:"failureCode,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + HasAuthCode *bool `json:"hasAuthCode,omitempty"` + Id *string `json:"id,omitempty"` + ImportNameserversFromRegistry *bool `json:"importNameserversFromRegistry,omitempty"` + Kind *V1DomainOrderItemKind `json:"kind,omitempty"` + LineTotal *string `json:"lineTotal,omitempty"` + MaxYears *int32 `json:"maxYears,omitempty"` + MinYears *int32 `json:"minYears,omitempty"` + Nameservers *[]string `json:"nameservers,omitempty"` + NsMode *V1DomainNsMode `json:"nsMode,omitempty"` + PrivacyAllowed *bool `json:"privacyAllowed,omitempty"` + PrivacyPrice *string `json:"privacyPrice,omitempty"` + RegisteredDomainId *string `json:"registeredDomainId,omitempty"` + RenewalPrice *string `json:"renewalPrice,omitempty"` + RequiresExtensionData *bool `json:"requiresExtensionData,omitempty"` + SellPrice *string `json:"sellPrice,omitempty"` + Stage *V1DomainOrderItemStage `json:"stage,omitempty"` + StarterRecords *[]V1DomainStarterRecord `json:"starterRecords,omitempty"` + State *V1DomainOrderItemState `json:"state,omitempty"` + TaxAmount *string `json:"taxAmount,omitempty"` + Tld *string `json:"tld,omitempty"` + UnavailableReason *string `json:"unavailableReason,omitempty"` + WhoisPrivacy *bool `json:"whoisPrivacy,omitempty"` + Years *int32 `json:"years,omitempty"` + ZoneCreated *bool `json:"zoneCreated,omitempty"` +} + +// V1DomainOrderItemInput defines model for v1DomainOrderItemInput. +type V1DomainOrderItemInput struct { + AuthCode *string `json:"authCode,omitempty"` + AutoRenew *bool `json:"autoRenew,omitempty"` + ContactId *string `json:"contactId,omitempty"` + Dnssec *bool `json:"dnssec,omitempty"` + DomainName *string `json:"domainName,omitempty"` + ExtensionData *map[string]interface{} `json:"extensionData,omitempty"` + ImportNameserversFromRegistry *bool `json:"importNameserversFromRegistry,omitempty"` + Kind *V1DomainOrderItemKind `json:"kind,omitempty"` + Nameservers *[]string `json:"nameservers,omitempty"` + NsMode *V1DomainNsMode `json:"nsMode,omitempty"` + StarterRecords *[]V1DomainStarterRecord `json:"starterRecords,omitempty"` + WhoisPrivacy *bool `json:"whoisPrivacy,omitempty"` + Years *int32 `json:"years,omitempty"` +} + +// V1DomainOrderItemKind defines model for v1DomainOrderItemKind. +type V1DomainOrderItemKind string + +// V1DomainOrderItemStage defines model for v1DomainOrderItemStage. +type V1DomainOrderItemStage string + +// V1DomainOrderItemState defines model for v1DomainOrderItemState. +type V1DomainOrderItemState string + +// V1DomainOrderQuote defines model for v1DomainOrderQuote. +type V1DomainOrderQuote struct { + BillingCountryConfirmationRequired *bool `json:"billingCountryConfirmationRequired,omitempty"` + Currency *string `json:"currency,omitempty"` + Lines *[]V1DomainOrderQuoteLine `json:"lines,omitempty"` + MitConsentRequired *bool `json:"mitConsentRequired,omitempty"` + MitConsentText *string `json:"mitConsentText,omitempty"` + OrderId *string `json:"orderId,omitempty"` + QuoteExpiresAt *time.Time `json:"quoteExpiresAt,omitempty"` + State *V1DomainOrderState `json:"state,omitempty"` + Subtotal *string `json:"subtotal,omitempty"` + TaxAmount *string `json:"taxAmount,omitempty"` + TaxBreakdown *[]V1DomainTaxLine `json:"taxBreakdown,omitempty"` + TaxRequiresAddress *bool `json:"taxRequiresAddress,omitempty"` + TermsUrl *string `json:"termsUrl,omitempty"` + TermsVersion *string `json:"termsVersion,omitempty"` + Total *string `json:"total,omitempty"` +} + +// V1DomainOrderQuoteLine defines model for v1DomainOrderQuoteLine. +type V1DomainOrderQuoteLine struct { + Available *bool `json:"available,omitempty"` + Description *string `json:"description,omitempty"` + DomainName *string `json:"domainName,omitempty"` + ItemId *string `json:"itemId,omitempty"` + Kind *V1DomainOrderItemKind `json:"kind,omitempty"` + PriceChanged *bool `json:"priceChanged,omitempty"` + PrivacyPrice *string `json:"privacyPrice,omitempty"` + RenewalPrice *string `json:"renewalPrice,omitempty"` + SellPrice *string `json:"sellPrice,omitempty"` + Subtotal *string `json:"subtotal,omitempty"` + TaxAmount *string `json:"taxAmount,omitempty"` + Total *string `json:"total,omitempty"` + UnavailableReason *string `json:"unavailableReason,omitempty"` + Years *int32 `json:"years,omitempty"` +} + +// V1DomainOrderState defines model for v1DomainOrderState. +type V1DomainOrderState string + +// V1DomainRenewalInfo defines model for v1DomainRenewalInfo. +type V1DomainRenewalInfo struct { + Currency *string `json:"currency,omitempty"` + MaxExtendYears *int32 `json:"maxExtendYears,omitempty"` + NextAttemptAt *time.Time `json:"nextAttemptAt,omitempty"` + PrivacyPrice *string `json:"privacyPrice,omitempty"` + RenewalPrice *string `json:"renewalPrice,omitempty"` + RestorePrice *string `json:"restorePrice,omitempty"` +} + +// V1DomainSearchResult defines model for v1DomainSearchResult. +type V1DomainSearchResult struct { + Availability *V1DomainAvailability `json:"availability,omitempty"` + Category *V1TldCategory `json:"category,omitempty"` + Currency *string `json:"currency,omitempty"` + DnssecAllowed *bool `json:"dnssecAllowed,omitempty"` + Eligibility *V1TldEligibility `json:"eligibility,omitempty"` + EligibilityNote *string `json:"eligibilityNote,omitempty"` + EligibleCountries *[]string `json:"eligibleCountries,omitempty"` + ExactMatch *bool `json:"exactMatch,omitempty"` + Featured *bool `json:"featured,omitempty"` + FirstYearPrice *string `json:"firstYearPrice,omitempty"` + IsPromotion *bool `json:"isPromotion,omitempty"` + MaxYears *int32 `json:"maxYears,omitempty"` + MinYears *int32 `json:"minYears,omitempty"` + Name *string `json:"name,omitempty"` + OwnedByCaller *bool `json:"ownedByCaller,omitempty"` + PriceGapWarning *bool `json:"priceGapWarning,omitempty"` + PrivacyAllowed *bool `json:"privacyAllowed,omitempty"` + PrivacyPrice *string `json:"privacyPrice,omitempty"` + Reason *string `json:"reason,omitempty"` + RenewalPrice *string `json:"renewalPrice,omitempty"` + RequiresExtensionData *bool `json:"requiresExtensionData,omitempty"` + RiskNote *string `json:"riskNote,omitempty"` + RiskTier *V1TldRiskTier `json:"riskTier,omitempty"` + Suggestion *bool `json:"suggestion,omitempty"` + Tld *string `json:"tld,omitempty"` + TransferPrice *string `json:"transferPrice,omitempty"` +} + +// V1DomainStarterRecord defines model for v1DomainStarterRecord. +type V1DomainStarterRecord struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Value *string `json:"value,omitempty"` + VirtualMachineId *string `json:"virtualMachineId,omitempty"` +} + +// V1DomainTaxLine defines model for v1DomainTaxLine. +type V1DomainTaxLine struct { + Amount *string `json:"amount,omitempty"` + Jurisdiction *string `json:"jurisdiction,omitempty"` + RatePercent *string `json:"ratePercent,omitempty"` + ReverseCharge *bool `json:"reverseCharge,omitempty"` + TaxType *string `json:"taxType,omitempty"` + TaxabilityReason *string `json:"taxabilityReason,omitempty"` +} + +// V1DomainTransferIn defines model for v1DomainTransferIn. +type V1DomainTransferIn struct { + FailureReason *string `json:"failureReason,omitempty"` + OrderId *string `json:"orderId,omitempty"` + OrderItemId *string `json:"orderItemId,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + State *V1DomainTransferInState `json:"state,omitempty"` +} + +// V1DomainTransferInState defines model for v1DomainTransferInState. +type V1DomainTransferInState string + +// V1DomainTransferOut defines model for v1DomainTransferOut. +type V1DomainTransferOut struct { + CompletesAt *time.Time `json:"completesAt,omitempty"` + GainingRegistrar *string `json:"gainingRegistrar,omitempty"` + State *V1DomainTransferOutState `json:"state,omitempty"` +} + +// V1DomainTransferOutState defines model for v1DomainTransferOutState. +type V1DomainTransferOutState string + +// V1DomainVerification defines model for v1DomainVerification. +type V1DomainVerification struct { + Deadline *time.Time `json:"deadline,omitempty"` + Email *string `json:"email,omitempty"` + LastSentAt *time.Time `json:"lastSentAt,omitempty"` + Status *V1DomainVerificationStatus `json:"status,omitempty"` +} + +// V1DomainVerificationStatus defines model for v1DomainVerificationStatus. +type V1DomainVerificationStatus string + // V1GeneratePeeringConfigResponse defines model for v1GeneratePeeringConfigResponse. type V1GeneratePeeringConfigResponse struct { Config *string `json:"config,omitempty"` @@ -289,6 +1277,12 @@ type V1GetAgentResponse struct { Agent *V1Agent `json:"agent,omitempty"` } +// V1GetDomainAuthCodeResponse defines model for v1GetDomainAuthCodeResponse. +type V1GetDomainAuthCodeResponse struct { + AuthCode *string `json:"authCode,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` +} + // V1GetOrganizationResponse defines model for v1GetOrganizationResponse. type V1GetOrganizationResponse struct { Organization *V1Organization `json:"organization,omitempty"` @@ -303,6 +1297,14 @@ type V1ListAgentsResponse struct { TotalCount *int32 `json:"totalCount,omitempty"` } +// V1ListDomainContactsResponse defines model for v1ListDomainContactsResponse. +type V1ListDomainContactsResponse struct { + Contacts *[]V1DomainContact `json:"contacts,omitempty"` + Page *int32 `json:"page,omitempty"` + PageSize *int32 `json:"pageSize,omitempty"` + TotalCount *int32 `json:"totalCount,omitempty"` +} + // V1ListMetricsWriteCredentialsResponse defines model for v1ListMetricsWriteCredentialsResponse. type V1ListMetricsWriteCredentialsResponse struct { Credentials *[]V1MetricsWriteCredential `json:"credentials,omitempty"` @@ -315,6 +1317,14 @@ type V1ListOrganizationsResponse struct { TotalCount *int32 `json:"totalCount,omitempty"` } +// V1ListRegisteredDomainsResponse defines model for v1ListRegisteredDomainsResponse. +type V1ListRegisteredDomainsResponse struct { + Domains *[]V1RegisteredDomain `json:"domains,omitempty"` + Page *int32 `json:"page,omitempty"` + PageSize *int32 `json:"pageSize,omitempty"` + TotalCount *int32 `json:"totalCount,omitempty"` +} + // V1ListServiceAccountTokensResponse defines model for v1ListServiceAccountTokensResponse. type V1ListServiceAccountTokensResponse struct { Page *int32 `json:"page,omitempty"` @@ -384,12 +1394,79 @@ type V1PlatformVersions struct { SchemaVersion *string `json:"schemaVersion,omitempty"` } +// V1RegisteredDomain defines model for v1RegisteredDomain. +type V1RegisteredDomain struct { + AutoRenew *bool `json:"autoRenew,omitempty"` + DnsZoneId *string `json:"dnsZoneId,omitempty"` + Dnssec *V1DomainDnssec `json:"dnssec,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + Holds *[]V1DomainHold `json:"holds,omitempty"` + Id *string `json:"id,omitempty"` + LastSyncedAt *time.Time `json:"lastSyncedAt,omitempty"` + Name *string `json:"name,omitempty"` + Nameservers *[]string `json:"nameservers,omitempty"` + NsMode *V1DomainNsMode `json:"nsMode,omitempty"` + OperationPending *bool `json:"operationPending,omitempty"` + OrganizationId *string `json:"organizationId,omitempty"` + PrivacyAllowed *bool `json:"privacyAllowed,omitempty"` + RegisteredAt *time.Time `json:"registeredAt,omitempty"` + Registrant *V1DomainContact `json:"registrant,omitempty"` + RegistrantChange *V1RegistrantChange `json:"registrantChange,omitempty"` + RegistrantContactId *string `json:"registrantContactId,omitempty"` + RegistrantDisplayName *string `json:"registrantDisplayName,omitempty"` + RegistrarName *string `json:"registrarName,omitempty"` + RenewBy *time.Time `json:"renewBy,omitempty"` + Renewal *V1DomainRenewalInfo `json:"renewal,omitempty"` + State *V1RegisteredDomainState `json:"state,omitempty"` + TechContact *V1DomainContact `json:"techContact,omitempty"` + Timestamps *V1Timestamps `json:"timestamps,omitempty"` + Tld *string `json:"tld,omitempty"` + TransferIn *V1DomainTransferIn `json:"transferIn,omitempty"` + TransferLock *bool `json:"transferLock,omitempty"` + TransferLockUntil *time.Time `json:"transferLockUntil,omitempty"` + TransferOut *V1DomainTransferOut `json:"transferOut,omitempty"` + Verification *V1DomainVerification `json:"verification,omitempty"` + WhoisPrivacy *bool `json:"whoisPrivacy,omitempty"` + WhoisPrivacyAutoRenew *bool `json:"whoisPrivacyAutoRenew,omitempty"` + WhoisPrivacyPaidUntil *time.Time `json:"whoisPrivacyPaidUntil,omitempty"` +} + +// V1RegisteredDomainState defines model for v1RegisteredDomainState. +type V1RegisteredDomainState string + +// V1RegistrantChange defines model for v1RegistrantChange. +type V1RegistrantChange struct { + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + NewContactId *string `json:"newContactId,omitempty"` + State *V1RegistrantChangeState `json:"state,omitempty"` +} + +// V1RegistrantChangeState defines model for v1RegistrantChangeState. +type V1RegistrantChangeState string + // V1ReplaceRoleForServiceAccountRequest defines model for v1ReplaceRoleForServiceAccountRequest. type V1ReplaceRoleForServiceAccountRequest struct { RoleId *string `json:"roleId,omitempty"` ServiceAccountId *string `json:"serviceAccountId,omitempty"` } +// V1SearchDomainsRequest defines model for v1SearchDomainsRequest. +type V1SearchDomainsRequest struct { + Category *V1TldCategory `json:"category,omitempty"` + ExactOnly *bool `json:"exactOnly,omitempty"` + IncludeSuggestions *bool `json:"includeSuggestions,omitempty"` + Query *string `json:"query,omitempty"` + Tlds *[]string `json:"tlds,omitempty"` + TurnstileToken *string `json:"turnstileToken,omitempty"` +} + +// V1SearchDomainsResponse defines model for v1SearchDomainsResponse. +type V1SearchDomainsResponse struct { + NormalizedLabel *string `json:"normalizedLabel,omitempty"` + Query *string `json:"query,omitempty"` + Results *[]V1DomainSearchResult `json:"results,omitempty"` +} + // V1ServiceAccountResponse defines model for v1ServiceAccountResponse. type V1ServiceAccountResponse struct { ActiveTokenCount *int32 `json:"activeTokenCount,omitempty"` @@ -433,6 +1510,31 @@ type V1Timestamps struct { UpdateTime *time.Time `json:"updateTime,omitempty"` } +// V1TldCategory defines model for v1TldCategory. +type V1TldCategory string + +// V1TldEligibility defines model for v1TldEligibility. +type V1TldEligibility string + +// V1TldRiskTier defines model for v1TldRiskTier. +type V1TldRiskTier string + +// V1TransferCheckResult defines model for v1TransferCheckResult. +type V1TransferCheckResult struct { + AuthCodeRequired *bool `json:"authCodeRequired,omitempty"` + Currency *string `json:"currency,omitempty"` + CurrentNameservers *[]string `json:"currentNameservers,omitempty"` + Eligibility *V1TldEligibility `json:"eligibility,omitempty"` + EligibilityNote *string `json:"eligibilityNote,omitempty"` + EligibleCountries *[]string `json:"eligibleCountries,omitempty"` + IncludesRenewalYear *bool `json:"includesRenewalYear,omitempty"` + Name *string `json:"name,omitempty"` + Reason *string `json:"reason,omitempty"` + TransferPrice *string `json:"transferPrice,omitempty"` + Transferable *bool `json:"transferable,omitempty"` + Warnings *[]string `json:"warnings,omitempty"` +} + // V1UpdateAgentResponse defines model for v1UpdateAgentResponse. type V1UpdateAgentResponse struct { Agent *V1Agent `json:"agent,omitempty"` @@ -474,6 +1576,26 @@ type OrganizationServiceListOrganizationsParams struct { PageSize *int32 `form:"pageSize,omitempty" json:"pageSize,omitempty"` } +// DomainContactServiceListDomainContactsParams defines parameters for DomainContactServiceListDomainContacts. +type DomainContactServiceListDomainContactsParams struct { + Page *int32 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int32 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + Search *string `form:"search,omitempty" json:"search,omitempty"` +} + +// RegisteredDomainServiceListRegisteredDomainsParams defines parameters for RegisteredDomainServiceListRegisteredDomains. +type RegisteredDomainServiceListRegisteredDomainsParams struct { + Page *int32 `form:"page,omitempty" json:"page,omitempty"` + PageSize *int32 `form:"pageSize,omitempty" json:"pageSize,omitempty"` + States *[]RegisteredDomainServiceListRegisteredDomainsParamsStates `form:"states,omitempty" json:"states,omitempty"` + Search *string `form:"search,omitempty" json:"search,omitempty"` + ExpiringSoon *bool `form:"expiringSoon,omitempty" json:"expiringSoon,omitempty"` + NeedsAttention *bool `form:"needsAttention,omitempty" json:"needsAttention,omitempty"` +} + +// RegisteredDomainServiceListRegisteredDomainsParamsStates defines parameters for RegisteredDomainServiceListRegisteredDomains. +type RegisteredDomainServiceListRegisteredDomainsParamsStates string + // ServiceAccountServiceListServiceAccountsParams defines parameters for ServiceAccountServiceListServiceAccounts. type ServiceAccountServiceListServiceAccountsParams struct { IncludeInactive *bool `form:"includeInactive,omitempty" json:"includeInactive,omitempty"` @@ -509,6 +1631,42 @@ type MetricsCredentialServiceCreateMetricsWriteCredentialJSONRequestBody = V1Cre // MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody defines body for MetricsCredentialServiceRotateMetricsWriteCredential for application/json ContentType. type MetricsCredentialServiceRotateMetricsWriteCredentialJSONRequestBody = MetricsCredentialServiceRotateMetricsWriteCredentialBody +// DomainSearchServiceCheckDomainsJSONRequestBody defines body for DomainSearchServiceCheckDomains for application/json ContentType. +type DomainSearchServiceCheckDomainsJSONRequestBody = V1CheckDomainsRequest + +// RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody defines body for RegisteredDomainServiceGetDomainAuthCode for application/json ContentType. +type RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody = RegisteredDomainServiceGetDomainAuthCodeBody + +// RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody defines body for RegisteredDomainServiceSetDomainAutoRenew for application/json ContentType. +type RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody = RegisteredDomainServiceSetDomainAutoRenewBody + +// RegisteredDomainServiceSetDomainDnssecJSONRequestBody defines body for RegisteredDomainServiceSetDomainDnssec for application/json ContentType. +type RegisteredDomainServiceSetDomainDnssecJSONRequestBody = RegisteredDomainServiceSetDomainDnssecBody + +// RegisteredDomainServiceSetDomainTransferLockJSONRequestBody defines body for RegisteredDomainServiceSetDomainTransferLock for application/json ContentType. +type RegisteredDomainServiceSetDomainTransferLockJSONRequestBody = RegisteredDomainServiceSetDomainTransferLockBody + +// RegisteredDomainServiceSetDomainNameserversJSONRequestBody defines body for RegisteredDomainServiceSetDomainNameservers for application/json ContentType. +type RegisteredDomainServiceSetDomainNameserversJSONRequestBody = RegisteredDomainServiceSetDomainNameserversBody + +// RegisteredDomainServiceRenewDomainJSONRequestBody defines body for RegisteredDomainServiceRenewDomain for application/json ContentType. +type RegisteredDomainServiceRenewDomainJSONRequestBody = RegisteredDomainServiceRenewDomainBody + +// DomainOrderServiceCreateDomainOrderJSONRequestBody defines body for DomainOrderServiceCreateDomainOrder for application/json ContentType. +type DomainOrderServiceCreateDomainOrderJSONRequestBody = V1CreateDomainOrderRequest + +// DomainOrderServiceCheckoutDomainOrderJSONRequestBody defines body for DomainOrderServiceCheckoutDomainOrder for application/json ContentType. +type DomainOrderServiceCheckoutDomainOrderJSONRequestBody = DomainOrderServiceCheckoutDomainOrderBody + +// DomainOrderServicePriceDomainOrderJSONRequestBody defines body for DomainOrderServicePriceDomainOrder for application/json ContentType. +type DomainOrderServicePriceDomainOrderJSONRequestBody = DomainOrderServicePriceDomainOrderBody + +// DomainSearchServiceSearchDomainsJSONRequestBody defines body for DomainSearchServiceSearchDomains for application/json ContentType. +type DomainSearchServiceSearchDomainsJSONRequestBody = V1SearchDomainsRequest + +// DomainSearchServiceCheckTransferJSONRequestBody defines body for DomainSearchServiceCheckTransfer for application/json ContentType. +type DomainSearchServiceCheckTransferJSONRequestBody = V1CheckTransferRequest + // RoleServiceReplaceRoleForServiceAccountJSONRequestBody defines body for RoleServiceReplaceRoleForServiceAccount for application/json ContentType. type RoleServiceReplaceRoleForServiceAccountJSONRequestBody = V1ReplaceRoleForServiceAccountRequest diff --git a/internal/cli/domain.go b/internal/cli/domain.go new file mode 100644 index 0000000..2f038c1 --- /dev/null +++ b/internal/cli/domain.go @@ -0,0 +1,915 @@ +package cli + +import ( + "context" + "errors" + "fmt" + "net/http" + "os" + "strconv" + "strings" + "text/tabwriter" + "time" + + "github.com/google/uuid" + "github.com/spf13/cobra" + + "github.com/noderings/cli/internal/api" + generated "github.com/noderings/cli/internal/api/generated" + "github.com/noderings/cli/internal/config" +) + +var domainCmd = &cobra.Command{ + Use: "domain", + Short: "Search, register and manage domain names", + Long: `Search, register, transfer and manage domain names registered through NodeRings. + +Domains are paid by card only (account credit and coupons do not apply). Paid +commands (register, transfer, renew) show the price and ask for confirmation; +--yes skips the prompts but then the terms version (--accept-terms) and, when +auto-renew is on, --mit-consent must be passed explicitly. A card that asks +for 3-D Secure cannot be confirmed from the CLI: the command prints a portal +link where the purchase can be finished.`, +} + +func init() { + + search := &cobra.Command{ + Use: "search ", + Short: "Search for available domain names", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + tlds, _ := cmd.Flags().GetStringSlice("tld") + suggestions, _ := cmd.Flags().GetBool("suggestions") + return domainSearch(ctx, e, args[0], tlds, suggestions) + }), + } + search.Flags().StringSlice("tld", nil, "Only these TLDs (comma-separated, without dot)") + search.Flags().Bool("suggestions", false, "Include name suggestions") + + check := &cobra.Command{ + Use: "check ...", + Short: "Check live availability and price of domain names", + Args: cobra.RangeArgs(1, 25), + RunE: domainRun(func(ctx context.Context, e *domainEnv, _ *cobra.Command, args []string) error { + return domainCheck(ctx, e, args) + }), + } + + list := &cobra.Command{ + Use: "list", + Short: "List the organization's domains", + Args: cobra.NoArgs, + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, _ []string) error { + search, _ := cmd.Flags().GetString("search") + expiring, _ := cmd.Flags().GetBool("expiring-soon") + attention, _ := cmd.Flags().GetBool("needs-attention") + page, _ := cmd.Flags().GetInt32("page") + size, _ := cmd.Flags().GetInt32("page-size") + return domainList(ctx, e, generated.RegisteredDomainServiceListRegisteredDomainsParams{ + Search: optString(search), ExpiringSoon: optBool(expiring), NeedsAttention: optBool(attention), + Page: &page, PageSize: &size, + }) + }), + } + list.Flags().String("search", "", "Only names containing this text") + list.Flags().Bool("expiring-soon", false, "Only domains to renew within 30 days") + list.Flags().Bool("needs-attention", false, "Only domains with a hold, pending verification, failed renewal or outgoing transfer") + list.Flags().Int32("page", 0, "Page number (0-indexed)") + list.Flags().Int32("page-size", 50, "Items per page (max 100)") + + get := &cobra.Command{ + Use: "get ", + Short: "Show a domain", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, _ *cobra.Command, args []string) error { + return domainGet(ctx, e, args[0]) + }), + } + + order := &cobra.Command{ + Use: "order ", + Short: "Show a domain order and the result of each item", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, _ *cobra.Command, args []string) error { + o, err := domainCall[generated.V1DomainOrder](ctx, e, "get domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServiceGetDomainOrder(ctx, args[0]) + }) + if err != nil { + return err + } + return printOrderResult(e, o) + }), + } + + register := &cobra.Command{ + Use: "register ", + Short: "Register a domain name (paid by card)", + Long: `Register a domain name. Creates an order, shows the price with tax, and after +confirmation charges the given card (--card) or the organization's default +card, then waits until the registry confirms. + +Example: + nr domain register example.com --years 2 --contact --accept-terms 2026-12-01 --mit-consent --yes`, + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + in, o, err := orderItemFromFlags(cmd, args[0], generated.DOMAINORDERITEMKINDREGISTER) + if err != nil { + return err + } + return domainOrder(ctx, e, in, contactFlag(cmd), o) + }), + } + addOrderItemFlags(register) + + transfer := &cobra.Command{ + Use: "transfer ", + Short: "Transfer a domain name to NodeRings (paid by card)", + Long: `Transfer a domain from another registrar. Unlock it at the current registrar +and get its auth code first. The auth code is read from --auth-code, the +NR_DOMAIN_AUTH_CODE environment variable, or a prompt.`, + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + in, o, err := orderItemFromFlags(cmd, args[0], generated.DOMAINORDERITEMKINDTRANSFERIN) + if err != nil { + return err + } + code, _ := cmd.Flags().GetString("auth-code") + if code == "" { + code = strings.TrimSpace(os.Getenv("NR_DOMAIN_AUTH_CODE")) + } + keep, _ := cmd.Flags().GetBool("keep-nameservers") + return domainTransfer(ctx, e, in, code, keep, contactFlag(cmd), o) + }), + } + addOrderItemFlags(transfer) + transfer.Flags().String("auth-code", "", "Transfer auth code from the current registrar (or NR_DOMAIN_AUTH_CODE)") + transfer.Flags().Bool("keep-nameservers", false, "Keep the nameservers the domain uses now") + + renew := &cobra.Command{ + Use: "renew ", + Short: "Renew a domain now (paid by card)", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + years, _ := cmd.Flags().GetInt32("years") + return domainRenew(ctx, e, args[0], years, paidFlags(cmd)) + }), + } + renew.Flags().Int32("years", 1, "Years to add (1-10)") + addPaidFlags(renew) + + nameservers := &cobra.Command{Use: "nameservers", Short: "Manage a domain's nameservers"} + nsSet := &cobra.Command{ + Use: "set [nameserver...]", + Short: "Use NodeRings DNS (--noderings) or 2-13 custom nameservers", + Args: cobra.MinimumNArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + nr, _ := cmd.Flags().GetBool("noderings") + return domainSetNameservers(ctx, e, args[0], args[1:], nr) + }), + } + nsSet.Flags().Bool("noderings", false, "Use NodeRings DNS (ans1/ans2.nrings.io)") + nameservers.AddCommand(nsSet) + + autorenew := &cobra.Command{Use: "autorenew", Short: "Turn automatic renewal on or off"} + arOn := &cobra.Command{ + Use: "on ", + Short: "Renew automatically before expiry, charged to a card", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + card, _ := cmd.Flags().GetString("card") + consent, _ := cmd.Flags().GetBool("mit-consent") + yes, _ := cmd.Flags().GetBool("yes") + return domainAutoRenew(ctx, e, args[0], true, card, consent, yes) + }), + } + arOn.Flags().String("card", "", "Card (payment method ID) for renewals; default: the organization's default card") + arOn.Flags().Bool("mit-consent", false, "Consent to automatic renewal charges to the card") + arOn.Flags().Bool("yes", false, "Do not ask for consent; requires --mit-consent") + arOff := &cobra.Command{ + Use: "off ", + Short: "Stop automatic renewal", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, _ *cobra.Command, args []string) error { + return domainAutoRenew(ctx, e, args[0], false, "", false, true) + }), + } + autorenew.AddCommand(arOn, arOff) + + lock := &cobra.Command{Use: "lock", Short: "Turn the registrar transfer lock on or off"} + lockOn := &cobra.Command{ + Use: "on ", + Short: "Lock the domain against transfers", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, _ *cobra.Command, args []string) error { + return domainLock(ctx, e, args[0], true, "") + }), + } + lockOff := &cobra.Command{ + Use: "off ", + Short: "Unlock the domain for a transfer (needs re-authentication)", + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + return domainLock(ctx, e, args[0], false, reauthToken(cmd)) + }), + } + addReauthFlag(lockOff) + lock.AddCommand(lockOn, lockOff) + + dnssec := &cobra.Command{ + Use: "dnssec ", + Short: "Set DNSSEC: managed (NodeRings DNS), off, or custom DS records", + Long: `Set DNSSEC for a domain. + managed NodeRings signs the zone and publishes the keys (NodeRings DNS only) + off remove DNSSEC at the registry + custom publish your own DS records (custom nameservers): + --ds ::: (repeatable)`, + Args: cobra.ExactArgs(2), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + ds, _ := cmd.Flags().GetStringArray("ds") + return domainDnssec(ctx, e, args[0], args[1], ds) + }), + } + dnssec.Flags().StringArray("ds", nil, "DS record key-tag:algorithm:digest-type:digest (custom mode, repeatable)") + + authCode := &cobra.Command{ + Use: "auth-code ", + Short: "Show the transfer auth code (needs re-authentication)", + Long: `Show the domain's transfer auth code. This needs a fresh re-authentication +(password and/or two-factor code). The CLI does not ask for your password; +pass a step-up token from the API (--reauth-token or NR_REAUTH_TOKEN), or +open the printed portal link. Service accounts cannot read auth codes.`, + Args: cobra.ExactArgs(1), + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error { + return domainAuthCode(ctx, e, args[0], reauthToken(cmd)) + }), + } + addReauthFlag(authCode) + + contacts := &cobra.Command{Use: "contacts", Short: "Registrant contacts"} + contactsList := &cobra.Command{ + Use: "list", + Short: "List registrant contacts", + Args: cobra.NoArgs, + RunE: domainRun(func(ctx context.Context, e *domainEnv, cmd *cobra.Command, _ []string) error { + search, _ := cmd.Flags().GetString("search") + return domainContactsList(ctx, e, search) + }), + } + contactsList.Flags().String("search", "", "Only contacts matching this text") + contacts.AddCommand(contactsList) + + domainCmd.AddCommand(search, check, list, get, order, register, transfer, renew, + nameservers, autorenew, lock, dnssec, authCode, contacts) + addOutputFlags(domainCmd) +} + +// addOutputFlags adds --output to every leaf command below cmd. +func addOutputFlags(cmd *cobra.Command) { + for _, c := range cmd.Commands() { + if c.HasSubCommands() { + addOutputFlags(c) + continue + } + c.Flags().StringP("output", "o", config.OutputFormatText, "Output format: text|json") + } +} + +func addPaidFlags(cmd *cobra.Command) { + cmd.Flags().String("card", "", "Card (payment method ID) to charge; default: the organization's default card") + cmd.Flags().String("accept-terms", "", "Accept this version of the domain registration terms (required with --yes)") + cmd.Flags().Bool("mit-consent", false, "Consent to automatic renewal charges to the card (needed when auto-renew is on)") + cmd.Flags().Bool("yes", false, "Skip confirmation prompts") + cmd.Flags().Bool("no-wait", false, "Do not wait for the registry result") +} + +func addOrderItemFlags(cmd *cobra.Command) { + addPaidFlags(cmd) + cmd.Flags().Int32("years", 1, "Registration period in years") + cmd.Flags().String("contact", "", "Registrant contact ID (default: the organization's default contact)") + cmd.Flags().Bool("no-auto-renew", false, "Do not renew automatically") + cmd.Flags().Bool("privacy", false, "Add paid WHOIS privacy where the TLD allows it") + cmd.Flags().StringSlice("nameservers", nil, "Custom nameservers (default: NodeRings DNS)") + cmd.Flags().Bool("no-dnssec", false, "Do not sign the zone with DNSSEC") +} + +func addReauthFlag(cmd *cobra.Command) { + cmd.Flags().String("reauth-token", "", "Step-up token from POST /v1/auth/reauthenticate (or NR_REAUTH_TOKEN)") +} + +func reauthToken(cmd *cobra.Command) string { + t, _ := cmd.Flags().GetString("reauth-token") + if t == "" { + t = os.Getenv("NR_REAUTH_TOKEN") + } + return strings.TrimSpace(t) +} + +func contactFlag(cmd *cobra.Command) string { + c, _ := cmd.Flags().GetString("contact") + return strings.TrimSpace(c) +} + +func paidFlags(cmd *cobra.Command) paidOptions { + var o paidOptions + o.card, _ = cmd.Flags().GetString("card") + o.acceptTerms, _ = cmd.Flags().GetString("accept-terms") + o.mitConsent, _ = cmd.Flags().GetBool("mit-consent") + o.yes, _ = cmd.Flags().GetBool("yes") + o.noWait, _ = cmd.Flags().GetBool("no-wait") + o.card, o.acceptTerms = strings.TrimSpace(o.card), strings.TrimSpace(o.acceptTerms) + return o +} + +func orderItemFromFlags(cmd *cobra.Command, name string, kind generated.V1DomainOrderItemKind) (generated.V1DomainOrderItemInput, paidOptions, error) { + name = normalizeDomainName(name) + in := generated.V1DomainOrderItemInput{Kind: &kind, DomainName: &name} + if kind == generated.DOMAINORDERITEMKINDREGISTER || cmd.Flags().Changed("years") { + years, _ := cmd.Flags().GetInt32("years") + if years < 1 || years > 10 { + return in, paidOptions{}, UsageErrorf("--years must be between 1 and 10") + } + in.Years = &years + } + noAuto, _ := cmd.Flags().GetBool("no-auto-renew") + in.AutoRenew = optBoolAlways(!noAuto) + if privacy, _ := cmd.Flags().GetBool("privacy"); privacy { + in.WhoisPrivacy = optBoolAlways(true) + } + if noDnssec, _ := cmd.Flags().GetBool("no-dnssec"); noDnssec { + in.Dnssec = optBoolAlways(false) + } + if ns, _ := cmd.Flags().GetStringSlice("nameservers"); len(ns) > 0 { + if len(ns) < 2 || len(ns) > 13 { + return in, paidOptions{}, UsageErrorf("--nameservers needs 2 to 13 hostnames") + } + mode := generated.DOMAINNSMODECUSTOM + in.NsMode, in.Nameservers = &mode, &ns + } + o := paidFlags(cmd) + if noAuto && o.mitConsent { + return in, o, UsageErrorf("--mit-consent and --no-auto-renew contradict each other") + } + return in, o, nil +} + +// domainRun builds the environment from flags and config, then runs fn. +func domainRun(fn func(ctx context.Context, e *domainEnv, cmd *cobra.Command, args []string) error) func(*cobra.Command, []string) error { + return func(cmd *cobra.Command, args []string) error { + output, err := resolveOutputFlag(cmd) + if err != nil { + return err + } + cfg, err := config.NewLoader().Load() + if err != nil { + return fmt.Errorf("load config: %w", err) + } + portal := cfg.Frontend.BaseURL + if dev := GetDevFrontendURL(cmd); dev != "" { + portal = dev + } + if portal == "" { + portal = config.DefaultFrontendBaseURL + } + client, err := getAuthenticatedAPIClient(cmd) + if err != nil { + return err + } + e := &domainEnv{ + client: client, + out: os.Stdout, + errOut: os.Stderr, + json: output == config.OutputFormatJSON, + portal: portal, + wait: defaultDomainWait(), + } + if isStdinTerminal() { + e.confirm = confirmYesNo + } + return fn(cmd.Context(), e, cmd, args) + } +} + +func normalizeDomainName(s string) string { + return strings.TrimSuffix(strings.ToLower(strings.TrimSpace(s)), ".") +} + +// ---------------------------------------------------------------- read + +func domainSearch(ctx context.Context, e *domainEnv, query string, tlds []string, suggestions bool) error { + body := generated.DomainSearchServiceSearchDomainsJSONRequestBody{Query: &query} + if len(tlds) > 0 { + clean := make([]string, 0, len(tlds)) + for _, t := range tlds { + clean = append(clean, strings.TrimPrefix(strings.TrimSpace(t), ".")) + } + body.Tlds = &clean + } + if suggestions { + body.IncludeSuggestions = &suggestions + } + res, err := domainCall[generated.V1SearchDomainsResponse](ctx, e, "search domains", func(c *generated.Client) (*http.Response, error) { + return c.DomainSearchServiceSearchDomains(ctx, body) + }) + if err != nil { + return err + } + if e.json { + return writeJSONTo(e.out, res) + } + return printSearchResults(e, derefSlice(res.Results)) +} + +func domainCheck(ctx context.Context, e *domainEnv, names []string) error { + clean := make([]string, 0, len(names)) + for _, n := range names { + clean = append(clean, normalizeDomainName(n)) + } + res, err := domainCall[generated.V1CheckDomainsResponse](ctx, e, "check domains", func(c *generated.Client) (*http.Response, error) { + return c.DomainSearchServiceCheckDomains(ctx, generated.DomainSearchServiceCheckDomainsJSONRequestBody{Names: &clean}) + }) + if err != nil { + return err + } + if e.json { + return writeJSONTo(e.out, res) + } + return printSearchResults(e, derefSlice(res.Results)) +} + +func printSearchResults(e *domainEnv, rows []generated.V1DomainSearchResult) error { + if len(rows) == 0 { + outln(e.out, "No results.") + return nil + } + tw := tabwriter.NewWriter(e.out, 0, 0, 2, ' ', 0) + outln(tw, "NAME\tSTATUS\tFIRST YEAR\tRENEWAL\tNOTE") + for _, r := range rows { + cur := deref(r.Currency) + price := func(p string) string { + if p == "" { + return "-" + } + return p + " " + cur + } + note := deref(r.Reason) + switch { + case deref(r.OwnedByCaller): + note = "yours" + case deref(r.PriceGapWarning): + note = strings.TrimSpace(note + " renewal costs more than the first year") + case deref(r.Eligibility) == generated.TLDELIGIBILITYRESIDENTSONLY && note == "": + note = deref(r.EligibilityNote) + } + outf(tw, "%s\t%s\t%s\t%s\t%s\n", deref(r.Name), stateLabel(string(deref(r.Availability)), "DOMAIN_AVAILABILITY_"), + price(deref(r.FirstYearPrice)), price(deref(r.RenewalPrice)), orDash(note)) + } + if err := tw.Flush(); err != nil { + return err + } + outln(e.out, "Prices exclude tax.") + return nil +} + +func domainList(ctx context.Context, e *domainEnv, params generated.RegisteredDomainServiceListRegisteredDomainsParams) error { + res, err := domainCall[generated.V1ListRegisteredDomainsResponse](ctx, e, "list domains", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceListRegisteredDomains(ctx, ¶ms) + }) + if err != nil { + return err + } + if e.json { + return writeJSONTo(e.out, res) + } + rows := derefSlice(res.Domains) + if len(rows) == 0 { + outln(e.out, "No domains found.") + return nil + } + tw := tabwriter.NewWriter(e.out, 0, 0, 2, ' ', 0) + outln(tw, "NAME\tSTATE\tEXPIRES\tAUTO-RENEW\tLOCKED\tDNS") + for _, d := range rows { + state := stateLabel(string(deref(d.State)), "REGISTERED_DOMAIN_STATE_") + if holds := derefSlice(d.Holds); len(holds) > 0 { + labels := make([]string, 0, len(holds)) + for _, h := range holds { + labels = append(labels, stateLabel(string(h), "DOMAIN_HOLD_")) + } + state += " (hold: " + strings.Join(labels, ", ") + ")" + } + outf(tw, "%s\t%s\t%s\t%s\t%s\t%s\n", deref(d.Name), state, formatDate(d.ExpiresAt), + yesNo(deref(d.AutoRenew)), yesNo(deref(d.TransferLock)), nsLabel(d)) + } + if err := tw.Flush(); err != nil { + return err + } + if res.TotalCount != nil && int(*res.TotalCount) > len(rows) { + outf(e.out, "Showing %d of %d domains; use --page.\n", len(rows), *res.TotalCount) + } + return nil +} + +func domainGet(ctx context.Context, e *domainEnv, name string) error { + d, err := getRegisteredDomain(ctx, e, name) + if err != nil { + return err + } + return printDomain(e, d) +} + +func getRegisteredDomain(ctx context.Context, e *domainEnv, name string) (*generated.V1RegisteredDomain, error) { + name = normalizeDomainName(name) + return domainCall[generated.V1RegisteredDomain](ctx, e, "get domain", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceGetRegisteredDomain(ctx, name) + }) +} + +func printDomain(e *domainEnv, d *generated.V1RegisteredDomain) error { + if e.json { + return writeJSONTo(e.out, d) + } + tw := tabwriter.NewWriter(e.out, 0, 0, 2, ' ', 0) + row := func(k, v string) { outf(tw, "%s:\t%s\n", k, orDash(v)) } + row("Name", deref(d.Name)) + row("State", stateLabel(string(deref(d.State)), "REGISTERED_DOMAIN_STATE_")) + if holds := derefSlice(d.Holds); len(holds) > 0 { + labels := make([]string, 0, len(holds)) + for _, h := range holds { + labels = append(labels, stateLabel(string(h), "DOMAIN_HOLD_")) + } + row("Holds", strings.Join(labels, ", ")) + } + row("Registrar", deref(d.RegistrarName)) + row("Registered", formatDate(d.RegisteredAt)) + row("Expires", formatDate(d.ExpiresAt)) + row("Renew by", formatDate(d.RenewBy)) + ar := yesNo(deref(d.AutoRenew)) + if r := d.Renewal; r != nil && deref(d.AutoRenew) && r.NextAttemptAt != nil { + ar += " (next attempt " + formatDate(r.NextAttemptAt) + ")" + } + row("Auto-renew", ar) + if r := d.Renewal; r != nil && deref(r.RenewalPrice) != "" { + row("Renewal price", deref(r.RenewalPrice)+" "+deref(r.Currency)+" per year") + } + lock := yesNo(deref(d.TransferLock)) + if d.TransferLockUntil != nil { + lock += " (60-day lock until " + formatDate(d.TransferLockUntil) + ")" + } + row("Transfer lock", lock) + row("WHOIS privacy", yesNo(deref(d.WhoisPrivacy))) + row("DNS", nsLabel(*d)) + row("Nameservers", strings.Join(derefSlice(d.Nameservers), ", ")) + if s := d.Dnssec; s != nil { + row("DNSSEC", stateLabel(string(deref(s.Mode)), "DOMAIN_DNSSEC_MODE_")+", "+stateLabel(string(deref(s.Status)), "DOMAIN_DNSSEC_STATUS_")) + } + row("Registrant", deref(d.RegistrantDisplayName)) + if v := d.Verification; v != nil && deref(v.Status) == generated.DOMAINVERIFICATIONSTATUSPENDING { + row("Verification", "pending: confirm the email sent to "+deref(v.Email)+" by "+formatDate(v.Deadline)) + } + if deref(d.OperationPending) { + row("Note", "updating at the registry...") + } + return tw.Flush() +} + +func domainContactsList(ctx context.Context, e *domainEnv, search string) error { + size := int32(100) + params := generated.DomainContactServiceListDomainContactsParams{Search: optString(search), PageSize: &size} + res, err := domainCall[generated.V1ListDomainContactsResponse](ctx, e, "list domain contacts", func(c *generated.Client) (*http.Response, error) { + return c.DomainContactServiceListDomainContacts(ctx, ¶ms) + }) + if err != nil { + return err + } + if e.json { + return writeJSONTo(e.out, res) + } + rows := derefSlice(res.Contacts) + if len(rows) == 0 { + outf(e.out, "No contacts. Create one in the portal: %s\n", strings.TrimRight(e.portal, "/")+"/organization/domains/contacts") + return nil + } + tw := tabwriter.NewWriter(e.out, 0, 0, 2, ' ', 0) + outln(tw, "ID\tNAME\tEMAIL\tCOUNTRY\tDOMAINS\tDEFAULT") + for _, c := range rows { + name := strings.TrimSpace(deref(c.FirstName) + " " + deref(c.LastName)) + if org := deref(c.Organization); org != "" { + name += " (" + org + ")" + } + outf(tw, "%s\t%s\t%s\t%s\t%d\t%s\n", deref(c.Id), name, deref(c.Email), deref(c.Country), deref(c.DomainCount), yesNo(deref(c.IsDefault))) + } + return tw.Flush() +} + +// ---------------------------------------------------------------- paid + +func domainOrder(ctx context.Context, e *domainEnv, item generated.V1DomainOrderItemInput, contact string, o paidOptions) error { + key := uuid.NewString() + items := []generated.V1DomainOrderItemInput{item} + body := generated.DomainOrderServiceCreateDomainOrderJSONRequestBody{Items: &items, IdempotencyKey: &key, ContactId: optString(contact)} + order, err := domainCall[generated.V1DomainOrder](ctx, e, "create domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServiceCreateDomainOrder(ctx, body) + }) + if err != nil { + return explainDomainOrderError(e, "", err) + } + return payDomainOrder(ctx, e, order, o) +} + +func domainTransfer(ctx context.Context, e *domainEnv, item generated.V1DomainOrderItemInput, authCode string, keepNS bool, contact string, o paidOptions) error { + name := deref(item.DomainName) + names := []string{name} + res, err := domainCall[generated.V1CheckTransferResponse](ctx, e, "check transfer", func(c *generated.Client) (*http.Response, error) { + return c.DomainSearchServiceCheckTransfer(ctx, generated.DomainSearchServiceCheckTransferJSONRequestBody{Names: &names}) + }) + if err != nil { + return err + } + results := derefSlice(res.Results) + if len(results) == 0 { + return fmt.Errorf("transfer check returned no result for %s", name) + } + r := results[0] + if !deref(r.Transferable) { + return fmt.Errorf("%s cannot be transferred: %s", name, orDash(deref(r.Reason))) + } + for _, w := range derefSlice(r.Warnings) { + outf(e.errOut, "%s %s\n", markWarn(), w) + } + if deref(r.IncludesRenewalYear) { + outln(e.errOut, "The transfer adds one year to the registration.") + } + if deref(r.AuthCodeRequired) && authCode == "" { + if e.confirm == nil || o.yes { + return UsageErrorf("an auth code is required: pass --auth-code or set NR_DOMAIN_AUTH_CODE") + } + code, err := promptString("Auth code from the current registrar", "") + if err != nil { + return err + } + authCode = strings.TrimSpace(code) + if authCode == "" { + return errors.New("an auth code is required") + } + } + if authCode != "" { + item.AuthCode = &authCode + } + if keepNS { + item.ImportNameserversFromRegistry = optBoolAlways(true) + } + return domainOrder(ctx, e, item, contact, o) +} + +func domainRenew(ctx context.Context, e *domainEnv, name string, years int32, o paidOptions) error { + if years < 1 || years > 10 { + return UsageErrorf("--years must be between 1 and 10") + } + name = normalizeDomainName(name) + key := uuid.NewString() + body := generated.RegisteredDomainServiceRenewDomainJSONRequestBody{Years: &years, IdempotencyKey: &key} + order, err := domainCall[generated.V1DomainOrder](ctx, e, "renew domain", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceRenewDomain(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + return payDomainOrder(ctx, e, order, o) +} + +// ---------------------------------------------------------------- settings + +func domainSetNameservers(ctx context.Context, e *domainEnv, name string, ns []string, noderings bool) error { + name = normalizeDomainName(name) + body := generated.RegisteredDomainServiceSetDomainNameserversJSONRequestBody{} + switch { + case noderings && len(ns) > 0: + return UsageErrorf("pass either --noderings or nameservers, not both") + case noderings: + mode := generated.DOMAINNSMODENODERINGS + body.NsMode = &mode + case len(ns) < 2 || len(ns) > 13: + return UsageErrorf("pass 2 to 13 nameservers, or --noderings") + default: + mode := generated.DOMAINNSMODECUSTOM + body.NsMode, body.Nameservers = &mode, &ns + } + d, err := domainCall[generated.V1RegisteredDomain](ctx, e, "set nameservers", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceSetDomainNameservers(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + return printDomainUpdate(e, d, "Nameservers updated for "+name+".") +} + +func domainAutoRenew(ctx context.Context, e *domainEnv, name string, on bool, card string, consent, yes bool) error { + name = normalizeDomainName(name) + body := generated.RegisteredDomainServiceSetDomainAutoRenewJSONRequestBody{AutoRenew: &on} + if on { + if !consent { + if yes || e.confirm == nil { + return UsageErrorf("turning auto-renew on needs your consent to automatic card charges: pass --mit-consent") + } + if err := askOrCancel(e, "Charge the card automatically to renew "+name+" before it expires? You can turn this off any time.", "pass --mit-consent"); err != nil { + return err + } + consent = true + } + body.MitConsent = &consent + body.PaymentMethodId = optString(strings.TrimSpace(card)) + } + d, err := domainCall[generated.V1RegisteredDomain](ctx, e, "set auto-renew", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceSetDomainAutoRenew(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + return printDomainUpdate(e, d, fmt.Sprintf("Auto-renew %s for %s.", onOff(on), name)) +} + +func domainLock(ctx context.Context, e *domainEnv, name string, locked bool, reauth string) error { + name = normalizeDomainName(name) + if !locked && reauth == "" { + return reauthNeeded(e, name, "Unlocking a domain") + } + body := generated.RegisteredDomainServiceSetDomainTransferLockJSONRequestBody{Locked: &locked, ReauthToken: optString(reauth)} + d, err := domainCall[generated.V1RegisteredDomain](ctx, e, "set transfer lock", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceSetDomainTransferLock(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + return printDomainUpdate(e, d, fmt.Sprintf("Transfer lock %s for %s.", onOff(locked), name)) +} + +func domainDnssec(ctx context.Context, e *domainEnv, name, mode string, ds []string) error { + name = normalizeDomainName(name) + body := generated.RegisteredDomainServiceSetDomainDnssecJSONRequestBody{} + var m generated.V1DomainDnssecMode + switch strings.ToLower(mode) { + case "managed", "on": + m = generated.DOMAINDNSSECMODEMANAGED + case "off": + m = generated.DOMAINDNSSECMODEOFF + case "custom": + m = generated.DOMAINDNSSECMODECUSTOM + if len(ds) == 0 { + return UsageErrorf("custom DNSSEC needs at least one --ds record") + } + records := make([]generated.V1DomainDsRecord, 0, len(ds)) + for _, s := range ds { + r, err := parseDSRecord(s) + if err != nil { + return err + } + records = append(records, r) + } + body.DsRecords = &records + default: + return UsageErrorf("DNSSEC mode must be managed, off or custom") + } + if m != generated.DOMAINDNSSECMODECUSTOM && len(ds) > 0 { + return UsageErrorf("--ds is only used with custom") + } + body.Mode = &m + d, err := domainCall[generated.V1RegisteredDomain](ctx, e, "set DNSSEC", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceSetDomainDnssec(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + return printDomainUpdate(e, d, fmt.Sprintf("DNSSEC set to %s for %s.", strings.ToLower(mode), name)) +} + +func parseDSRecord(s string) (generated.V1DomainDsRecord, error) { + parts := strings.Split(strings.TrimSpace(s), ":") + if len(parts) != 4 { + return generated.V1DomainDsRecord{}, UsageErrorf("--ds %q: want key-tag:algorithm:digest-type:digest", s) + } + nums := make([]int64, 3) + for i := range 3 { + n, err := strconv.ParseUint(parts[i], 10, 16) + if err != nil { + return generated.V1DomainDsRecord{}, UsageErrorf("--ds %q: %q is not a number", s, parts[i]) + } + nums[i] = int64(n) + } + digest := strings.ToUpper(parts[3]) + return generated.V1DomainDsRecord{KeyTag: &nums[0], Algorithm: &nums[1], DigestType: &nums[2], Digest: &digest}, nil +} + +func domainAuthCode(ctx context.Context, e *domainEnv, name, reauth string) error { + name = normalizeDomainName(name) + if reauth == "" { + return reauthNeeded(e, name, "Showing the auth code") + } + body := generated.RegisteredDomainServiceGetDomainAuthCodeJSONRequestBody{ReauthToken: &reauth} + res, err := domainCall[generated.V1GetDomainAuthCodeResponse](ctx, e, "get auth code", func(c *generated.Client) (*http.Response, error) { + return c.RegisteredDomainServiceGetDomainAuthCode(ctx, name, body) + }) + if err != nil { + return explainDomainError(e, name, err) + } + if e.json { + return writeJSONTo(e.out, res) + } + outln(e.out, deref(res.AuthCode)) + if res.ExpiresAt != nil { + outf(e.errOut, "Valid until %s. Treat it like a password.\n", res.ExpiresAt.Format(time.RFC3339)) + } + return nil +} + +// reauthNeeded explains how to do a step-up action the CLI cannot do itself: +// it does not ask for passwords, and service accounts cannot re-authenticate. +func reauthNeeded(e *domainEnv, name, what string) error { + return fmt.Errorf("%s needs a fresh sign-in (password and/or two-factor code), which the CLI does not ask for. "+ + "Do it in the portal: %s, or pass a step-up token from POST /v1/auth/reauthenticate with --reauth-token (or NR_REAUTH_TOKEN). "+ + "Service accounts cannot do this", what, e.domainURL(name)) +} + +// explainDomainError adds next steps to RegisteredDomainService error reasons. +func explainDomainError(e *domainEnv, name string, err error) error { + switch api.ErrorReason(err) { + case "REAUTH_REQUIRED": + return reauthNeeded(e, name, "This action") + case "MIT_CONSENT_REQUIRED": + return errors.New("auto-renew needs your consent to automatic card charges: pass --mit-consent") + case "NO_PAYMENT_METHOD": + return fmt.Errorf("no usable card for renewals. Add a card in the portal: %s", e.domainURL(name)) + case "TRANSFER_LOCK_ACTIVE": + if until := api.ErrorMetadata(err, "until"); until != "" { + return fmt.Errorf("%s is in a 60-day transfer lock until %s", name, until) + } + case "DOMAIN_ON_HOLD": + if hold := api.ErrorMetadata(err, "hold"); hold != "" { + return fmt.Errorf("%s has a %s hold that blocks this action; see %s", name, hold, e.domainURL(name)) + } + case "OPERATION_PENDING": + return fmt.Errorf("an earlier change to %s is still being applied at the registry; try again in a few minutes", name) + case "AUTO_RENEW_ALREADY_CHARGED": + return fmt.Errorf("this term's renewal of %s is already paid, so auto-renew cannot be turned off now", name) + } + return err +} + +func printDomainUpdate(e *domainEnv, d *generated.V1RegisteredDomain, msg string) error { + if e.json { + return writeJSONTo(e.out, d) + } + outln(e.out, msg) + if deref(d.OperationPending) { + outln(e.out, "The registry is applying the change; it can take a few minutes.") + } + return nil +} + +// ---------------------------------------------------------------- helpers + +func nsLabel(d generated.V1RegisteredDomain) string { + switch deref(d.NsMode) { + case generated.DOMAINNSMODENODERINGS: + return "NodeRings" + case generated.DOMAINNSMODECUSTOM: + return "custom" + } + return "-" +} + +func formatDate(t *time.Time) string { + if t == nil || t.IsZero() { + return "-" + } + return t.UTC().Format("2006-01-02") +} + +func yesNo(b bool) string { + if b { + return "yes" + } + return "no" +} + +func onOff(b bool) string { + if b { + return "on" + } + return "off" +} + +func optString(s string) *string { + if s == "" { + return nil + } + return &s +} + +func optBool(b bool) *bool { + if !b { + return nil + } + return &b +} + +func optBoolAlways(b bool) *bool { return &b } diff --git a/internal/cli/domain_order.go b/internal/cli/domain_order.go new file mode 100644 index 0000000..4fb0f2e --- /dev/null +++ b/internal/cli/domain_order.go @@ -0,0 +1,438 @@ +package cli + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "strings" + "text/tabwriter" + "time" + + "github.com/google/uuid" + + "github.com/noderings/cli/internal/api" + generated "github.com/noderings/cli/internal/api/generated" +) + +// domainAPIRetries bounds retries of registrar API calls. Creates and the +// checkout carry an idempotency key, so a retried request never charges twice. +const domainAPIRetries = 3 + +// domainEnv is what the domain commands need; tests build it directly. +type domainEnv struct { + client *api.Client + out io.Writer // results (tables or JSON) + errOut io.Writer // progress and hints + json bool + // portal is the console base URL (frontend.base_url), for links. + portal string + // confirm asks a yes/no question; nil means the question cannot be asked. + confirm func(question, hint string) (bool, error) + wait domainWaitConfig +} + +type domainWaitConfig struct { + interval, maxInterval, timeout time.Duration +} + +func defaultDomainWait() domainWaitConfig { + return domainWaitConfig{interval: 2 * time.Second, maxInterval: 15 * time.Second, timeout: 10 * time.Minute} +} + +func (e *domainEnv) checkoutURL(orderID string) string { + return strings.TrimRight(e.portal, "/") + "/domains/checkout/" + orderID +} + +func (e *domainEnv) domainURL(name string) string { + return strings.TrimRight(e.portal, "/") + "/organization/domains/" + name +} + +// domainCall runs one registrar API call and decodes its JSON response. +func domainCall[T any](ctx context.Context, e *domainEnv, op string, fn func(c *generated.Client) (*http.Response, error)) (*T, error) { + gen := e.client.GetGeneratedClient() + resp, err := e.client.DoWithAutoRefresh(ctx, domainAPIRetries, func() (*http.Response, error) { + return fn(gen) + }) + if err != nil { + return nil, fmt.Errorf("%s: %w", op, err) + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode >= 400 { + return nil, fmt.Errorf("%s: %w", op, api.ParseError(resp)) + } + body, err := readLimitedJSON(resp.Body) + if err != nil { + return nil, fmt.Errorf("%s: read response: %w", op, err) + } + out := new(T) + if len(strings.TrimSpace(string(body))) == 0 { + return out, nil + } + if err := json.Unmarshal(body, out); err != nil { + return nil, fmt.Errorf("%s: decode response: %w", op, err) + } + return out, nil +} + +// paidOptions are the purchase choices shared by register, transfer and renew. +type paidOptions struct { + card string // payment method ID; empty = the organization's default card + acceptTerms string // terms version the caller accepts; never implied + mitConsent bool // consent to automatic renewal charges + yes bool // skip confirmation prompts + noWait bool +} + +// orderFinal reports whether a domain order state will not change any more. +func orderFinal(s generated.V1DomainOrderState) bool { + switch s { + case generated.DOMAINORDERSTATECOMPLETED, generated.DOMAINORDERSTATEPARTIALLYCOMPLETED, + generated.DOMAINORDERSTATEFAILED, generated.DOMAINORDERSTATECANCELED, generated.DOMAINORDERSTATEEXPIRED: + return true + } + return false +} + +// payDomainOrder quotes an order, asks for the explicit acceptances, checks it +// out with a card, and waits for the result. Domains are paid by card only. +func payDomainOrder(ctx context.Context, e *domainEnv, order *generated.V1DomainOrder, o paidOptions) error { + orderID := deref(order.Id) + if orderID == "" { + return errors.New("the API returned an order without an ID") + } + priceBody := generated.DomainOrderServicePriceDomainOrderJSONRequestBody{} + if o.card != "" { + priceBody.PaymentMethodId = &o.card + } + quote, err := domainCall[generated.V1DomainOrderQuote](ctx, e, "price domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServicePriceDomainOrder(ctx, orderID, priceBody) + }) + if err != nil { + return explainDomainOrderError(e, orderID, err) + } + printQuote(e.errOut, quote) + + if deref(quote.TaxRequiresAddress) { + return fmt.Errorf("a billing address is needed to calculate tax. Add it and finish the purchase in the portal: %s", e.checkoutURL(orderID)) + } + if deref(quote.BillingCountryConfirmationRequired) { + return fmt.Errorf("your billing country matches neither the card nor your location and must be confirmed. Finish the purchase in the portal: %s", e.checkoutURL(orderID)) + } + for _, l := range derefSlice(quote.Lines) { + if l.Available != nil && !*l.Available { + return fmt.Errorf("%s is not available: %s", deref(l.DomainName), orDash(deref(l.UnavailableReason))) + } + } + + terms, err := acceptTermsVersion(e, quote, o) + if err != nil { + return err + } + mit, err := mitConsent(e, quote, o) + if err != nil { + return err + } + + // PriceDomainOrder picks the default card when none was named. + current, err := domainCall[generated.V1DomainOrder](ctx, e, "get domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServiceGetDomainOrder(ctx, orderID) + }) + if err != nil { + return err + } + card := o.card + if card == "" { + card = deref(current.PaymentMethodId) + } + if card == "" { + return fmt.Errorf("no card on file. Domains are paid by card only (account credit and coupons do not apply). Add a card and finish the purchase in the portal: %s", e.checkoutURL(orderID)) + } + + if !o.yes { + q := fmt.Sprintf("Charge %s %s to the card for this order?", orDash(deref(quote.Total)), deref(quote.Currency)) + if err := askOrCancel(e, q, "re-run with --yes to skip confirmation"); err != nil { + return err + } + } + + key := uuid.NewString() + body := generated.DomainOrderServiceCheckoutDomainOrderJSONRequestBody{ + PaymentMethodId: &card, + IdempotencyKey: &key, + AcceptTermsVersion: &terms, + MitConsent: &mit, + } + res, err := domainCall[generated.V1CheckoutDomainOrderResponse](ctx, e, "checkout domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServiceCheckoutDomainOrder(ctx, orderID, body) + }) + if err != nil { + return explainDomainOrderError(e, orderID, err) + } + if deref(res.RequiresAction) { + // A signed-in user's card asked for 3-D Secure. The CLI cannot show the + // bank's challenge; the portal checkout page resumes this order. + return fmt.Errorf("your card needs 3-D Secure verification, which only works in a browser. The card is not charged yet. Finish the purchase in the portal: %s", e.checkoutURL(orderID)) + } + + final := res.Order + if res.State != nil && deref(res.State) == generated.DOMAINORDERSTATEINREVIEW { + outln(e.errOut, "The order is in a short manual review. Your card is authorized, not charged; you get an email when it continues.") + } + if !o.noWait { + outln(e.errOut, "Waiting for the registry...") + final, err = waitForDomainOrder(ctx, e, orderID) + if err != nil { + if final != nil { + _ = printOrderResult(e, final) + } + return fmt.Errorf("%w. Check later with: nr domain order %s", err, orderID) + } + } + if final == nil { + final = current + } + if err := printOrderResult(e, final); err != nil { + return err + } + return orderOutcomeError(final) +} + +// waitForDomainOrder polls GetDomainOrder with backoff until the order is final. +func waitForDomainOrder(ctx context.Context, e *domainEnv, orderID string) (*generated.V1DomainOrder, error) { + w := e.wait + if w.interval <= 0 { + w = defaultDomainWait() + } + ctx, cancel := context.WithTimeout(ctx, w.timeout) + defer cancel() + interval := w.interval + var last *generated.V1DomainOrder + for { + order, err := domainCall[generated.V1DomainOrder](ctx, e, "get domain order", func(c *generated.Client) (*http.Response, error) { + return c.DomainOrderServiceGetDomainOrder(ctx, orderID) + }) + if err != nil { + if ctx.Err() != nil { + return last, fmt.Errorf("the order is still being processed after %s (some registries take longer)", w.timeout) + } + return last, err + } + last = order + if orderFinal(deref(order.State)) { + return order, nil + } + select { + case <-ctx.Done(): + return last, fmt.Errorf("the order is still %s after %s (some registries take longer)", stateLabel(string(deref(order.State)), "DOMAIN_ORDER_STATE_"), w.timeout) + case <-time.After(interval): + } + interval = min(interval+interval/2, w.maxInterval) + } +} + +// acceptTermsVersion returns the terms version to send at checkout. Acceptance +// is never implied: it comes from --accept-terms or an answered prompt. +func acceptTermsVersion(e *domainEnv, quote *generated.V1DomainOrderQuote, o paidOptions) (string, error) { + current := deref(quote.TermsVersion) + link := absoluteURL(e.portal, deref(quote.TermsUrl)) + if o.acceptTerms != "" { + if current != "" && o.acceptTerms != current { + return "", fmt.Errorf("--accept-terms %s does not match the current domain terms version %s; read %s and pass --accept-terms %s", o.acceptTerms, current, link, current) + } + return o.acceptTerms, nil + } + if o.yes || e.confirm == nil { + return "", UsageErrorf("accepting the domain registration terms is required: read %s and pass --accept-terms %s", link, current) + } + ok, err := e.confirm(fmt.Sprintf("Do you accept the NodeRings Domain Registration Terms (version %s, %s), the registrar's Registration Agreement and the Registrant Benefits and Responsibilities?", current, link), + "pass --accept-terms "+current) + if err != nil { + return "", err + } + if !ok { + return "", errors.New("canceled: the terms were not accepted") + } + return current, nil +} + +// mitConsent returns the consent to automatic renewal charges, which is needed +// when an item renews automatically. +func mitConsent(e *domainEnv, quote *generated.V1DomainOrderQuote, o paidOptions) (bool, error) { + if o.mitConsent || !deref(quote.MitConsentRequired) { + return o.mitConsent, nil + } + text := deref(quote.MitConsentText) + if text == "" { + text = "Charge this card automatically to renew these domains before they expire. I can turn this off any time." + } + if o.yes || e.confirm == nil { + return false, UsageErrorf("auto-renew needs your consent to automatic card charges (%q): pass --mit-consent, or --no-auto-renew", text) + } + ok, err := e.confirm(text, "pass --mit-consent or --no-auto-renew") + if err != nil { + return false, err + } + if !ok { + return false, errors.New("canceled: without consent to automatic renewal charges, re-run with --no-auto-renew") + } + return true, nil +} + +func askOrCancel(e *domainEnv, question, hint string) error { + if e.confirm == nil { + return UsageErrorf("confirmation required: %s", hint) + } + ok, err := e.confirm(question, hint) + if err != nil { + return err + } + if !ok { + return errors.New("canceled") + } + return nil +} + +// explainDomainOrderError turns checkout error reasons into next steps. +func explainDomainOrderError(e *domainEnv, orderID string, err error) error { + link := e.checkoutURL(orderID) + switch api.ErrorReason(err) { + case "REQUIRES_PORTAL_VERIFICATION": + if u := api.ErrorMetadata(err, "portal_url"); u != "" { + link = u + } + return fmt.Errorf("your card needs 3-D Secure verification, which only works in a browser; API tokens cannot complete it. Nothing was charged. Finish the purchase in the portal: %s", link) + case "CARD_DECLINED": + return fmt.Errorf("the card was declined; nothing was charged. Try another card with --card, or add one in the portal: %s", link) + case "QUOTE_EXPIRED": + return errors.New("the price quote expired; run the command again for a new quote") + case "PRICE_CHANGED": + return errors.New("a price changed since the quote; run the command again to review the new price") + case "NAME_UNAVAILABLE": + name := api.ErrorMetadata(err, "domain") + if name == "" { + name = "a domain in the order" + } + return fmt.Errorf("%s is no longer available; nothing was charged", name) + case "BILLING_ADDRESS_REQUIRED": + return fmt.Errorf("a billing address is needed to calculate tax. Add it and finish the purchase in the portal: %s", link) + case "EVIDENCE_CONFIRMATION_REQUIRED": + return fmt.Errorf("your billing country matches neither the card nor your location and must be confirmed. Finish the purchase in the portal: %s", link) + case "TERMS_NOT_ACCEPTED": + return errors.New("the domain registration terms changed; run the command again and accept the current version with --accept-terms") + case "MIT_CONSENT_REQUIRED": + return errors.New("auto-renew needs your consent to automatic card charges: pass --mit-consent, or --no-auto-renew") + case "CONTACT_REQUIRED": + return errors.New("a registrant contact is required: pass --contact (see nr domain contacts list) or create one in the portal") + case "EMAIL_NOT_VERIFIED": + return errors.New("verify your account email address before buying a domain") + case "PURCHASE_BLOCKED": + return fmt.Errorf("domain purchases are blocked for this organization; contact support (%w)", err) + case "REGISTRAR_UNAVAILABLE": + return errors.New("domain registration is temporarily unavailable; nothing was charged. Try again later") + } + return err +} + +func orderOutcomeError(o *generated.V1DomainOrder) error { + switch deref(o.State) { + case generated.DOMAINORDERSTATECOMPLETED: + return nil + case generated.DOMAINORDERSTATEPARTIALLYCOMPLETED: + return errors.New("the order completed only partly; failed items were not charged") + case generated.DOMAINORDERSTATEFAILED: + msg := deref(o.FailureMessage) + if msg == "" { + msg = "see the items above" + } + return fmt.Errorf("the order failed and nothing was charged: %s", msg) + case generated.DOMAINORDERSTATECANCELED, generated.DOMAINORDERSTATEEXPIRED: + return fmt.Errorf("the order was %s; nothing was charged", stateLabel(string(deref(o.State)), "DOMAIN_ORDER_STATE_")) + } + return nil +} + +func printQuote(w io.Writer, q *generated.V1DomainOrderQuote) { + cur := deref(q.Currency) + tw := tabwriter.NewWriter(w, 0, 0, 2, ' ', 0) + outln(tw, "DOMAIN\tOPERATION\tYEARS\tPRICE\tRENEWS AT") + for _, l := range derefSlice(q.Lines) { + outf(tw, "%s\t%s\t%d\t%s %s\t%s\n", deref(l.DomainName), stateLabel(string(deref(l.Kind)), "DOMAIN_ORDER_ITEM_KIND_"), + deref(l.Years), orDash(deref(l.Subtotal)), cur, orDash(deref(l.RenewalPrice))) + } + _ = tw.Flush() + outf(w, "Subtotal %s %s, tax %s %s, total %s %s\n", orDash(deref(q.Subtotal)), cur, orDash(deref(q.TaxAmount)), cur, orDash(deref(q.Total)), cur) +} + +func printOrderResult(e *domainEnv, o *generated.V1DomainOrder) error { + if e.json { + return writeJSONTo(e.out, o) + } + outf(e.out, "Order %s: %s\n", deref(o.Id), stateLabel(string(deref(o.State)), "DOMAIN_ORDER_STATE_")) + tw := tabwriter.NewWriter(e.out, 0, 0, 2, ' ', 0) + outln(tw, "DOMAIN\tOPERATION\tRESULT\tDETAIL") + for _, it := range derefSlice(o.Items) { + detail := deref(it.FailureMessage) + if detail == "" && deref(it.State) == generated.DOMAINORDERITEMSTATESUBMITTED { + detail = "the registry is still processing it" + } + outf(tw, "%s\t%s\t%s\t%s\n", deref(it.DomainName), stateLabel(string(deref(it.Kind)), "DOMAIN_ORDER_ITEM_KIND_"), + stateLabel(string(deref(it.State)), "DOMAIN_ORDER_ITEM_STATE_"), orDash(detail)) + } + if err := tw.Flush(); err != nil { + return err + } + if t := deref(o.Total); t != "" { + outf(e.out, "Total %s %s\n", t, deref(o.Currency)) + } + return nil +} + +// stateLabel turns DOMAIN_ORDER_STATE_PARTIALLY_COMPLETED into "partially completed". +func stateLabel(v, prefix string) string { + v = strings.TrimPrefix(v, prefix) + if v == "" || strings.HasSuffix(v, "UNSPECIFIED") { + return "-" + } + return strings.ToLower(strings.ReplaceAll(v, "_", " ")) +} + +func absoluteURL(base, ref string) string { + if ref == "" { + return strings.TrimRight(base, "/") + "/legal/domain-terms" + } + if strings.HasPrefix(ref, "http://") || strings.HasPrefix(ref, "https://") { + return ref + } + return strings.TrimRight(base, "/") + "/" + strings.TrimLeft(ref, "/") +} + +func deref[T any](p *T) T { + var zero T + if p == nil { + return zero + } + return *p +} + +func derefSlice[T any](p *[]T) []T { + if p == nil { + return nil + } + return *p +} + +func orDash(s string) string { + if strings.TrimSpace(s) == "" { + return "-" + } + return s +} + +// outf and outln write command output; a failed write to stdout or stderr is +// not actionable here. +func outf(w io.Writer, format string, a ...any) { _, _ = fmt.Fprintf(w, format, a...) } + +func outln(w io.Writer, a ...any) { _, _ = fmt.Fprintln(w, a...) } diff --git a/internal/cli/domain_test.go b/internal/cli/domain_test.go new file mode 100644 index 0000000..38f4c7f --- /dev/null +++ b/internal/cli/domain_test.go @@ -0,0 +1,510 @@ +package cli + +import ( + "bytes" + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" + "time" + + "github.com/noderings/cli/internal/api" + generated "github.com/noderings/cli/internal/api/generated" +) + +const testOrderID = "8a6f2a52-7a39-4c43-9f35-0f2f8c1d6e01" + +// fakeRegistrar is a minimal /v1/registrar API. Handlers can be replaced per test. +type fakeRegistrar struct { + mu sync.Mutex + requests []string + bodies map[string]map[string]any + handlers map[string]func(w http.ResponseWriter, r *http.Request) + polls int +} + +func newFakeRegistrar(t *testing.T) (*fakeRegistrar, *domainEnv, *bytes.Buffer, *bytes.Buffer) { + t.Helper() + f := &fakeRegistrar{bodies: map[string]map[string]any{}, handlers: map[string]func(http.ResponseWriter, *http.Request){}} + f.handlers["POST /v1/registrar/orders"] = jsonReply(`{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_QUOTED"}`) + f.handlers["POST /v1/registrar/orders/"+testOrderID+"/price"] = jsonReply(`{"orderId":"` + testOrderID + `","currency":"USD", + "lines":[{"domainName":"example.com","kind":"DOMAIN_ORDER_ITEM_KIND_REGISTER","years":1,"subtotal":"10.46","renewalPrice":"12.00","available":true}], + "subtotal":"10.46","taxAmount":"2.20","total":"12.66","termsVersion":"2026-12-01","termsUrl":"/legal/domain-terms", + "mitConsentRequired":true,"mitConsentText":"Charge this card automatically to renew."}`) + f.handlers["GET /v1/registrar/orders/"+testOrderID] = func(w http.ResponseWriter, r *http.Request) { + f.mu.Lock() + f.polls++ + n := f.polls + f.mu.Unlock() + state, item := "DOMAIN_ORDER_STATE_QUOTED", "DOMAIN_ORDER_ITEM_STATE_PENDING" + switch { + case n == 2: + state = "DOMAIN_ORDER_STATE_PROCESSING" + case n >= 3: + state, item = "DOMAIN_ORDER_STATE_COMPLETED", "DOMAIN_ORDER_ITEM_STATE_SUCCEEDED" + } + writeTestJSON(w, 200, `{"id":"`+testOrderID+`","state":"`+state+`","paymentMethodId":"pm-default","currency":"USD","total":"12.66", + "items":[{"domainName":"example.com","kind":"DOMAIN_ORDER_ITEM_KIND_REGISTER","state":"`+item+`"}]}`) + } + f.handlers["POST /v1/registrar/orders/"+testOrderID+"/checkout"] = jsonReply(`{"state":"DOMAIN_ORDER_STATE_AUTHORIZED","order":{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_AUTHORIZED"}}`) + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + key := r.Method + " " + r.URL.Path + f.mu.Lock() + f.requests = append(f.requests, key) + if r.Body != nil && (r.Method == http.MethodPost || r.Method == http.MethodPut) { + var body map[string]any + if json.NewDecoder(r.Body).Decode(&body) == nil { + f.bodies[key] = body + } + } + h := f.handlers[key] + f.mu.Unlock() + if r.Header.Get("Authorization") != "Bearer tok" { + t.Errorf("%s: missing token", key) + } + if h == nil { + t.Errorf("unexpected request %s", key) + writeTestJSON(w, 404, `{"code":5,"message":"not found"}`) + return + } + h(w, r) + })) + t.Cleanup(srv.Close) + + client, err := api.NewClient(&api.Config{BaseURL: srv.URL, Timeout: 5 * time.Second}) + if err != nil { + t.Fatal(err) + } + client.SetToken("tok") + out, errOut := &bytes.Buffer{}, &bytes.Buffer{} + e := &domainEnv{ + client: client, out: out, errOut: errOut, portal: "https://noderings.com", + wait: domainWaitConfig{interval: time.Millisecond, maxInterval: 2 * time.Millisecond, timeout: 5 * time.Second}, + } + return f, e, out, errOut +} + +func (f *fakeRegistrar) body(key string) map[string]any { + f.mu.Lock() + defer f.mu.Unlock() + return f.bodies[key] +} + +func (f *fakeRegistrar) called(key string) bool { + f.mu.Lock() + defer f.mu.Unlock() + for _, r := range f.requests { + if r == key { + return true + } + } + return false +} + +func jsonReply(body string) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, _ *http.Request) { writeTestJSON(w, 200, body) } +} + +func writeTestJSON(w http.ResponseWriter, status int, body string) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(status) + _, _ = w.Write([]byte(body)) +} + +func registerItem(name string) (string, paidOptions) { + return name, paidOptions{acceptTerms: "2026-12-01", mitConsent: true, yes: true} +} + +func registerOrder(t *testing.T, e *domainEnv, name string, o paidOptions) error { + t.Helper() + item := orderInput(name, "DOMAIN_ORDER_ITEM_KIND_REGISTER", 1) + return domainOrder(context.Background(), e, item, "contact-1", o) +} + +func TestDomainRegisterHappyPath(t *testing.T) { + t.Parallel() + f, e, out, errOut := newFakeRegistrar(t) + name, o := registerItem("Example.com.") + + if err := registerOrder(t, e, name, o); err != nil { + t.Fatalf("register: %v\nstderr: %s", err, errOut) + } + create := f.body("POST /v1/registrar/orders") + if create["idempotencyKey"] == "" || create["contactId"] != "contact-1" { + t.Errorf("create body %v", create) + } + items, _ := create["items"].([]any) + if len(items) != 1 || items[0].(map[string]any)["domainName"] != "example.com" { + t.Errorf("items %v", items) + } + checkout := f.body("POST /v1/registrar/orders/" + testOrderID + "/checkout") + if checkout["paymentMethodId"] != "pm-default" || checkout["acceptTermsVersion"] != "2026-12-01" || checkout["mitConsent"] != true || checkout["idempotencyKey"] == "" { + t.Errorf("checkout body %v", checkout) + } + if !strings.Contains(errOut.String(), "12.66 USD") { + t.Errorf("quote not shown: %s", errOut) + } + if got := out.String(); !strings.Contains(got, "completed") || !strings.Contains(got, "example.com") || !strings.Contains(got, "succeeded") { + t.Errorf("result: %s", got) + } +} + +func TestDomainRegisterUsesGivenCard(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + name, o := registerItem("example.com") + o.card = "pm-other" + if err := registerOrder(t, e, name, o); err != nil { + t.Fatal(err) + } + if b := f.body("POST /v1/registrar/orders/" + testOrderID + "/price"); b["paymentMethodId"] != "pm-other" { + t.Errorf("price body %v", b) + } + if b := f.body("POST /v1/registrar/orders/" + testOrderID + "/checkout"); b["paymentMethodId"] != "pm-other" { + t.Errorf("checkout body %v", b) + } +} + +func TestDomainRegisterRequiresTermsAcceptance(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + name, o := registerItem("example.com") + o.acceptTerms = "" + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "--accept-terms 2026-12-01") || !strings.Contains(err.Error(), "https://noderings.com/legal/domain-terms") { + t.Fatalf("err = %v", err) + } + if ExitCode(err) != ExitMisuse { + t.Errorf("exit code %d", ExitCode(err)) + } + if f.called("POST /v1/registrar/orders/" + testOrderID + "/checkout") { + t.Error("checked out without accepted terms") + } + + // A stale version is rejected before checkout. + o.acceptTerms = "2025-01-01" + if err := registerOrder(t, e, name, o); err == nil || !strings.Contains(err.Error(), "does not match") { + t.Fatalf("stale terms: %v", err) + } +} + +func TestDomainRegisterRequiresMITConsent(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + name, o := registerItem("example.com") + o.mitConsent = false + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "--mit-consent") { + t.Fatalf("err = %v", err) + } + if f.called("POST /v1/registrar/orders/" + testOrderID + "/checkout") { + t.Error("checked out without consent") + } +} + +func TestDomainRegisterPromptsWithoutYes(t *testing.T) { + t.Parallel() + _, e, _, _ := newFakeRegistrar(t) + var questions []string + e.confirm = func(q, _ string) (bool, error) { + questions = append(questions, q) + return true, nil + } + name, o := registerItem("example.com") + o.yes, o.acceptTerms, o.mitConsent = false, "", false + if err := registerOrder(t, e, name, o); err != nil { + t.Fatal(err) + } + if len(questions) != 3 || !strings.Contains(questions[0], "version 2026-12-01") || !strings.Contains(questions[2], "12.66 USD") { + t.Errorf("questions %q", questions) + } + + // Declining the charge cancels before checkout. + f2, e2, _, _ := newFakeRegistrar(t) + e2.confirm = func(q, _ string) (bool, error) { return !strings.HasPrefix(q, "Charge"), nil } + if err := registerOrder(t, e2, name, o); err == nil || !strings.Contains(err.Error(), "canceled") { + t.Fatalf("decline: %v", err) + } + if f2.called("POST /v1/registrar/orders/" + testOrderID + "/checkout") { + t.Error("checked out after decline") + } +} + +func TestDomainRegisterPortalVerification(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/orders/"+testOrderID+"/checkout"] = func(w http.ResponseWriter, _ *http.Request) { + writeTestJSON(w, 400, `{"code":9,"message":"This card needs verification. Finish the purchase in the portal: https://noderings.com/domains/checkout/x", + "details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"REQUIRES_PORTAL_VERIFICATION","domain":"api","metadata":{"portal_url":"https://noderings.com/domains/checkout/x"}}]}`) + } + name, o := registerItem("example.com") + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "3-D Secure") || !strings.Contains(err.Error(), "https://noderings.com/domains/checkout/x") { + t.Fatalf("err = %v", err) + } +} + +func TestDomainRegisterRequiresAction(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/orders/"+testOrderID+"/checkout"] = jsonReply(`{"state":"DOMAIN_ORDER_STATE_AWAITING_PAYMENT","requiresAction":true,"paymentIntentId":"pi_1","clientSecret":"pi_1_secret"}`) + name, o := registerItem("example.com") + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "3-D Secure") || !strings.Contains(err.Error(), "https://noderings.com/domains/checkout/"+testOrderID) { + t.Fatalf("err = %v", err) + } + if strings.Contains(err.Error(), "secret") { + t.Error("client secret leaked into the message") + } +} + +func TestDomainRegisterNoCard(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["GET /v1/registrar/orders/"+testOrderID] = jsonReply(`{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_QUOTED"}`) + name, o := registerItem("example.com") + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "card only") || !strings.Contains(err.Error(), "/domains/checkout/"+testOrderID) { + t.Fatalf("err = %v", err) + } +} + +func TestDomainRegisterCheckoutReasons(t *testing.T) { + t.Parallel() + for reason, want := range map[string]string{ + "CARD_DECLINED": "declined", + "QUOTE_EXPIRED": "quote expired", + "CONTACT_REQUIRED": "--contact", + "NAME_UNAVAILABLE": "example.com is no longer available", + } { + f, e, _, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/orders/"+testOrderID+"/checkout"] = func(w http.ResponseWriter, _ *http.Request) { + writeTestJSON(w, 400, `{"code":9,"message":"x","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"`+reason+`","metadata":{"domain":"example.com"}}]}`) + } + name, o := registerItem("example.com") + if err := registerOrder(t, e, name, o); err == nil || !strings.Contains(err.Error(), want) { + t.Errorf("%s: err = %v, want %q", reason, err, want) + } + } +} + +func TestDomainRegisterFailedOrder(t *testing.T) { + t.Parallel() + f, e, out, _ := newFakeRegistrar(t) + f.handlers["GET /v1/registrar/orders/"+testOrderID] = jsonReply(`{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_FAILED","paymentMethodId":"pm-default", + "items":[{"domainName":"example.com","kind":"DOMAIN_ORDER_ITEM_KIND_REGISTER","state":"DOMAIN_ORDER_ITEM_STATE_FAILED","failureMessage":"The registry rejected the name."}]}`) + name, o := registerItem("example.com") + err := registerOrder(t, e, name, o) + if err == nil || !strings.Contains(err.Error(), "nothing was charged") { + t.Fatalf("err = %v", err) + } + if !strings.Contains(out.String(), "The registry rejected the name.") { + t.Errorf("out %s", out) + } +} + +func TestDomainRegisterJSON(t *testing.T) { + t.Parallel() + _, e, out, _ := newFakeRegistrar(t) + e.json = true + name, o := registerItem("example.com") + if err := registerOrder(t, e, name, o); err != nil { + t.Fatal(err) + } + var got map[string]any + if err := json.Unmarshal(out.Bytes(), &got); err != nil || got["state"] != "DOMAIN_ORDER_STATE_COMPLETED" { + t.Fatalf("json %s: %v", out, err) + } +} + +func TestWaitForDomainOrderTimeout(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["GET /v1/registrar/orders/"+testOrderID] = jsonReply(`{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_PROCESSING"}`) + e.wait.timeout = 100 * time.Millisecond + last, err := waitForDomainOrder(context.Background(), e, testOrderID) + if err == nil || !strings.Contains(err.Error(), "still") || last == nil || deref(last.State) != "DOMAIN_ORDER_STATE_PROCESSING" { + t.Fatalf("%v %v", last, err) + } +} + +func TestDomainTransfer(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/transfer-check"] = jsonReply(`{"results":[{"name":"example.com","transferable":true,"authCodeRequired":true,"warnings":["Unlock the domain first."]}]}`) + item := orderInput("example.com", "DOMAIN_ORDER_ITEM_KIND_TRANSFER_IN", 0) + _, o := registerItem("example.com") + if err := domainTransfer(context.Background(), e, item, "", false, "", o); err == nil || !strings.Contains(err.Error(), "auth code") { + t.Fatalf("missing auth code: %v", err) + } + if err := domainTransfer(context.Background(), e, item, "AbC-123", true, "", o); err != nil { + t.Fatal(err) + } + items, _ := f.body("POST /v1/registrar/orders")["items"].([]any) + it := items[0].(map[string]any) + if it["kind"] != "DOMAIN_ORDER_ITEM_KIND_TRANSFER_IN" || it["authCode"] != "AbC-123" || it["importNameserversFromRegistry"] != true { + t.Errorf("item %v", it) + } + + f.handlers["POST /v1/registrar/transfer-check"] = jsonReply(`{"results":[{"name":"example.com","transferable":false,"reason":"Registered less than 60 days ago."}]}`) + if err := domainTransfer(context.Background(), e, item, "x", false, "", o); err == nil || !strings.Contains(err.Error(), "60 days") { + t.Fatalf("not transferable: %v", err) + } +} + +func TestDomainRenew(t *testing.T) { + t.Parallel() + f, e, _, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/domains/example.com/renew"] = jsonReply(`{"id":"` + testOrderID + `","state":"DOMAIN_ORDER_STATE_QUOTED"}`) + _, o := registerItem("example.com") + if err := domainRenew(context.Background(), e, "example.com", 2, o); err != nil { + t.Fatal(err) + } + b := f.body("POST /v1/registrar/domains/example.com/renew") + if b["years"] != float64(2) || b["idempotencyKey"] == "" { + t.Errorf("renew body %v", b) + } + if !f.called("POST /v1/registrar/orders/" + testOrderID + "/checkout") { + t.Error("renew order not checked out") + } +} + +func TestDomainSearchAndListOutput(t *testing.T) { + t.Parallel() + f, e, out, _ := newFakeRegistrar(t) + f.handlers["POST /v1/registrar/search"] = jsonReply(`{"results":[ + {"name":"evergreen.com","availability":"DOMAIN_AVAILABILITY_AVAILABLE","currency":"USD","firstYearPrice":"10.46","renewalPrice":"12.00","exactMatch":true}, + {"name":"evergreen.io","availability":"DOMAIN_AVAILABILITY_TAKEN","reason":"Already registered."}]}`) + if err := domainSearch(context.Background(), e, "evergreen", []string{".com", "io"}, false); err != nil { + t.Fatal(err) + } + if tlds, _ := f.body("POST /v1/registrar/search")["tlds"].([]any); len(tlds) != 2 || tlds[0] != "com" { + t.Errorf("tlds %v", tlds) + } + got := out.String() + for _, want := range []string{"NAME", "evergreen.com", "available", "10.46 USD", "taken", "Already registered.", "Prices exclude tax."} { + if !strings.Contains(got, want) { + t.Errorf("search output lacks %q:\n%s", want, got) + } + } + + out.Reset() + f.handlers["GET /v1/registrar/domains"] = jsonReply(`{"domains":[{"name":"example.com","state":"REGISTERED_DOMAIN_STATE_ACTIVE","holds":["DOMAIN_HOLD_VERIFICATION"], + "expiresAt":"2027-12-03T10:00:00Z","autoRenew":true,"transferLock":true,"nsMode":"DOMAIN_NS_MODE_NODERINGS"}],"totalCount":3}`) + if err := domainList(context.Background(), e, listParams()); err != nil { + t.Fatal(err) + } + got = out.String() + for _, want := range []string{"example.com", "active (hold: verification)", "2027-12-03", "NodeRings", "Showing 1 of 3"} { + if !strings.Contains(got, want) { + t.Errorf("list output lacks %q:\n%s", want, got) + } + } + + out.Reset() + e.json = true + if err := domainList(context.Background(), e, listParams()); err != nil { + t.Fatal(err) + } + var parsed map[string]any + if err := json.Unmarshal(out.Bytes(), &parsed); err != nil || parsed["domains"] == nil { + t.Fatalf("json %s: %v", out, err) + } +} + +func TestDomainAuthCodeWithoutReauth(t *testing.T) { + t.Parallel() + f, e, out, _ := newFakeRegistrar(t) + err := domainAuthCode(context.Background(), e, "example.com", "") + if err == nil || !strings.Contains(err.Error(), "https://noderings.com/organization/domains/example.com") || !strings.Contains(err.Error(), "--reauth-token") { + t.Fatalf("err = %v", err) + } + if f.called("POST /v1/registrar/domains/example.com/auth-code") || out.Len() != 0 { + t.Error("auth code requested without a step-up token") + } + + // With a token the code is printed; an expired token points to the portal. + f.handlers["POST /v1/registrar/domains/example.com/auth-code"] = jsonReply(`{"authCode":"s3cr3t"}`) + if err := domainAuthCode(context.Background(), e, "example.com", "rt"); err != nil || strings.TrimSpace(out.String()) != "s3cr3t" { + t.Fatalf("%v %q", err, out) + } + if b := f.body("POST /v1/registrar/domains/example.com/auth-code"); b["reauthToken"] != "rt" { + t.Errorf("body %v", b) + } + f.handlers["POST /v1/registrar/domains/example.com/auth-code"] = func(w http.ResponseWriter, _ *http.Request) { + writeTestJSON(w, 400, `{"code":9,"message":"x","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"REAUTH_REQUIRED"}]}`) + } + if err := domainAuthCode(context.Background(), e, "example.com", "old"); err == nil || !strings.Contains(err.Error(), "/organization/domains/example.com") { + t.Fatalf("expired token: %v", err) + } +} + +func TestDomainSettings(t *testing.T) { + t.Parallel() + f, e, out, _ := newFakeRegistrar(t) + ok := jsonReply(`{"name":"example.com"}`) + f.handlers["PUT /v1/registrar/domains/example.com/nameservers"] = ok + f.handlers["PUT /v1/registrar/domains/example.com/auto-renew"] = ok + f.handlers["PUT /v1/registrar/domains/example.com/lock"] = ok + f.handlers["PUT /v1/registrar/domains/example.com/dnssec"] = ok + ctx := context.Background() + + if err := domainSetNameservers(ctx, e, "example.com", []string{"ns1.example.net"}, false); err == nil { + t.Error("one nameserver accepted") + } + if err := domainSetNameservers(ctx, e, "example.com", []string{"ns1.example.net", "ns2.example.net"}, false); err != nil { + t.Fatal(err) + } + if b := f.body("PUT /v1/registrar/domains/example.com/nameservers"); b["nsMode"] != "DOMAIN_NS_MODE_CUSTOM" { + t.Errorf("ns body %v", b) + } + + if err := domainAutoRenew(ctx, e, "example.com", true, "", false, true); err == nil || !strings.Contains(err.Error(), "--mit-consent") { + t.Errorf("auto-renew without consent: %v", err) + } + if err := domainAutoRenew(ctx, e, "example.com", true, "pm-1", true, true); err != nil { + t.Fatal(err) + } + if b := f.body("PUT /v1/registrar/domains/example.com/auto-renew"); b["autoRenew"] != true || b["mitConsent"] != true || b["paymentMethodId"] != "pm-1" { + t.Errorf("auto-renew body %v", b) + } + + if err := domainLock(ctx, e, "example.com", false, ""); err == nil || !strings.Contains(err.Error(), "portal") { + t.Errorf("unlock without reauth: %v", err) + } + if err := domainLock(ctx, e, "example.com", true, ""); err != nil { + t.Fatal(err) + } + + if err := domainDnssec(ctx, e, "example.com", "custom", []string{"12345:13:2:abcdef"}); err != nil { + t.Fatal(err) + } + ds, _ := f.body("PUT /v1/registrar/domains/example.com/dnssec")["dsRecords"].([]any) + if len(ds) != 1 || ds[0].(map[string]any)["keyTag"] != float64(12345) || ds[0].(map[string]any)["digest"] != "ABCDEF" { + t.Errorf("ds %v", ds) + } + if err := domainDnssec(ctx, e, "example.com", "custom", []string{"bad"}); err == nil { + t.Error("bad DS accepted") + } + if !strings.Contains(out.String(), "Transfer lock on for example.com.") { + t.Errorf("out %s", out) + } +} + +func orderInput(name, kind string, years int32) generated.V1DomainOrderItemInput { + name = normalizeDomainName(name) + k := generated.V1DomainOrderItemKind(kind) + in := generated.V1DomainOrderItemInput{Kind: &k, DomainName: &name, AutoRenew: optBoolAlways(true)} + if years > 0 { + in.Years = &years + } + return in +} + +func listParams() generated.RegisteredDomainServiceListRegisteredDomainsParams { + return generated.RegisteredDomainServiceListRegisteredDomainsParams{} +} diff --git a/internal/cli/root.go b/internal/cli/root.go index c493f31..8503061 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -137,6 +137,7 @@ func init() { rootCmd.AddCommand(authCmd) rootCmd.AddCommand(agentCmd) rootCmd.AddCommand(clusterCmd) + rootCmd.AddCommand(domainCmd) rootCmd.AddCommand(versionCmd) } diff --git a/scripts/openapi-allowlist.py b/scripts/openapi-allowlist.py index e25c2c9..b92b2a8 100755 --- a/scripts/openapi-allowlist.py +++ b/scripts/openapi-allowlist.py @@ -16,6 +16,14 @@ HTTP_METHODS = {"get", "put", "post", "delete", "options", "head", "patch", "trace"} FREE_TEXT = {"description", "summary", "title", "example", "examples", "externalDocs"} +# Response properties the CLI never reads. Dropping them keeps billing and +# 3-D Secure internals out of the generated client; the CLI simply ignores +# those JSON fields. +DROP_PROPERTIES = { + "v1CheckoutDomainOrderResponse": {"clientSecret"}, + "v1DomainOrder": {"invoiceId"}, + "v1RegisteredDomain": {"adminContact", "renewalPaymentMethodId"}, +} # Maps whose keys are names chosen by the API author, not OpenAPI keywords. NAME_MAPS = {"properties", "schemas", "parameters", "requestBodies", "responses", "securitySchemes", "headers", "content", "paths", "mapping", "scopes"} @@ -123,6 +131,15 @@ def main(): if kept: components[section] = kept + for name, props in DROP_PROPERTIES.items(): + schema = components.get("schemas", {}).get(name) + if schema is None: + continue + for prop in props: + schema.get("properties", {}).pop(prop, None) + if "required" in schema: + schema["required"] = [r for r in schema["required"] if r not in props] + out = {"openapi": spec["openapi"], "info": spec["info"]} if "servers" in spec: out["servers"] = spec["servers"] diff --git a/scripts/openapi-allowlist.txt b/scripts/openapi-allowlist.txt index 62520a4..8a1a0bd 100644 --- a/scripts/openapi-allowlist.txt +++ b/scripts/openapi-allowlist.txt @@ -40,3 +40,21 @@ ServiceAccountService_ListServiceAccounts ServiceAccountService_ListTokens ServiceAccountService_RevokeToken ServiceAccountService_UpdateServiceAccount + +# Domain names (registrar) +DomainContactService_ListDomainContacts +DomainOrderService_CheckoutDomainOrder +DomainOrderService_CreateDomainOrder +DomainOrderService_GetDomainOrder +DomainOrderService_PriceDomainOrder +DomainSearchService_CheckDomains +DomainSearchService_CheckTransfer +DomainSearchService_SearchDomains +RegisteredDomainService_GetDomainAuthCode +RegisteredDomainService_GetRegisteredDomain +RegisteredDomainService_ListRegisteredDomains +RegisteredDomainService_RenewDomain +RegisteredDomainService_SetDomainAutoRenew +RegisteredDomainService_SetDomainDnssec +RegisteredDomainService_SetDomainNameservers +RegisteredDomainService_SetDomainTransferLock