diff --git a/CLAUDE.md b/CLAUDE.md index df341525..de64a249 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -154,12 +154,13 @@ A command that identifies a service takes a **ref** — its ID, a read replica s - **stdout** gets the command's primary output: the data payload (table, JSON, YAML, env vars), and in the plain-text path the result text itself. - **stderr** gets everything else: errors and warnings; interactive UI (confirmation prompts, password prompts, spinners); and progress/status messages that accompany structured output, so a piped stdout stays clean. `tiger service create` is the model — every status line is `cmd.PrintErrf`, and only the final service payload goes to stdout. -Helper functions inside `internal/cmd` take the `*cobra.Command` and print through it. A helper whose whole job is rendering into a writer (the `output*Table` functions) takes an `io.Writer` instead, since `tablewriter` needs one anyway. Code in other packages (`internal/common`, `internal/version`) must not import cobra — it takes an `io.Writer` (e.g. `common.WaitForServiceArgs.Output`) and the caller in `internal/cmd` passes `cmd.ErrOrStderr()` or `cmd.OutOrStdout()`. +Helper functions inside `internal/cmd` take the `*cobra.Command` and print through it. A helper whose whole job is rendering into a writer (the `output*Table` functions) takes an `io.Writer` instead, since `tablewriter` needs one anyway — as its first parameter, matching `util.SerializeToJSON` and `util.SerializeToYAML`. Code in other packages (`internal/common`, `internal/version`) must not import cobra — it takes an `io.Writer` (e.g. `common.WaitForServiceArgs.Output`) and the caller in `internal/cmd` passes `cmd.ErrOrStderr()` or `cmd.OutOrStdout()`. ### Formatting - Commands with structured output take `-o`/`--output` with `json`, `yaml`, and `table` (the default); some commands support extras (`env`, `bare`). Register the flag with the validating flag types in `flag_helper.go` (`new(outputFlag)` and friends, with no bound variable) and read the value from `cfg.Output` — `output` is a config value. - Serialize with `util.SerializeToJSON` and `util.SerializeToYAML`. **Don't add `yaml:` struct tags to output types** — `SerializeToYAML` encodes to JSON first and converts, so only `json:` tags matter and the two formats stay consistent (including for generated types that only carry `json:` tags). +- **Structured output is unconditional.** When a command succeeds with a structured format (`json`, `yaml`, `env`), stdout carries a payload in that format and nothing else, whatever the result, so it can always be piped into `jq` and the like. An empty list is `[]`, never a message and never empty output. A message for an empty or fallback result ("No services found.") belongs only in the output function's table case, printed to stderr before the table function would run. `tiger service list` is the model. - Colored output uses lipgloss styles, restricted to the eight base ANSI colors (`lipgloss.Blue`, `lipgloss.Green`, …) rather than their bright variants or 256-color and true-color values, and without bold; de-emphasize text with `Faint` rather than a grey. That way output follows the user's terminal theme (some themes render bright colors and bold as greys). Render styles unconditionally: the output writers strip colors when the stream isn't a terminal, and the lifecycle disables color on them when `cfg.Color` is off, so commands need no per-command wiring. The `tiger skills install` picker is the model. ### Tone @@ -195,7 +196,7 @@ Interactive menus and spinners use BubbleTea v2 (`charm.land/bubbletea/v2`). Alw - Cleanup that can fail (closing a reader, removing a temporary directory) is called explicitly on the success path, with its error returned, and also deferred as best-effort cleanup for the error paths, where a more important error is already being returned. This relies on the cleanup being safe to call twice, so use it only for idempotent operations. `writeSkill` in `skills_install.go` is the model. - Return errors from `RunE`; never call `os.Exit` in a command. For specific exit codes, wrap with `common.ExitWithCode`, and map API errors to exit codes with `common.ExitWithErrorFromStatusCode`. The exit codes are defined in `internal/common/errors.go`, and `main.go` honors a `common.ExitCodeError` anywhere in the error chain. - After checking an API response's status code, nil-check the parsed body (`resp.JSON200`, etc.) before using it — a nil body indicates a bug and should return `errors.New("empty response from API")`. -- Operations that connect to a service should call `common.CheckServiceReady` first and translate `common.ErrPaused`/`common.ErrNotReady` into actionable messages. +- Operations that connect to a database should check `ConnectionTarget.CheckReady` first and translate `common.ErrPaused`/`common.ErrNotReady` into actionable messages. ## HTTP Requests diff --git a/internal/api/client.go b/internal/api/client.go index 5013141d..8567fc19 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -302,6 +302,16 @@ type ClientInterface interface { // Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). UpdateAllowList(ctx context.Context, projectID ProjectID, allowListID AllowListID, body UpdateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetProjectBranches List All Branches in a Project + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a list of all branches within a specific project, regardless + // of parent service. + // + // Corresponds with GET /projects/{project_id}/branches (the `GetProjectBranches` operationId). + GetProjectBranches(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetExporters List All Exporters // // **Preview - this endpoint is experimental and may change without notice.** @@ -406,6 +416,13 @@ type ClientInterface interface { // Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). UpdateExporter(ctx context.Context, projectID ProjectID, exporterID ExporterID, body UpdateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ResolveRef Resolve a Service, Branch, or Read Replica Set + // + // Resolves `ref` to the service, branch, or read replica set it names. + // + // Corresponds with GET /projects/{project_id}/resolve (the `ResolveRef` operationId). + ResolveRef(ctx context.Context, projectID ProjectID, params *ResolveRefParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetServices List All Services // // Retrieves a list of all services within a specific project. @@ -616,6 +633,149 @@ type ClientInterface interface { // Corresponds with GET /projects/{project_id}/services/{service_id}/backups (the `GetBackups` operationId). GetBackups(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetBranches List All Branches + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a list of all branches created from a service within a project. + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/branches (the `GetBranches` operationId). + GetBranches(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetBranchesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateBranchWithBody Create a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates a new branch from the service identified by `service_id`. A + // branch shares its parent's data at the moment of creation and gets + // its own, independently-sized compute. This is an asynchronous + // operation. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). + CreateBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateBranch Create a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates a new branch from the service identified by `service_id`. A + // branch shares its parent's data at the moment of creation and gets + // its own, independently-sized compute. This is an asynchronous + // operation. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). + CreateBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteBranch Delete a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Deletes a specific branch. This is an asynchronous operation. + // + // Corresponds with DELETE /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `DeleteBranch` operationId). + DeleteBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetBranch Get a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves the details of a specific branch by its ID. + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `GetBranch` operationId). + GetBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RenameBranchWithBody Rename a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates the name of a specific branch. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). + RenameBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RenameBranch Rename a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates the name of a specific branch. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). + RenameBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body RenameBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ResizeBranchWithBody Resize a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Changes the compute allocation for a specific branch. + // Storage size is shared with the parent and is not resized through + // this operation. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). + ResizeBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ResizeBranch Resize a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Changes the compute allocation for a specific branch. + // Storage size is shared with the parent and is not resized through + // this operation. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). + ResizeBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body ResizeBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // StartBranch Start a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Starts a stopped branch. This is an asynchronous operation. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/start (the `StartBranch` operationId). + StartBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // StopBranch Stop a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Stops a running branch. This is an asynchronous operation. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/stop (the `StopBranch` operationId). + StopBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateBranchPasswordWithBody Update Branch Password + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Sets a new master password for the branch. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). + UpdateBranchPasswordWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateBranchPassword Update Branch Password + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Sets a new master password for the branch. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). + UpdateBranchPassword(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body UpdateBranchPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DetachServiceFromAllowListWithBody Detach Service from IP Allow List // // **Preview - this endpoint is experimental and may change without notice.** @@ -1456,6 +1616,26 @@ func (c *Client) UpdateAllowList(ctx context.Context, projectID ProjectID, allow return c.Client.Do(req) } +// GetProjectBranches List All Branches in a Project +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves a list of all branches within a specific project, regardless +// of parent service. +// +// Corresponds with GET /projects/{project_id}/branches (the `GetProjectBranches` operationId). +func (c *Client) GetProjectBranches(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProjectBranchesRequest(c.Server, projectID) + 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) +} + // GetExporters List All Exporters // // **Preview - this endpoint is experimental and may change without notice.** @@ -1630,6 +1810,23 @@ func (c *Client) UpdateExporter(ctx context.Context, projectID ProjectID, export return c.Client.Do(req) } +// ResolveRef Resolve a Service, Branch, or Read Replica Set +// +// Resolves `ref` to the service, branch, or read replica set it names. +// +// Corresponds with GET /projects/{project_id}/resolve (the `ResolveRef` operationId). +func (c *Client) ResolveRef(ctx context.Context, projectID ProjectID, params *ResolveRefParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResolveRefRequest(c.Server, projectID, 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) +} + // GetServices List All Services // // Retrieves a list of all services within a specific project. @@ -2030,18 +2227,15 @@ func (c *Client) GetBackups(ctx context.Context, projectID ProjectID, serviceID return c.Client.Do(req) } -// DetachServiceFromAllowListWithBody Detach Service from IP Allow List +// GetBranches List All Branches // // **Preview - this endpoint is experimental and may change without notice.** // -// Removes the IP restriction an IP allow list placed on a service. The -// IP allow list itself is not deleted. -// -// Takes any type of body and a specified content type. +// Retrieves a list of all branches created from a service within a project. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). -func (c *Client) DetachServiceFromAllowListWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromAllowListRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/branches (the `GetBranches` operationId). +func (c *Client) GetBranches(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetBranchesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetBranchesRequest(c.Server, projectID, serviceID, params) if err != nil { return nil, err } @@ -2052,18 +2246,20 @@ func (c *Client) DetachServiceFromAllowListWithBody(ctx context.Context, project return c.Client.Do(req) } -// DetachServiceFromAllowList Detach Service from IP Allow List +// CreateBranchWithBody Create a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Removes the IP restriction an IP allow list placed on a service. The -// IP allow list itself is not deleted. +// Creates a new branch from the service identified by `service_id`. A +// branch shares its parent's data at the moment of creation and gets +// its own, independently-sized compute. This is an asynchronous +// operation. // -// Takes a body of the `application/json` content type. +// Takes any type of body and a specified content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). -func (c *Client) DetachServiceFromAllowList(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromAllowListRequest(c.Server, projectID, serviceID, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). +func (c *Client) CreateBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateBranchRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2074,20 +2270,20 @@ func (c *Client) DetachServiceFromAllowList(ctx context.Context, projectID Proje return c.Client.Do(req) } -// DetachServiceFromExporterWithBody Detach Service from Exporter +// CreateBranch Create a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Stops sending a service's logs or metrics to an exporter. The exporter -// is not deleted and keeps serving any other service attached to it. -// -// Data already delivered to the destination is untouched. +// Creates a new branch from the service identified by `service_id`. A +// branch shares its parent's data at the moment of creation and gets +// its own, independently-sized compute. This is an asynchronous +// operation. // -// Takes any type of body and a specified content type. +// Takes a body of the `application/json` content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). -func (c *Client) DetachServiceFromExporterWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromExporterRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). +func (c *Client) CreateBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateBranchRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2098,20 +2294,15 @@ func (c *Client) DetachServiceFromExporterWithBody(ctx context.Context, projectI return c.Client.Do(req) } -// DetachServiceFromExporter Detach Service from Exporter +// DeleteBranch Delete a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Stops sending a service's logs or metrics to an exporter. The exporter -// is not deleted and keeps serving any other service attached to it. -// -// Data already delivered to the destination is untouched. -// -// Takes a body of the `application/json` content type. +// Deletes a specific branch. This is an asynchronous operation. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). -func (c *Client) DetachServiceFromExporter(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromExporterRequest(c.Server, projectID, serviceID, body) +// Corresponds with DELETE /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `DeleteBranch` operationId). +func (c *Client) DeleteBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteBranchRequest(c.Server, projectID, serviceID, branchID) if err != nil { return nil, err } @@ -2122,15 +2313,15 @@ func (c *Client) DetachServiceFromExporter(ctx context.Context, projectID Projec return c.Client.Do(req) } -// DetachServiceFromVPCWithBody Detach Service from VPC +// GetBranch Get a Branch // -// Disassociates a service from its VPC. +// **Preview - this endpoint is experimental and may change without notice.** // -// Takes any type of body and a specified content type. +// Retrieves the details of a specific branch by its ID. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). -func (c *Client) DetachServiceFromVPCWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromVPCRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `GetBranch` operationId). +func (c *Client) GetBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetBranchRequest(c.Server, projectID, serviceID, branchID) if err != nil { return nil, err } @@ -2141,15 +2332,17 @@ func (c *Client) DetachServiceFromVPCWithBody(ctx context.Context, projectID Pro return c.Client.Do(req) } -// DetachServiceFromVPC Detach Service from VPC +// RenameBranchWithBody Rename a Branch // -// Disassociates a service from its VPC. +// **Preview - this endpoint is experimental and may change without notice.** // -// Takes a body of the `application/json` content type. +// Updates the name of a specific branch. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). -func (c *Client) DetachServiceFromVPC(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDetachServiceFromVPCRequest(c.Server, projectID, serviceID, body) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). +func (c *Client) RenameBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRenameBranchRequestWithBody(c.Server, projectID, serviceID, branchID, contentType, body) if err != nil { return nil, err } @@ -2160,13 +2353,17 @@ func (c *Client) DetachServiceFromVPC(ctx context.Context, projectID ProjectID, return c.Client.Do(req) } -// DisablePooler Disable Connection Pooler for a Service +// RenameBranch Rename a Branch // -// Deactivates the connection pooler for a specific service within a project. +// **Preview - this endpoint is experimental and may change without notice.** // -// Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). -func (c *Client) DisablePooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDisablePoolerRequest(c.Server, projectID, serviceID) +// Updates the name of a specific branch. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). +func (c *Client) RenameBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body RenameBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRenameBranchRequest(c.Server, projectID, serviceID, branchID, body) if err != nil { return nil, err } @@ -2177,19 +2374,19 @@ func (c *Client) DisablePooler(ctx context.Context, projectID ProjectID, service return c.Client.Do(req) } -// EnableDataTiering Enable Data Tiering for a Service +// ResizeBranchWithBody Resize a Branch // -// Enables tiered storage on the service. Tiering policies move older, -// rarely-accessed data from the high-performance storage tier to a -// low-cost object storage tier. Tiered data stays queryable but becomes -// read-only. +// **Preview - this endpoint is experimental and may change without notice.** // -// There is no way to disable tiering through this API. Contact Tiger -// Data support if you need to turn it off. +// Changes the compute allocation for a specific branch. +// Storage size is shared with the parent and is not resized through +// this operation. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). -func (c *Client) EnableDataTiering(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEnableDataTieringRequest(c.Server, projectID, serviceID) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). +func (c *Client) ResizeBranchWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeBranchRequestWithBody(c.Server, projectID, serviceID, branchID, contentType, body) if err != nil { return nil, err } @@ -2200,13 +2397,19 @@ func (c *Client) EnableDataTiering(ctx context.Context, projectID ProjectID, ser return c.Client.Do(req) } -// EnablePooler Enable Connection Pooler for a Service +// ResizeBranch Resize a Branch // -// Activates the connection pooler for a specific service within a project. +// **Preview - this endpoint is experimental and may change without notice.** // -// Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). -func (c *Client) EnablePooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEnablePoolerRequest(c.Server, projectID, serviceID) +// Changes the compute allocation for a specific branch. +// Storage size is shared with the parent and is not resized through +// this operation. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). +func (c *Client) ResizeBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body ResizeBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeBranchRequest(c.Server, projectID, serviceID, branchID, body) if err != nil { return nil, err } @@ -2217,15 +2420,15 @@ func (c *Client) EnablePooler(ctx context.Context, projectID ProjectID, serviceI return c.Client.Do(req) } -// ForkServiceWithBody Fork a Service +// StartBranch Start a Branch // -// Creates a new, independent service within a project by taking a snapshot of an existing one. +// **Preview - this endpoint is experimental and may change without notice.** // -// Takes any type of body and a specified content type. +// Starts a stopped branch. This is an asynchronous operation. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). -func (c *Client) ForkServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewForkServiceRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/start (the `StartBranch` operationId). +func (c *Client) StartBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStartBranchRequest(c.Server, projectID, serviceID, branchID) if err != nil { return nil, err } @@ -2236,15 +2439,15 @@ func (c *Client) ForkServiceWithBody(ctx context.Context, projectID ProjectID, s return c.Client.Do(req) } -// ForkService Fork a Service +// StopBranch Stop a Branch // -// Creates a new, independent service within a project by taking a snapshot of an existing one. +// **Preview - this endpoint is experimental and may change without notice.** // -// Takes a body of the `application/json` content type. +// Stops a running branch. This is an asynchronous operation. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). -func (c *Client) ForkService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewForkServiceRequest(c.Server, projectID, serviceID, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/stop (the `StopBranch` operationId). +func (c *Client) StopBranch(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStopBranchRequest(c.Server, projectID, serviceID, branchID) if err != nil { return nil, err } @@ -2255,18 +2458,17 @@ func (c *Client) ForkService(ctx context.Context, projectID ProjectID, serviceID return c.Client.Do(req) } -// GetServiceLogs Get service logs +// UpdateBranchPasswordWithBody Update Branch Password // -// Fetch logs for a specific service. Returns up to 500 log entries in reverse -// chronological order. Supports cursor-based pagination via the `cursor` parameter -// and the `last_cursor` field in the response. +// **Preview - this endpoint is experimental and may change without notice.** // -// Use the returned `last_cursor` value as the `cursor` parameter on subsequent -// requests to page through all available logs. +// Sets a new master password for the branch. // -// Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). -func (c *Client) GetServiceLogs(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceLogsRequest(c.Server, projectID, serviceID, params) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). +func (c *Client) UpdateBranchPasswordWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateBranchPasswordRequestWithBody(c.Server, projectID, serviceID, branchID, contentType, body) if err != nil { return nil, err } @@ -2277,13 +2479,17 @@ func (c *Client) GetServiceLogs(ctx context.Context, projectID ProjectID, servic return c.Client.Do(req) } -// GetServiceMetricsAvailableSeries List available metric series +// UpdateBranchPassword Update Branch Password // -// Returns the names of all metric series available for a service. +// **Preview - this endpoint is experimental and may change without notice.** // -// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). -func (c *Client) GetServiceMetricsAvailableSeries(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceMetricsAvailableSeriesRequest(c.Server, projectID, serviceID) +// Sets a new master password for the branch. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). +func (c *Client) UpdateBranchPassword(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body UpdateBranchPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateBranchPasswordRequest(c.Server, projectID, serviceID, branchID, body) if err != nil { return nil, err } @@ -2294,17 +2500,18 @@ func (c *Client) GetServiceMetricsAvailableSeries(ctx context.Context, projectID return c.Client.Do(req) } -// GetServiceMetricDetails Get details about a metric +// DetachServiceFromAllowListWithBody Detach Service from IP Allow List // -// Returns descriptive metadata for a named metric: what it measures, -// its type, default aggregation, and every label it can be filtered or -// grouped by — its own labels plus the region/role/ordinal labels most -// metrics also carry. Use getServiceMetricsAvailableSeries to discover -// valid metric names. +// **Preview - this endpoint is experimental and may change without notice.** // -// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). -func (c *Client) GetServiceMetricDetails(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceMetricDetailsRequest(c.Server, projectID, serviceID, metricName) +// Removes the IP restriction an IP allow list placed on a service. The +// IP allow list itself is not deleted. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). +func (c *Client) DetachServiceFromAllowListWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromAllowListRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2315,21 +2522,18 @@ func (c *Client) GetServiceMetricDetails(ctx context.Context, projectID ProjectI return c.Client.Do(req) } -// GetServiceMetricsSeriesWithBody Get a metric series +// DetachServiceFromAllowList Detach Service from IP Allow List // -// Returns time-series data points for a named metric within a time window. -// Use getServiceMetricsAvailableSeries to discover valid metric names. +// **Preview - this endpoint is experimental and may change without notice.** // -// Parameters are sent as a JSON body so callers can pass an unbounded -// filter set without query-string length pressure. The response is a list -// of MetricSeries, each carrying its label set as a structured map -// alongside its per-bucket data points. +// Removes the IP restriction an IP allow list placed on a service. The +// IP allow list itself is not deleted. // -// Takes any type of body and a specified content type. +// Takes a body of the `application/json` content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). -func (c *Client) GetServiceMetricsSeriesWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceMetricsSeriesRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). +func (c *Client) DetachServiceFromAllowList(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromAllowListRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2340,21 +2544,20 @@ func (c *Client) GetServiceMetricsSeriesWithBody(ctx context.Context, projectID return c.Client.Do(req) } -// GetServiceMetricsSeries Get a metric series +// DetachServiceFromExporterWithBody Detach Service from Exporter // -// Returns time-series data points for a named metric within a time window. -// Use getServiceMetricsAvailableSeries to discover valid metric names. +// **Preview - this endpoint is experimental and may change without notice.** // -// Parameters are sent as a JSON body so callers can pass an unbounded -// filter set without query-string length pressure. The response is a list -// of MetricSeries, each carrying its label set as a structured map -// alongside its per-bucket data points. +// Stops sending a service's logs or metrics to an exporter. The exporter +// is not deleted and keeps serving any other service attached to it. // -// Takes a body of the `application/json` content type. +// Data already delivered to the destination is untouched. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). -func (c *Client) GetServiceMetricsSeries(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceMetricsSeriesRequest(c.Server, projectID, serviceID, body) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). +func (c *Client) DetachServiceFromExporterWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromExporterRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2365,15 +2568,20 @@ func (c *Client) GetServiceMetricsSeries(ctx context.Context, projectID ProjectI return c.Client.Do(req) } -// RenameServiceWithBody Rename a Service +// DetachServiceFromExporter Detach Service from Exporter // -// Updates the name of a specific service. +// **Preview - this endpoint is experimental and may change without notice.** // -// Takes any type of body and a specified content type. +// Stops sending a service's logs or metrics to an exporter. The exporter +// is not deleted and keeps serving any other service attached to it. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). -func (c *Client) RenameServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRenameServiceRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Data already delivered to the destination is untouched. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). +func (c *Client) DetachServiceFromExporter(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromExporterRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2384,15 +2592,15 @@ func (c *Client) RenameServiceWithBody(ctx context.Context, projectID ProjectID, return c.Client.Do(req) } -// RenameService Rename a Service +// DetachServiceFromVPCWithBody Detach Service from VPC // -// Updates the name of a specific service. +// Disassociates a service from its VPC. // -// Takes a body of the `application/json` content type. +// Takes any type of body and a specified content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). -func (c *Client) RenameService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewRenameServiceRequest(c.Server, projectID, serviceID, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). +func (c *Client) DetachServiceFromVPCWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromVPCRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2403,13 +2611,15 @@ func (c *Client) RenameService(ctx context.Context, projectID ProjectID, service return c.Client.Do(req) } -// GetReplicaSets Get Read Replica Sets +// DetachServiceFromVPC Detach Service from VPC // -// Retrieves a list of all read replica sets associated with a primary service within a project. +// Disassociates a service from its VPC. // -// Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). -func (c *Client) GetReplicaSets(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetReplicaSetsRequest(c.Server, projectID, serviceID) +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). +func (c *Client) DetachServiceFromVPC(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDetachServiceFromVPCRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2420,15 +2630,13 @@ func (c *Client) GetReplicaSets(ctx context.Context, projectID ProjectID, servic return c.Client.Do(req) } -// CreateReplicaSetWithBody Create a Read Replica Set -// -// Creates a new read replica set for a service. This is an asynchronous operation. +// DisablePooler Disable Connection Pooler for a Service // -// Takes any type of body and a specified content type. +// Deactivates the connection pooler for a specific service within a project. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). -func (c *Client) CreateReplicaSetWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateReplicaSetRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). +func (c *Client) DisablePooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDisablePoolerRequest(c.Server, projectID, serviceID) if err != nil { return nil, err } @@ -2439,15 +2647,19 @@ func (c *Client) CreateReplicaSetWithBody(ctx context.Context, projectID Project return c.Client.Do(req) } -// CreateReplicaSet Create a Read Replica Set +// EnableDataTiering Enable Data Tiering for a Service // -// Creates a new read replica set for a service. This is an asynchronous operation. +// Enables tiered storage on the service. Tiering policies move older, +// rarely-accessed data from the high-performance storage tier to a +// low-cost object storage tier. Tiered data stays queryable but becomes +// read-only. // -// Takes a body of the `application/json` content type. +// There is no way to disable tiering through this API. Contact Tiger +// Data support if you need to turn it off. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). -func (c *Client) CreateReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateReplicaSetRequest(c.Server, projectID, serviceID, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). +func (c *Client) EnableDataTiering(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEnableDataTieringRequest(c.Server, projectID, serviceID) if err != nil { return nil, err } @@ -2458,13 +2670,13 @@ func (c *Client) CreateReplicaSet(ctx context.Context, projectID ProjectID, serv return c.Client.Do(req) } -// DeleteReplicaSet Delete a Read Replica Set +// EnablePooler Enable Connection Pooler for a Service // -// Deletes a specific read replica set. This is an asynchronous operation. +// Activates the connection pooler for a specific service within a project. // -// Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). -func (c *Client) DeleteReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteReplicaSetRequest(c.Server, projectID, serviceID, replicaSetID) +// Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). +func (c *Client) EnablePooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEnablePoolerRequest(c.Server, projectID, serviceID) if err != nil { return nil, err } @@ -2475,13 +2687,15 @@ func (c *Client) DeleteReplicaSet(ctx context.Context, projectID ProjectID, serv return c.Client.Do(req) } -// DisableReplicaPooler Disable Connection Pooler for a Read Replica +// ForkServiceWithBody Fork a Service // -// Deactivates the connection pooler for a specific read replica set. +// Creates a new, independent service within a project by taking a snapshot of an existing one. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). -func (c *Client) DisableReplicaPooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDisableReplicaPoolerRequest(c.Server, projectID, serviceID, replicaSetID) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). +func (c *Client) ForkServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewForkServiceRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2492,13 +2706,15 @@ func (c *Client) DisableReplicaPooler(ctx context.Context, projectID ProjectID, return c.Client.Do(req) } -// EnableReplicaPooler Enable Connection Pooler for a Read Replica +// ForkService Fork a Service // -// Activates the connection pooler for a specific read replica set. +// Creates a new, independent service within a project by taking a snapshot of an existing one. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). -func (c *Client) EnableReplicaPooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEnableReplicaPoolerRequest(c.Server, projectID, serviceID, replicaSetID) +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). +func (c *Client) ForkService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewForkServiceRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2509,15 +2725,18 @@ func (c *Client) EnableReplicaPooler(ctx context.Context, projectID ProjectID, s return c.Client.Do(req) } -// ResizeReplicaSetWithBody Resize a Read Replica Set +// GetServiceLogs Get service logs // -// Changes the resource allocation for a specific read replica set. +// Fetch logs for a specific service. Returns up to 500 log entries in reverse +// chronological order. Supports cursor-based pagination via the `cursor` parameter +// and the `last_cursor` field in the response. // -// Takes any type of body and a specified content type. +// Use the returned `last_cursor` value as the `cursor` parameter on subsequent +// requests to page through all available logs. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). -func (c *Client) ResizeReplicaSetWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewResizeReplicaSetRequestWithBody(c.Server, projectID, serviceID, replicaSetID, contentType, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). +func (c *Client) GetServiceLogs(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceLogsRequest(c.Server, projectID, serviceID, params) if err != nil { return nil, err } @@ -2528,15 +2747,13 @@ func (c *Client) ResizeReplicaSetWithBody(ctx context.Context, projectID Project return c.Client.Do(req) } -// ResizeReplicaSet Resize a Read Replica Set -// -// Changes the resource allocation for a specific read replica set. +// GetServiceMetricsAvailableSeries List available metric series // -// Takes a body of the `application/json` content type. +// Returns the names of all metric series available for a service. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). -func (c *Client) ResizeReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewResizeReplicaSetRequest(c.Server, projectID, serviceID, replicaSetID, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). +func (c *Client) GetServiceMetricsAvailableSeries(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceMetricsAvailableSeriesRequest(c.Server, projectID, serviceID) if err != nil { return nil, err } @@ -2547,15 +2764,17 @@ func (c *Client) ResizeReplicaSet(ctx context.Context, projectID ProjectID, serv return c.Client.Do(req) } -// SetReplicaEnvironmentWithBody Set Environment for a Read Replica -// -// Sets the environment type for the read replica set. +// GetServiceMetricDetails Get details about a metric // -// Takes any type of body and a specified content type. +// Returns descriptive metadata for a named metric: what it measures, +// its type, default aggregation, and every label it can be filtered or +// grouped by — its own labels plus the region/role/ordinal labels most +// metrics also carry. Use getServiceMetricsAvailableSeries to discover +// valid metric names. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). -func (c *Client) SetReplicaEnvironmentWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetReplicaEnvironmentRequestWithBody(c.Server, projectID, serviceID, replicaSetID, contentType, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). +func (c *Client) GetServiceMetricDetails(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceMetricDetailsRequest(c.Server, projectID, serviceID, metricName) if err != nil { return nil, err } @@ -2566,15 +2785,21 @@ func (c *Client) SetReplicaEnvironmentWithBody(ctx context.Context, projectID Pr return c.Client.Do(req) } -// SetReplicaEnvironment Set Environment for a Read Replica +// GetServiceMetricsSeriesWithBody Get a metric series // -// Sets the environment type for the read replica set. +// Returns time-series data points for a named metric within a time window. +// Use getServiceMetricsAvailableSeries to discover valid metric names. // -// Takes a body of the `application/json` content type. +// Parameters are sent as a JSON body so callers can pass an unbounded +// filter set without query-string length pressure. The response is a list +// of MetricSeries, each carrying its label set as a structured map +// alongside its per-bucket data points. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). -func (c *Client) SetReplicaEnvironment(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetReplicaEnvironmentRequest(c.Server, projectID, serviceID, replicaSetID, body) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). +func (c *Client) GetServiceMetricsSeriesWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceMetricsSeriesRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2585,15 +2810,21 @@ func (c *Client) SetReplicaEnvironment(ctx context.Context, projectID ProjectID, return c.Client.Do(req) } -// ResizeServiceWithBody Resize a Service +// GetServiceMetricsSeries Get a metric series // -// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. +// Returns time-series data points for a named metric within a time window. +// Use getServiceMetricsAvailableSeries to discover valid metric names. // -// Takes any type of body and a specified content type. +// Parameters are sent as a JSON body so callers can pass an unbounded +// filter set without query-string length pressure. The response is a list +// of MetricSeries, each carrying its label set as a structured map +// alongside its per-bucket data points. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). -func (c *Client) ResizeServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewResizeServiceRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). +func (c *Client) GetServiceMetricsSeries(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceMetricsSeriesRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2604,15 +2835,15 @@ func (c *Client) ResizeServiceWithBody(ctx context.Context, projectID ProjectID, return c.Client.Do(req) } -// ResizeService Resize a Service +// RenameServiceWithBody Rename a Service // -// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. +// Updates the name of a specific service. // -// Takes a body of the `application/json` content type. +// Takes any type of body and a specified content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). -func (c *Client) ResizeService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewResizeServiceRequest(c.Server, projectID, serviceID, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). +func (c *Client) RenameServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRenameServiceRequestWithBody(c.Server, projectID, serviceID, contentType, body) if err != nil { return nil, err } @@ -2623,15 +2854,15 @@ func (c *Client) ResizeService(ctx context.Context, projectID ProjectID, service return c.Client.Do(req) } -// SetEnvironmentWithBody Set Environment for a Service +// RenameService Rename a Service // -// Sets the environment type for the service. +// Updates the name of a specific service. // -// Takes any type of body and a specified content type. +// Takes a body of the `application/json` content type. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). -func (c *Client) SetEnvironmentWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetEnvironmentRequestWithBody(c.Server, projectID, serviceID, contentType, body) +// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). +func (c *Client) RenameService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRenameServiceRequest(c.Server, projectID, serviceID, body) if err != nil { return nil, err } @@ -2642,15 +2873,13 @@ func (c *Client) SetEnvironmentWithBody(ctx context.Context, projectID ProjectID return c.Client.Do(req) } -// SetEnvironment Set Environment for a Service -// -// Sets the environment type for the service. +// GetReplicaSets Get Read Replica Sets // -// Takes a body of the `application/json` content type. +// Retrieves a list of all read replica sets associated with a primary service within a project. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). -func (c *Client) SetEnvironment(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetEnvironmentRequest(c.Server, projectID, serviceID, body) +// Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). +func (c *Client) GetReplicaSets(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetReplicaSetsRequest(c.Server, projectID, serviceID) if err != nil { return nil, err } @@ -2661,7 +2890,248 @@ func (c *Client) SetEnvironment(ctx context.Context, projectID ProjectID, servic return c.Client.Do(req) } -// SetHAReplicaWithBody Change HA configuration for a Service +// CreateReplicaSetWithBody Create a Read Replica Set +// +// Creates a new read replica set for a service. This is an asynchronous operation. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). +func (c *Client) CreateReplicaSetWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateReplicaSetRequestWithBody(c.Server, projectID, serviceID, 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) +} + +// CreateReplicaSet Create a Read Replica Set +// +// Creates a new read replica set for a service. This is an asynchronous operation. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). +func (c *Client) CreateReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateReplicaSetRequest(c.Server, projectID, serviceID, 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) +} + +// DeleteReplicaSet Delete a Read Replica Set +// +// Deletes a specific read replica set. This is an asynchronous operation. +// +// Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). +func (c *Client) DeleteReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteReplicaSetRequest(c.Server, projectID, serviceID, replicaSetID) + 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) +} + +// DisableReplicaPooler Disable Connection Pooler for a Read Replica +// +// Deactivates the connection pooler for a specific read replica set. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). +func (c *Client) DisableReplicaPooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDisableReplicaPoolerRequest(c.Server, projectID, serviceID, replicaSetID) + 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) +} + +// EnableReplicaPooler Enable Connection Pooler for a Read Replica +// +// Activates the connection pooler for a specific read replica set. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). +func (c *Client) EnableReplicaPooler(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEnableReplicaPoolerRequest(c.Server, projectID, serviceID, replicaSetID) + 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) +} + +// ResizeReplicaSetWithBody Resize a Read Replica Set +// +// Changes the resource allocation for a specific read replica set. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). +func (c *Client) ResizeReplicaSetWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeReplicaSetRequestWithBody(c.Server, projectID, serviceID, replicaSetID, 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) +} + +// ResizeReplicaSet Resize a Read Replica Set +// +// Changes the resource allocation for a specific read replica set. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). +func (c *Client) ResizeReplicaSet(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeReplicaSetRequest(c.Server, projectID, serviceID, replicaSetID, 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) +} + +// SetReplicaEnvironmentWithBody Set Environment for a Read Replica +// +// Sets the environment type for the read replica set. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). +func (c *Client) SetReplicaEnvironmentWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetReplicaEnvironmentRequestWithBody(c.Server, projectID, serviceID, replicaSetID, 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) +} + +// SetReplicaEnvironment Set Environment for a Read Replica +// +// Sets the environment type for the read replica set. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). +func (c *Client) SetReplicaEnvironment(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetReplicaEnvironmentRequest(c.Server, projectID, serviceID, replicaSetID, 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) +} + +// ResizeServiceWithBody Resize a Service +// +// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). +func (c *Client) ResizeServiceWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeServiceRequestWithBody(c.Server, projectID, serviceID, 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) +} + +// ResizeService Resize a Service +// +// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). +func (c *Client) ResizeService(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewResizeServiceRequest(c.Server, projectID, serviceID, 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) +} + +// SetEnvironmentWithBody Set Environment for a Service +// +// Sets the environment type for the service. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). +func (c *Client) SetEnvironmentWithBody(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetEnvironmentRequestWithBody(c.Server, projectID, serviceID, 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) +} + +// SetEnvironment Set Environment for a Service +// +// Sets the environment type for the service. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). +func (c *Client) SetEnvironment(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetEnvironmentRequest(c.Server, projectID, serviceID, 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) +} + +// SetHAReplicaWithBody Change HA configuration for a Service // // Changes the HA configuration for a specific service. This is an asynchronous operation. // @@ -3418,8 +3888,8 @@ func NewUpdateAllowListRequestWithBody(server string, projectID ProjectID, allow return req, nil } -// NewGetExportersRequest constructs an http.Request for the GetExporters method -func NewGetExportersRequest(server string, projectID ProjectID) (*http.Request, error) { +// NewGetProjectBranchesRequest constructs an http.Request for the GetProjectBranches method +func NewGetProjectBranchesRequest(server string, projectID ProjectID) (*http.Request, error) { var err error var pathParam0 string @@ -3434,7 +3904,7 @@ func NewGetExportersRequest(server string, projectID ProjectID) (*http.Request, return nil, err } - operationPath := fmt.Sprintf("/projects/%s/exporters", pathParam0) + operationPath := fmt.Sprintf("/projects/%s/branches", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3452,14 +3922,48 @@ func NewGetExportersRequest(server string, projectID ProjectID) (*http.Request, return req, nil } -// NewCreateExporterRequest calls the generic CreateExporter builder with application/json body -func NewCreateExporterRequest(server string, projectID ProjectID, body CreateExporterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetExportersRequest constructs an http.Request for the GetExporters method +func NewGetExportersRequest(server string, projectID ProjectID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s/exporters", 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 +} + +// NewCreateExporterRequest calls the generic CreateExporter builder with application/json body +func NewCreateExporterRequest(server string, projectID ProjectID, body CreateExporterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) return NewCreateExporterRequestWithBody(server, projectID, "application/json", bodyReader) } @@ -3635,6 +4139,75 @@ func NewUpdateExporterRequestWithBody(server string, projectID ProjectID, export return req, nil } +// NewResolveRefRequest constructs an http.Request for the ResolveRef method +func NewResolveRefRequest(server string, projectID ProjectID, params *ResolveRefParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, 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("/projects/%s/resolve", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "ref", params.Ref, 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.Type != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "type", *params.Type, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetServicesRequest constructs an http.Request for the GetServices method func NewGetServicesRequest(server string, projectID ProjectID, params *GetServicesParams) (*http.Request, error) { var err error @@ -4266,19 +4839,8 @@ func NewGetBackupsRequest(server string, projectID ProjectID, serviceID ServiceI return req, nil } -// NewDetachServiceFromAllowListRequest calls the generic DetachServiceFromAllowList builder with application/json body -func NewDetachServiceFromAllowListRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDetachServiceFromAllowListRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) -} - -// NewDetachServiceFromAllowListRequestWithBody constructs an http.Request for the DetachServiceFromAllowList method, with any body, and a specified content type -func NewDetachServiceFromAllowListRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetBranchesRequest constructs an http.Request for the GetBranches method +func NewGetBranchesRequest(server string, projectID ProjectID, serviceID ServiceID, params *GetBranchesParams) (*http.Request, error) { var err error var pathParam0 string @@ -4300,7 +4862,7 @@ func NewDetachServiceFromAllowListRequestWithBody(server string, projectID Proje return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/detachFromAllowList", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4310,29 +4872,54 @@ func NewDetachServiceFromAllowListRequestWithBody(server string, projectID Proje return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + 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.Ref != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "ref", *params.Ref, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDetachServiceFromExporterRequest calls the generic DetachServiceFromExporter builder with application/json body -func NewDetachServiceFromExporterRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody) (*http.Request, error) { +// NewCreateBranchRequest calls the generic CreateBranch builder with application/json body +func NewCreateBranchRequest(server string, projectID ProjectID, serviceID ServiceID, body CreateBranchJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewDetachServiceFromExporterRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return NewCreateBranchRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewDetachServiceFromExporterRequestWithBody constructs an http.Request for the DetachServiceFromExporter method, with any body, and a specified content type -func NewDetachServiceFromExporterRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateBranchRequestWithBody constructs an http.Request for the CreateBranch method, with any body, and a specified content type +func NewCreateBranchRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4354,7 +4941,7 @@ func NewDetachServiceFromExporterRequestWithBody(server string, projectID Projec return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/detachFromExporter", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4374,19 +4961,8 @@ func NewDetachServiceFromExporterRequestWithBody(server string, projectID Projec return req, nil } -// NewDetachServiceFromVPCRequest calls the generic DetachServiceFromVPC builder with application/json body -func NewDetachServiceFromVPCRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDetachServiceFromVPCRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) -} - -// NewDetachServiceFromVPCRequestWithBody constructs an http.Request for the DetachServiceFromVPC method, with any body, and a specified content type -func NewDetachServiceFromVPCRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteBranchRequest constructs an http.Request for the DeleteBranch method +func NewDeleteBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID) (*http.Request, error) { var err error var pathParam0 string @@ -4403,12 +4979,19 @@ func NewDetachServiceFromVPCRequestWithBody(server string, projectID ProjectID, return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/detachFromVPC", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4418,18 +5001,16 @@ func NewDetachServiceFromVPCRequestWithBody(server string, projectID ProjectID, 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 } -// NewDisablePoolerRequest constructs an http.Request for the DisablePooler method -func NewDisablePoolerRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewGetBranchRequest constructs an http.Request for the GetBranch method +func NewGetBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID) (*http.Request, error) { var err error var pathParam0 string @@ -4446,12 +5027,19 @@ func NewDisablePoolerRequest(server string, projectID ProjectID, serviceID Servi return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/disablePooler", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4461,7 +5049,7 @@ func NewDisablePoolerRequest(server string, projectID ProjectID, serviceID Servi return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -4469,8 +5057,19 @@ func NewDisablePoolerRequest(server string, projectID ProjectID, serviceID Servi return req, nil } -// NewEnableDataTieringRequest constructs an http.Request for the EnableDataTiering method -func NewEnableDataTieringRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewRenameBranchRequest calls the generic RenameBranch builder with application/json body +func NewRenameBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, body RenameBranchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRenameBranchRequestWithBody(server, projectID, serviceID, branchID, "application/json", bodyReader) +} + +// NewRenameBranchRequestWithBody constructs an http.Request for the RenameBranch method, with any body, and a specified content type +func NewRenameBranchRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4487,12 +5086,19 @@ func NewEnableDataTieringRequest(server string, projectID ProjectID, serviceID S return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/enableDataTiering", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s/rename", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4502,16 +5108,29 @@ func NewEnableDataTieringRequest(server string, projectID ProjectID, serviceID S return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewEnablePoolerRequest constructs an http.Request for the EnablePooler method -func NewEnablePoolerRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewResizeBranchRequest calls the generic ResizeBranch builder with application/json body +func NewResizeBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, body ResizeBranchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewResizeBranchRequestWithBody(server, projectID, serviceID, branchID, "application/json", bodyReader) +} + +// NewResizeBranchRequestWithBody constructs an http.Request for the ResizeBranch method, with any body, and a specified content type +func NewResizeBranchRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4528,12 +5147,19 @@ func NewEnablePoolerRequest(server string, projectID ProjectID, serviceID Servic return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/enablePooler", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s/resize", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4543,27 +5169,18 @@ func NewEnablePoolerRequest(server string, projectID ProjectID, serviceID Servic return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewForkServiceRequest calls the generic ForkService builder with application/json body -func NewForkServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewForkServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return req, nil } -// NewForkServiceRequestWithBody constructs an http.Request for the ForkService method, with any body, and a specified content type -func NewForkServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewStartBranchRequest constructs an http.Request for the StartBranch method +func NewStartBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID) (*http.Request, error) { var err error var pathParam0 string @@ -4580,12 +5197,19 @@ func NewForkServiceRequestWithBody(server string, projectID ProjectID, serviceID return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/forkService", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s/start", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4595,18 +5219,16 @@ func NewForkServiceRequestWithBody(server string, projectID ProjectID, serviceID return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewGetServiceLogsRequest constructs an http.Request for the GetServiceLogs method -func NewGetServiceLogsRequest(server string, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams) (*http.Request, error) { +// NewStopBranchRequest constructs an http.Request for the StopBranch method +func NewStopBranchRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID) (*http.Request, error) { var err error var pathParam0 string @@ -4623,12 +5245,19 @@ func NewGetServiceLogsRequest(server string, projectID ProjectID, serviceID Serv return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/logs", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s/stop", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4638,94 +5267,7 @@ func NewGetServiceLogsRequest(server string, projectID ProjectID, serviceID Serv 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.Node != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "node", *params.Node, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Cursor != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, 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.Until != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "until", *params.Until, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Since != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "since", *params.Since, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); 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: "array", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Severities != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "severities", *params.Severities, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } - - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -4733,8 +5275,19 @@ func NewGetServiceLogsRequest(server string, projectID ProjectID, serviceID Serv return req, nil } -// NewGetServiceMetricsAvailableSeriesRequest constructs an http.Request for the GetServiceMetricsAvailableSeries method -func NewGetServiceMetricsAvailableSeriesRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewUpdateBranchPasswordRequest calls the generic UpdateBranchPassword builder with application/json body +func NewUpdateBranchPasswordRequest(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, body UpdateBranchPasswordJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateBranchPasswordRequestWithBody(server, projectID, serviceID, branchID, "application/json", bodyReader) +} + +// NewUpdateBranchPasswordRequestWithBody constructs an http.Request for the UpdateBranchPassword method, with any body, and a specified content type +func NewUpdateBranchPasswordRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4751,12 +5304,19 @@ func NewGetServiceMetricsAvailableSeriesRequest(server string, projectID Project return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "branch_id", branchID, 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("/projects/%s/services/%s/metrics/available-series", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/branches/%s/updatePassword", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4766,16 +5326,29 @@ func NewGetServiceMetricsAvailableSeriesRequest(server string, projectID Project 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 } -// NewGetServiceMetricDetailsRequest constructs an http.Request for the GetServiceMetricDetails method -func NewGetServiceMetricDetailsRequest(server string, projectID ProjectID, serviceID ServiceID, metricName string) (*http.Request, error) { +// NewDetachServiceFromAllowListRequest calls the generic DetachServiceFromAllowList builder with application/json body +func NewDetachServiceFromAllowListRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDetachServiceFromAllowListRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) +} + +// NewDetachServiceFromAllowListRequestWithBody constructs an http.Request for the DetachServiceFromAllowList method, with any body, and a specified content type +func NewDetachServiceFromAllowListRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4792,19 +5365,12 @@ func NewGetServiceMetricDetailsRequest(server string, projectID ProjectID, servi return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "metric_name", metricName, 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("/projects/%s/services/%s/metrics/details/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/detachFromAllowList", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4814,27 +5380,29 @@ func NewGetServiceMetricDetailsRequest(server string, projectID ProjectID, servi 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 } -// NewGetServiceMetricsSeriesRequest calls the generic GetServiceMetricsSeries builder with application/json body -func NewGetServiceMetricsSeriesRequest(server string, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody) (*http.Request, error) { +// NewDetachServiceFromExporterRequest calls the generic DetachServiceFromExporter builder with application/json body +func NewDetachServiceFromExporterRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewGetServiceMetricsSeriesRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return NewDetachServiceFromExporterRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewGetServiceMetricsSeriesRequestWithBody constructs an http.Request for the GetServiceMetricsSeries method, with any body, and a specified content type -func NewGetServiceMetricsSeriesRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewDetachServiceFromExporterRequestWithBody constructs an http.Request for the DetachServiceFromExporter method, with any body, and a specified content type +func NewDetachServiceFromExporterRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4856,7 +5424,7 @@ func NewGetServiceMetricsSeriesRequestWithBody(server string, projectID ProjectI return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/metrics/series", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/detachFromExporter", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4876,19 +5444,19 @@ func NewGetServiceMetricsSeriesRequestWithBody(server string, projectID ProjectI return req, nil } -// NewRenameServiceRequest calls the generic RenameService builder with application/json body -func NewRenameServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody) (*http.Request, error) { +// NewDetachServiceFromVPCRequest calls the generic DetachServiceFromVPC builder with application/json body +func NewDetachServiceFromVPCRequest(server string, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRenameServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return NewDetachServiceFromVPCRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewRenameServiceRequestWithBody constructs an http.Request for the RenameService method, with any body, and a specified content type -func NewRenameServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewDetachServiceFromVPCRequestWithBody constructs an http.Request for the DetachServiceFromVPC method, with any body, and a specified content type +func NewDetachServiceFromVPCRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4910,7 +5478,7 @@ func NewRenameServiceRequestWithBody(server string, projectID ProjectID, service return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/rename", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/detachFromVPC", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4930,8 +5498,8 @@ func NewRenameServiceRequestWithBody(server string, projectID ProjectID, service return req, nil } -// NewGetReplicaSetsRequest constructs an http.Request for the GetReplicaSets method -func NewGetReplicaSetsRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewDisablePoolerRequest constructs an http.Request for the DisablePooler method +func NewDisablePoolerRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -4953,7 +5521,7 @@ func NewGetReplicaSetsRequest(server string, projectID ProjectID, serviceID Serv return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/disablePooler", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4963,7 +5531,7 @@ func NewGetReplicaSetsRequest(server string, projectID ProjectID, serviceID Serv return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -4971,19 +5539,8 @@ func NewGetReplicaSetsRequest(server string, projectID ProjectID, serviceID Serv return req, nil } -// NewCreateReplicaSetRequest calls the generic CreateReplicaSet builder with application/json body -func NewCreateReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateReplicaSetRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) -} - -// NewCreateReplicaSetRequestWithBody constructs an http.Request for the CreateReplicaSet method, with any body, and a specified content type -func NewCreateReplicaSetRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewEnableDataTieringRequest constructs an http.Request for the EnableDataTiering method +func NewEnableDataTieringRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5005,7 +5562,7 @@ func NewCreateReplicaSetRequestWithBody(server string, projectID ProjectID, serv return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/enableDataTiering", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5015,18 +5572,16 @@ func NewCreateReplicaSetRequestWithBody(server string, projectID ProjectID, serv return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteReplicaSetRequest constructs an http.Request for the DeleteReplicaSet method -func NewDeleteReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { +// NewEnablePoolerRequest constructs an http.Request for the EnablePooler method +func NewEnablePoolerRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5043,19 +5598,12 @@ func NewDeleteReplicaSetRequest(server string, projectID ProjectID, serviceID Se return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/replicaSets/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/enablePooler", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5065,7 +5613,7 @@ func NewDeleteReplicaSetRequest(server string, projectID ProjectID, serviceID Se return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -5073,8 +5621,19 @@ func NewDeleteReplicaSetRequest(server string, projectID ProjectID, serviceID Se return req, nil } -// NewDisableReplicaPoolerRequest constructs an http.Request for the DisableReplicaPooler method -func NewDisableReplicaPoolerRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { +// NewForkServiceRequest calls the generic ForkService builder with application/json body +func NewForkServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewForkServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) +} + +// NewForkServiceRequestWithBody constructs an http.Request for the ForkService method, with any body, and a specified content type +func NewForkServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5091,19 +5650,12 @@ func NewDisableReplicaPoolerRequest(server string, projectID ProjectID, serviceI return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/replicaSets/%s/disablePooler", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/forkService", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5113,16 +5665,18 @@ func NewDisableReplicaPoolerRequest(server string, projectID ProjectID, serviceI return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewEnableReplicaPoolerRequest constructs an http.Request for the EnableReplicaPooler method -func NewEnableReplicaPoolerRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { +// NewGetServiceLogsRequest constructs an http.Request for the GetServiceLogs method +func NewGetServiceLogsRequest(server string, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams) (*http.Request, error) { var err error var pathParam0 string @@ -5139,19 +5693,12 @@ func NewEnableReplicaPoolerRequest(server string, projectID ProjectID, serviceID return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/replicaSets/%s/enablePooler", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/logs", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5161,27 +5708,103 @@ func NewEnableReplicaPoolerRequest(server string, projectID ProjectID, serviceID return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) - 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 - return req, nil -} + if params.Node != nil { -// NewResizeReplicaSetRequest calls the generic ResizeReplicaSet builder with application/json body -func NewResizeReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "node", *params.Node, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, 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.Until != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "until", *params.Until, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Since != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "since", *params.Since, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); 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: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Severities != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "severities", *params.Severities, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewResizeReplicaSetRequestWithBody(server, projectID, serviceID, replicaSetID, "application/json", bodyReader) + + return req, nil } -// NewResizeReplicaSetRequestWithBody constructs an http.Request for the ResizeReplicaSet method, with any body, and a specified content type -func NewResizeReplicaSetRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetServiceMetricsAvailableSeriesRequest constructs an http.Request for the GetServiceMetricsAvailableSeries method +func NewGetServiceMetricsAvailableSeriesRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5198,19 +5821,12 @@ func NewResizeReplicaSetRequestWithBody(server string, projectID ProjectID, serv return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/replicaSets/%s/resize", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/metrics/available-series", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5220,29 +5836,16 @@ func NewResizeReplicaSetRequestWithBody(server string, projectID ProjectID, serv return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewSetReplicaEnvironmentRequest calls the generic SetReplicaEnvironment builder with application/json body -func NewSetReplicaEnvironmentRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetReplicaEnvironmentRequestWithBody(server, projectID, serviceID, replicaSetID, "application/json", bodyReader) -} - -// NewSetReplicaEnvironmentRequestWithBody constructs an http.Request for the SetReplicaEnvironment method, with any body, and a specified content type -func NewSetReplicaEnvironmentRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetServiceMetricDetailsRequest constructs an http.Request for the GetServiceMetricDetails method +func NewGetServiceMetricDetailsRequest(server string, projectID ProjectID, serviceID ServiceID, metricName string) (*http.Request, error) { var err error var pathParam0 string @@ -5261,7 +5864,7 @@ func NewSetReplicaEnvironmentRequestWithBody(server string, projectID ProjectID, var pathParam2 string - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "metric_name", metricName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5271,7 +5874,7 @@ func NewSetReplicaEnvironmentRequestWithBody(server string, projectID ProjectID, return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s/setEnvironment", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/metrics/details/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5281,29 +5884,27 @@ func NewSetReplicaEnvironmentRequestWithBody(server string, projectID ProjectID, return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewResizeServiceRequest calls the generic ResizeService builder with application/json body -func NewResizeServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody) (*http.Request, error) { +// NewGetServiceMetricsSeriesRequest calls the generic GetServiceMetricsSeries builder with application/json body +func NewGetServiceMetricsSeriesRequest(server string, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewResizeServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return NewGetServiceMetricsSeriesRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewResizeServiceRequestWithBody constructs an http.Request for the ResizeService method, with any body, and a specified content type -func NewResizeServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetServiceMetricsSeriesRequestWithBody constructs an http.Request for the GetServiceMetricsSeries method, with any body, and a specified content type +func NewGetServiceMetricsSeriesRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5325,7 +5926,7 @@ func NewResizeServiceRequestWithBody(server string, projectID ProjectID, service return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/resize", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/metrics/series", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5345,19 +5946,19 @@ func NewResizeServiceRequestWithBody(server string, projectID ProjectID, service return req, nil } -// NewSetEnvironmentRequest calls the generic SetEnvironment builder with application/json body -func NewSetEnvironmentRequest(server string, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody) (*http.Request, error) { +// NewRenameServiceRequest calls the generic RenameService builder with application/json body +func NewRenameServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewSetEnvironmentRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) + return NewRenameServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewSetEnvironmentRequestWithBody constructs an http.Request for the SetEnvironment method, with any body, and a specified content type -func NewSetEnvironmentRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewRenameServiceRequestWithBody constructs an http.Request for the RenameService method, with any body, and a specified content type +func NewRenameServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5379,7 +5980,7 @@ func NewSetEnvironmentRequestWithBody(server string, projectID ProjectID, servic return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/setEnvironment", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/rename", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5399,19 +6000,8 @@ func NewSetEnvironmentRequestWithBody(server string, projectID ProjectID, servic return req, nil } -// NewSetHAReplicaRequest calls the generic SetHAReplica builder with application/json body -func NewSetHAReplicaRequest(server string, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetHAReplicaRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) -} - -// NewSetHAReplicaRequestWithBody constructs an http.Request for the SetHAReplica method, with any body, and a specified content type -func NewSetHAReplicaRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetReplicaSetsRequest constructs an http.Request for the GetReplicaSets method +func NewGetReplicaSetsRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5433,7 +6023,7 @@ func NewSetHAReplicaRequestWithBody(server string, projectID ProjectID, serviceI return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/setHA", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5443,18 +6033,27 @@ func NewSetHAReplicaRequestWithBody(server string, projectID ProjectID, serviceI return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewStartServiceRequest constructs an http.Request for the StartService method -func NewStartServiceRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewCreateReplicaSetRequest calls the generic CreateReplicaSet builder with application/json body +func NewCreateReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateReplicaSetRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) +} + +// NewCreateReplicaSetRequestWithBody constructs an http.Request for the CreateReplicaSet method, with any body, and a specified content type +func NewCreateReplicaSetRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5476,7 +6075,7 @@ func NewStartServiceRequest(server string, projectID ProjectID, serviceID Servic return nil, err } - operationPath := fmt.Sprintf("/projects/%s/services/%s/start", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5486,16 +6085,18 @@ func NewStartServiceRequest(server string, projectID ProjectID, serviceID Servic return nil, err } - req, err := http.NewRequest(http.MethodPost, 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 } -// NewStopServiceRequest constructs an http.Request for the StopService method -func NewStopServiceRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { +// NewDeleteReplicaSetRequest constructs an http.Request for the DeleteReplicaSet method +func NewDeleteReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { var err error var pathParam0 string @@ -5512,12 +6113,19 @@ func NewStopServiceRequest(server string, projectID ProjectID, serviceID Service return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/stop", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5527,7 +6135,7 @@ func NewStopServiceRequest(server string, projectID ProjectID, serviceID Service return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -5535,19 +6143,8 @@ func NewStopServiceRequest(server string, projectID ProjectID, serviceID Service return req, nil } -// NewUpdatePasswordRequest calls the generic UpdatePassword builder with application/json body -func NewUpdatePasswordRequest(server string, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdatePasswordRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) -} - -// NewUpdatePasswordRequestWithBody constructs an http.Request for the UpdatePassword method, with any body, and a specified content type -func NewUpdatePasswordRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { +// NewDisableReplicaPoolerRequest constructs an http.Request for the DisableReplicaPooler method +func NewDisableReplicaPoolerRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { var err error var pathParam0 string @@ -5564,12 +6161,19 @@ func NewUpdatePasswordRequestWithBody(server string, projectID ProjectID, servic return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/services/%s/updatePassword", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s/disablePooler", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5579,18 +6183,16 @@ func NewUpdatePasswordRequestWithBody(server string, projectID ProjectID, servic return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewGetVPCsRequest constructs an http.Request for the GetVPCs method -func NewGetVPCsRequest(server string, projectID ProjectID) (*http.Request, error) { +// NewEnableReplicaPoolerRequest constructs an http.Request for the EnableReplicaPooler method +func NewEnableReplicaPoolerRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID) (*http.Request, error) { var err error var pathParam0 string @@ -5600,42 +6202,56 @@ func NewGetVPCsRequest(server string, projectID ProjectID) (*http.Request, error return nil, err } - serverURL, err := url.Parse(server) + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + var pathParam2 string - queryURL, err := serverURL.Parse(operationPath) + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + serverURL, err := url.Parse(server) if err != nil { return nil, err } - return req, nil -} + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s/enablePooler", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// NewCreateVPCRequest calls the generic CreateVPC builder with application/json body -func NewCreateVPCRequest(server string, projectID ProjectID, body CreateVPCJSONRequestBody) (*http.Request, error) { + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewResizeReplicaSetRequest calls the generic ResizeReplicaSet builder with application/json body +func NewResizeReplicaSetRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateVPCRequestWithBody(server, projectID, "application/json", bodyReader) + return NewResizeReplicaSetRequestWithBody(server, projectID, serviceID, replicaSetID, "application/json", bodyReader) } -// NewCreateVPCRequestWithBody constructs an http.Request for the CreateVPC method, with any body, and a specified content type -func NewCreateVPCRequestWithBody(server string, projectID ProjectID, contentType string, body io.Reader) (*http.Request, error) { +// NewResizeReplicaSetRequestWithBody constructs an http.Request for the ResizeReplicaSet method, with any body, and a specified content type +func NewResizeReplicaSetRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5645,12 +6261,26 @@ func NewCreateVPCRequestWithBody(server string, projectID ProjectID, contentType return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, 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("/projects/%s/vpcs", pathParam0) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s/resize", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5670,8 +6300,19 @@ func NewCreateVPCRequestWithBody(server string, projectID ProjectID, contentType return req, nil } -// NewDeleteVPCRequest constructs an http.Request for the DeleteVPC method -func NewDeleteVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { +// NewSetReplicaEnvironmentRequest calls the generic SetReplicaEnvironment builder with application/json body +func NewSetReplicaEnvironmentRequest(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetReplicaEnvironmentRequestWithBody(server, projectID, serviceID, replicaSetID, "application/json", bodyReader) +} + +// NewSetReplicaEnvironmentRequestWithBody constructs an http.Request for the SetReplicaEnvironment method, with any body, and a specified content type +func NewSetReplicaEnvironmentRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5683,7 +6324,14 @@ func NewDeleteVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "replica_set_id", replicaSetID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5693,7 +6341,7 @@ func NewDeleteVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/replicaSets/%s/setEnvironment", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5703,16 +6351,29 @@ func NewDeleteVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http 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 } -// NewGetVPCRequest constructs an http.Request for the GetVPC method -func NewGetVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { +// NewResizeServiceRequest calls the generic ResizeService builder with application/json body +func NewResizeServiceRequest(server string, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewResizeServiceRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) +} + +// NewResizeServiceRequestWithBody constructs an http.Request for the ResizeService method, with any body, and a specified content type +func NewResizeServiceRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5724,7 +6385,7 @@ func NewGetVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Re var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5734,7 +6395,7 @@ func NewGetVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/resize", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5744,16 +6405,29 @@ func NewGetVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Re 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 } -// NewGetVPCPeeringsRequest constructs an http.Request for the GetVPCPeerings method -func NewGetVPCPeeringsRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { +// NewSetEnvironmentRequest calls the generic SetEnvironment builder with application/json body +func NewSetEnvironmentRequest(server string, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetEnvironmentRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) +} + +// NewSetEnvironmentRequestWithBody constructs an http.Request for the SetEnvironment method, with any body, and a specified content type +func NewSetEnvironmentRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5765,7 +6439,7 @@ func NewGetVPCPeeringsRequest(server string, projectID ProjectID, vpcID VPCId) ( var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5775,7 +6449,7 @@ func NewGetVPCPeeringsRequest(server string, projectID ProjectID, vpcID VPCId) ( return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s/peerings", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/setEnvironment", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5785,27 +6459,29 @@ func NewGetVPCPeeringsRequest(server string, projectID ProjectID, vpcID VPCId) ( 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 } -// NewCreateVPCPeeringRequest calls the generic CreateVPCPeering builder with application/json body -func NewCreateVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody) (*http.Request, error) { +// NewSetHAReplicaRequest calls the generic SetHAReplica builder with application/json body +func NewSetHAReplicaRequest(server string, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateVPCPeeringRequestWithBody(server, projectID, vpcID, "application/json", bodyReader) + return NewSetHAReplicaRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewCreateVPCPeeringRequestWithBody constructs an http.Request for the CreateVPCPeering method, with any body, and a specified content type -func NewCreateVPCPeeringRequestWithBody(server string, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader) (*http.Request, error) { +// NewSetHAReplicaRequestWithBody constructs an http.Request for the SetHAReplica method, with any body, and a specified content type +func NewSetHAReplicaRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5817,7 +6493,7 @@ func NewCreateVPCPeeringRequestWithBody(server string, projectID ProjectID, vpcI var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5827,7 +6503,7 @@ func NewCreateVPCPeeringRequestWithBody(server string, projectID ProjectID, vpcI return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s/peerings", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/setHA", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5847,8 +6523,8 @@ func NewCreateVPCPeeringRequestWithBody(server string, projectID ProjectID, vpcI return req, nil } -// NewDeleteVPCPeeringRequest constructs an http.Request for the DeleteVPCPeering method -func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, peeringID PeeringID) (*http.Request, error) { +// NewStartServiceRequest constructs an http.Request for the StartService method +func NewStartServiceRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5860,14 +6536,7 @@ func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "peering_id", peeringID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5877,7 +6546,7 @@ func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s/peerings/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/start", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5887,7 +6556,7 @@ func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -5895,8 +6564,8 @@ func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, return req, nil } -// NewGetVPCPeeringRequest constructs an http.Request for the GetVPCPeering method -func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, peeringID PeeringID) (*http.Request, error) { +// NewStopServiceRequest constructs an http.Request for the StopService method +func NewStopServiceRequest(server string, projectID ProjectID, serviceID ServiceID) (*http.Request, error) { var err error var pathParam0 string @@ -5908,14 +6577,7 @@ func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, pe var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithOptions("simple", false, "peering_id", peeringID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5925,7 +6587,7 @@ func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, pe return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s/peerings/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/projects/%s/services/%s/stop", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5935,7 +6597,7 @@ func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, pe return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -5943,19 +6605,19 @@ func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, pe return req, nil } -// NewRenameVPCRequest calls the generic RenameVPC builder with application/json body -func NewRenameVPCRequest(server string, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody) (*http.Request, error) { +// NewUpdatePasswordRequest calls the generic UpdatePassword builder with application/json body +func NewUpdatePasswordRequest(server string, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewRenameVPCRequestWithBody(server, projectID, vpcID, "application/json", bodyReader) + return NewUpdatePasswordRequestWithBody(server, projectID, serviceID, "application/json", bodyReader) } -// NewRenameVPCRequestWithBody constructs an http.Request for the RenameVPC method, with any body, and a specified content type -func NewRenameVPCRequestWithBody(server string, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdatePasswordRequestWithBody constructs an http.Request for the UpdatePassword method, with any body, and a specified content type +func NewUpdatePasswordRequestWithBody(server string, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5967,7 +6629,7 @@ func NewRenameVPCRequestWithBody(server string, projectID ProjectID, vpcID VPCId var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "service_id", serviceID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5977,7 +6639,7 @@ func NewRenameVPCRequestWithBody(server string, projectID ProjectID, vpcID VPCId return nil, err } - operationPath := fmt.Sprintf("/projects/%s/vpcs/%s/rename", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/projects/%s/services/%s/updatePassword", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5997,1126 +6659,2167 @@ func NewRenameVPCRequestWithBody(server string, projectID ProjectID, vpcID VPCId 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 - } +// NewGetVPCsRequest constructs an http.Request for the GetVPCs method +func NewGetVPCsRequest(server string, projectID ProjectID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return nil -} -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + operationPath := fmt.Sprintf("/projects/%s/vpcs", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// 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...) + queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, 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 +// NewCreateVPCRequest calls the generic CreateVPC builder with application/json body +func NewCreateVPCRequest(server string, projectID ProjectID, body CreateVPCJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateVPCRequestWithBody(server, projectID, "application/json", bodyReader) } -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { +// NewCreateVPCRequestWithBody constructs an http.Request for the CreateVPC method, with any body, and a specified content type +func NewCreateVPCRequestWithBody(server string, projectID ProjectID, contentType string, body io.Reader) (*http.Request, error) { + var err error - // IdentifyUserWithBodyWithResponse Identify a user - // - // Identifies a user with optional properties for analytics tracking. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). - IdentifyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, 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("/projects/%s/vpcs", 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 +} + +// NewDeleteVPCRequest constructs an http.Request for the DeleteVPC method +func NewDeleteVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, 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("/projects/%s/vpcs/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetVPCRequest constructs an http.Request for the GetVPC method +func NewGetVPCRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, 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("/projects/%s/vpcs/%s", pathParam0, pathParam1) + 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 +} + +// NewGetVPCPeeringsRequest constructs an http.Request for the GetVPCPeerings method +func NewGetVPCPeeringsRequest(server string, projectID ProjectID, vpcID VPCId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, 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("/projects/%s/vpcs/%s/peerings", pathParam0, pathParam1) + 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 +} + +// NewCreateVPCPeeringRequest calls the generic CreateVPCPeering builder with application/json body +func NewCreateVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateVPCPeeringRequestWithBody(server, projectID, vpcID, "application/json", bodyReader) +} + +// NewCreateVPCPeeringRequestWithBody constructs an http.Request for the CreateVPCPeering method, with any body, and a specified content type +func NewCreateVPCPeeringRequestWithBody(server string, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, 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("/projects/%s/vpcs/%s/peerings", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteVPCPeeringRequest constructs an http.Request for the DeleteVPCPeering method +func NewDeleteVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, peeringID PeeringID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "peering_id", peeringID, 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("/projects/%s/vpcs/%s/peerings/%s", pathParam0, pathParam1, pathParam2) + 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 +} + +// NewGetVPCPeeringRequest constructs an http.Request for the GetVPCPeering method +func NewGetVPCPeeringRequest(server string, projectID ProjectID, vpcID VPCId, peeringID PeeringID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithOptions("simple", false, "peering_id", peeringID, 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("/projects/%s/vpcs/%s/peerings/%s", pathParam0, pathParam1, pathParam2) + 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 +} + +// NewRenameVPCRequest calls the generic RenameVPC builder with application/json body +func NewRenameVPCRequest(server string, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRenameVPCRequestWithBody(server, projectID, vpcID, "application/json", bodyReader) +} + +// NewRenameVPCRequestWithBody constructs an http.Request for the RenameVPC method, with any body, and a specified content type +func NewRenameVPCRequestWithBody(server string, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", projectID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "vpc_id", vpcID, 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("/projects/%s/vpcs/%s/rename", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), 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 { + + // IdentifyUserWithBodyWithResponse Identify a user + // + // Identifies a user with optional properties for analytics tracking. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). + IdentifyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) + + // IdentifyUserWithResponse Identify a user + // + // Identifies a user with optional properties for analytics tracking. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). + IdentifyUserWithResponse(ctx context.Context, body IdentifyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) + + // TrackEventWithBodyWithResponse Track an analytics event + // + // Tracks an analytics event with optional properties. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /analytics/track (the `TrackEvent` operationId). + TrackEventWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) + + // TrackEventWithResponse Track an analytics event + // + // Tracks an analytics event with optional properties. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /analytics/track (the `TrackEvent` operationId). + TrackEventWithResponse(ctx context.Context, body TrackEventJSONRequestBody, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) + + // GetAuthInfoWithResponse Get Authentication Info + // + // Returns the authenticated caller's identity. The response shape depends on the credential type: `apiKey` for PAT + // callers, `oauth` for OAuth user callers. Exactly one of `api_key` or `oauth` is populated; + // `type` discriminates. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /auth/info (the `GetAuthInfo` operationId). + GetAuthInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthInfoResponse, error) + + // LogoutWithBodyWithResponse Log out and revoke refresh token + // + // Revokes the caller's refresh token server-side. For OAuth Bearer + // callers, include the refresh token in the request body — it is held + // client-side and cannot be derived from the access token. Callers + // without a refresh token to revoke may post an + // empty body to clear server-side session state best-effort. + // + // Returns 204 No Content on success. The caller is still responsible + // for dropping any locally-cached credentials. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /auth/logout (the `Logout` operationId). + LogoutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LogoutResponse, error) + + // LogoutWithResponse Log out and revoke refresh token + // + // Revokes the caller's refresh token server-side. For OAuth Bearer + // callers, include the refresh token in the request body — it is held + // client-side and cannot be derived from the access token. Callers + // without a refresh token to revoke may post an + // empty body to clear server-side session state best-effort. + // + // Returns 204 No Content on success. The caller is still responsible + // for dropping any locally-cached credentials. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /auth/logout (the `Logout` operationId). + LogoutWithResponse(ctx context.Context, body LogoutJSONRequestBody, reqEditors ...RequestEditorFn) (*LogoutResponse, error) + + // SubmitFeedbackWithBodyWithResponse Submit feedback + // + // Sends feedback, a bug report, or a support request to Tiger Data. + // + // The submitter's email address is resolved from the caller's + // credentials, and the client version and operating system from the + // `User-Agent` header, so neither is supplied in the body. + // + // Returns 204 No Content on success. This endpoint opens no support + // case and returns no ticket to track: use it for unsolicited feedback, + // and raise anything needing a tracked response through support. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /feedback (the `SubmitFeedback` operationId). + SubmitFeedbackWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) + + // SubmitFeedbackWithResponse Submit feedback + // + // Sends feedback, a bug report, or a support request to Tiger Data. + // + // The submitter's email address is resolved from the caller's + // credentials, and the client version and operating system from the + // `User-Agent` header, so neither is supplied in the body. + // + // Returns 204 No Content on success. This endpoint opens no support + // case and returns no ticket to track: use it for unsolicited feedback, + // and raise anything needing a tracked response through support. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /feedback (the `SubmitFeedback` operationId). + SubmitFeedbackWithResponse(ctx context.Context, body SubmitFeedbackJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) + + // GetProjectsWithResponse List projects accessible to the authenticated caller + // + // Returns the projects the caller can access. PAT callers see only the + // project their PAT is scoped to; OAuth user callers see all projects + // they belong to. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects (the `GetProjects` operationId). + GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) + + // GetAllowListsWithResponse List All IP Allow Lists + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves every IP allow list in a project. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/allow-lists (the `GetAllowLists` operationId). + GetAllowListsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetAllowListsResponse, error) + + // CreateAllowListWithBodyWithResponse Create an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates an IP allow list in a project. An IP allow list carries no + // effect until it is attached to a service. + // + // The number of CIDR blocks per list and the number of lists per + // project are plan-dependent. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). + CreateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) + + // CreateAllowListWithResponse Create an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates an IP allow list in a project. An IP allow list carries no + // effect until it is attached to a service. + // + // The number of CIDR blocks per list and the number of lists per + // project are plan-dependent. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). + CreateAllowListWithResponse(ctx context.Context, projectID ProjectID, body CreateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) + + // DeleteAllowListWithResponse Delete an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Deletes an IP allow list. Refused if the list is still attached to + // any service. Detach it first. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /projects/{project_id}/allow-lists/{allow_list_id} (the `DeleteAllowList` operationId). + DeleteAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*DeleteAllowListResponse, error) + + // GetAllowListWithResponse Get an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a single IP allow list. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/allow-lists/{allow_list_id} (the `GetAllowList` operationId). + GetAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*GetAllowListResponse, error) + + // UpdateAllowListWithBodyWithResponse Update an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates an IP allow list in place. Send `description` and/or + // `cidr_blocks` to change them; omit either one to leave it + // unchanged. + // + // Every service the IP allow list is attached to is updated with the + // new CIDR blocks. To remove every CIDR block, delete the IP allow + // list instead of sending an empty `cidr_blocks`. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). + UpdateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) + + // UpdateAllowListWithResponse Update an IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates an IP allow list in place. Send `description` and/or + // `cidr_blocks` to change them; omit either one to leave it + // unchanged. + // + // Every service the IP allow list is attached to is updated with the + // new CIDR blocks. To remove every CIDR block, delete the IP allow + // list instead of sending an empty `cidr_blocks`. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). + UpdateAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, body UpdateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) + + // GetProjectBranchesWithResponse List All Branches in a Project + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a list of all branches within a specific project, regardless + // of parent service. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/branches (the `GetProjectBranches` operationId). + GetProjectBranchesWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetProjectBranchesResponse, error) + + // GetExportersWithResponse List All Exporters + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves every exporter in a project, across every region. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/exporters (the `GetExporters` operationId). + GetExportersWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetExportersResponse, error) + + // CreateExporterWithBodyWithResponse Create an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates an exporter in a project and region. + // + // An exporter carries no data until it is attached to a service. + // + // Exporters aren't available on every plan. If your project's plan + // doesn't include them, this request is refused here rather than later, + // when you try to attach one. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). + CreateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) + + // CreateExporterWithResponse Create an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates an exporter in a project and region. + // + // An exporter carries no data until it is attached to a service. + // + // Exporters aren't available on every plan. If your project's plan + // doesn't include them, this request is refused here rather than later, + // when you try to attach one. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). + CreateExporterWithResponse(ctx context.Context, projectID ProjectID, body CreateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) + + // DeleteExporterWithResponse Delete an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Deletes an exporter and stops the data it was sending. Any service + // still attached is detached automatically. You don't need to detach it + // first, and nothing errors if you don't. + // + // Data already delivered to the destination is untouched, and nothing on + // the services themselves changes. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /projects/{project_id}/exporters/{exporter_id} (the `DeleteExporter` operationId). + DeleteExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*DeleteExporterResponse, error) + + // GetExporterWithResponse Get an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a single exporter. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/exporters/{exporter_id} (the `GetExporter` operationId). + GetExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*GetExporterResponse, error) + + // UpdateExporterWithBodyWithResponse Update an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates an exporter in place. Send `config` to replace the whole + // configuration; omit it to leave the configuration unchanged. + // + // Every service the exporter is attached to picks up the change; there + // is no need to detach and reattach. + // + // `type` must be included and must match the exporter's existing type; + // it cannot be changed. To send data somewhere else, create a new + // exporter and move the services over. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). + UpdateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) + + // UpdateExporterWithResponse Update an Exporter + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates an exporter in place. Send `config` to replace the whole + // configuration; omit it to leave the configuration unchanged. + // + // Every service the exporter is attached to picks up the change; there + // is no need to detach and reattach. + // + // `type` must be included and must match the exporter's existing type; + // it cannot be changed. To send data somewhere else, create a new + // exporter and move the services over. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). + UpdateExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, body UpdateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) + + // ResolveRefWithResponse Resolve a Service, Branch, or Read Replica Set + // + // Resolves `ref` to the service, branch, or read replica set it names. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/resolve (the `ResolveRef` operationId). + ResolveRefWithResponse(ctx context.Context, projectID ProjectID, params *ResolveRefParams, reqEditors ...RequestEditorFn) (*ResolveRefResponse, error) + + // GetServicesWithResponse List All Services + // + // Retrieves a list of all services within a specific project. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services (the `GetServices` operationId). + GetServicesWithResponse(ctx context.Context, projectID ProjectID, params *GetServicesParams, reqEditors ...RequestEditorFn) (*GetServicesResponse, error) + + // CreateServiceWithBodyWithResponse Create a Service + // + // Creates a new database service within a project. This is an asynchronous operation. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). + CreateServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + + // CreateServiceWithResponse Create a Service + // + // Creates a new database service within a project. This is an asynchronous operation. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). + CreateServiceWithResponse(ctx context.Context, projectID ProjectID, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + + // DeleteServiceWithResponse Delete a Service + // + // Deletes a specific service. This is an asynchronous operation. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /projects/{project_id}/services/{service_id} (the `DeleteService` operationId). + DeleteServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) - // IdentifyUserWithResponse Identify a user + // GetServiceWithResponse Get a Service // - // Identifies a user with optional properties for analytics tracking. + // Retrieves the details of a specific service by its ID. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services/{service_id} (the `GetService` operationId). + GetServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) + + // AttachServiceToAllowListWithBodyWithResponse Attach Service to IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Restricts a service's connections to the IP ranges in an IP allow list. + // A service has at most one IP allow list; attaching a second one + // without detaching the first is refused. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). + AttachServiceToAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) + + // AttachServiceToAllowListWithResponse Attach Service to IP Allow List + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Restricts a service's connections to the IP ranges in an IP allow list. + // A service has at most one IP allow list; attaching a second one + // without detaching the first is refused. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). - IdentifyUserWithResponse(ctx context.Context, body IdentifyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). + AttachServiceToAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) - // TrackEventWithBodyWithResponse Track an analytics event + // AttachServiceToExporterWithBodyWithResponse Attach Service to Exporter // - // Tracks an analytics event with optional properties. + // **Preview - this endpoint is experimental and may change without notice.** + // + // Starts sending a service's logs or metrics to an exporter. + // + // A service sends to at most one log exporter and one metric exporter at + // a time. Attaching a second exporter of the same kind is refused; + // detach the current one first. + // + // The first time a log exporter is attached to a service, the service + // restarts once. Attaching a different log exporter later does not + // restart anything, and neither does attaching a metric exporter. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /analytics/track (the `TrackEvent` operationId). - TrackEventWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). + AttachServiceToExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) - // TrackEventWithResponse Track an analytics event + // AttachServiceToExporterWithResponse Attach Service to Exporter // - // Tracks an analytics event with optional properties. + // **Preview - this endpoint is experimental and may change without notice.** + // + // Starts sending a service's logs or metrics to an exporter. + // + // A service sends to at most one log exporter and one metric exporter at + // a time. Attaching a second exporter of the same kind is refused; + // detach the current one first. + // + // The first time a log exporter is attached to a service, the service + // restarts once. Attaching a different log exporter later does not + // restart anything, and neither does attaching a metric exporter. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /analytics/track (the `TrackEvent` operationId). - TrackEventWithResponse(ctx context.Context, body TrackEventJSONRequestBody, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). + AttachServiceToExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) - // GetAuthInfoWithResponse Get Authentication Info + // AttachServiceToVPCWithBodyWithResponse Attach Service to VPC // - // Returns the authenticated caller's identity. The response shape depends on the credential type: `apiKey` for PAT - // callers, `oauth` for OAuth user callers. Exactly one of `api_key` or `oauth` is populated; - // `type` discriminates. + // Associates a service with a VPC. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). + AttachServiceToVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) + + // AttachServiceToVPCWithResponse Attach Service to VPC + // + // Associates a service with a VPC. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). + AttachServiceToVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) + + // GetBackupRegionsWithResponse List All Backup Regions + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves the additional regions this service's backups are copied to + // (cross-region backups). The region the service runs in is not listed. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /auth/info (the `GetAuthInfo` operationId). - GetAuthInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthInfoResponse, error) + // Corresponds with GET /projects/{project_id}/services/{service_id}/backup-regions (the `GetBackupRegions` operationId). + GetBackupRegionsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRegionsResponse, error) - // LogoutWithBodyWithResponse Log out and revoke refresh token + // CreateBackupRegionWithBodyWithResponse Add a Backup Region // - // Revokes the caller's refresh token server-side. For OAuth Bearer - // callers, include the refresh token in the request body — it is held - // client-side and cannot be derived from the access token. Callers - // without a refresh token to revoke may post an - // empty body to clear server-side session state best-effort. + // **Preview - this endpoint is experimental and may change without notice.** // - // Returns 204 No Content on success. The caller is still responsible - // for dropping any locally-cached credentials. + // Starts copying this service's backups to another region. The region is + // added immediately; existing backups are copied to it in the background. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /auth/logout (the `Logout` operationId). - LogoutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LogoutResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). + CreateBackupRegionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) - // LogoutWithResponse Log out and revoke refresh token + // CreateBackupRegionWithResponse Add a Backup Region // - // Revokes the caller's refresh token server-side. For OAuth Bearer - // callers, include the refresh token in the request body — it is held - // client-side and cannot be derived from the access token. Callers - // without a refresh token to revoke may post an - // empty body to clear server-side session state best-effort. + // **Preview - this endpoint is experimental and may change without notice.** // - // Returns 204 No Content on success. The caller is still responsible - // for dropping any locally-cached credentials. + // Starts copying this service's backups to another region. The region is + // added immediately; existing backups are copied to it in the background. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /auth/logout (the `Logout` operationId). - LogoutWithResponse(ctx context.Context, body LogoutJSONRequestBody, reqEditors ...RequestEditorFn) (*LogoutResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). + CreateBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBackupRegionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) - // SubmitFeedbackWithBodyWithResponse Submit feedback + // DeleteBackupRegionWithResponse Remove a Backup Region // - // Sends feedback, a bug report, or a support request to Tiger Data. + // **Preview - this endpoint is experimental and may change without notice.** // - // The submitter's email address is resolved from the caller's - // credentials, and the client version and operating system from the - // `User-Agent` header, so neither is supplied in the body. + // Stops copying this service's backups to a region. Copies already stored + // there are deleted in the background and cannot be recovered. // - // Returns 204 No Content on success. This endpoint opens no support - // case and returns no ticket to track: use it for unsolicited feedback, - // and raise anything needing a tracked response through support. + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /projects/{project_id}/services/{service_id}/backup-regions/{region_code} (the `DeleteBackupRegion` operationId). + DeleteBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, regionCode BackupRegionCode, reqEditors ...RequestEditorFn) (*DeleteBackupRegionResponse, error) + + // GetBackupRetentionWithResponse Get the Backup Retention Policy + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves how long this service keeps its backups. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/backup-retention (the `GetBackupRetention` operationId). + GetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRetentionResponse, error) + + // SetBackupRetentionWithBodyWithResponse Set the Backup Retention Policy + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Sets how long this service keeps its backups. Shortening retention + // deletes the backups that no longer fit. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). + SetBackupRetentionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) + + // SetBackupRetentionWithResponse Set the Backup Retention Policy + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Sets how long this service keeps its backups. Shortening retention + // deletes the backups that no longer fit. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). + SetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetBackupRetentionJSONRequestBody, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) + + // GetBackupsWithResponse List All Backups + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a list of the full and incremental backups taken for a + // service. Backups run automatically on a schedule; there is no operation + // to create or delete one. To restore data, create a recovery fork with + // `fork_strategy: PITR`. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/backups (the `GetBackups` operationId). + GetBackupsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupsResponse, error) + + // GetBranchesWithResponse List All Branches + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves a list of all branches created from a service within a project. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/branches (the `GetBranches` operationId). + GetBranchesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetBranchesParams, reqEditors ...RequestEditorFn) (*GetBranchesResponse, error) + + // CreateBranchWithBodyWithResponse Create a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates a new branch from the service identified by `service_id`. A + // branch shares its parent's data at the moment of creation and gets + // its own, independently-sized compute. This is an asynchronous + // operation. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). + CreateBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBranchResponse, error) + + // CreateBranchWithResponse Create a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Creates a new branch from the service identified by `service_id`. A + // branch shares its parent's data at the moment of creation and gets + // its own, independently-sized compute. This is an asynchronous + // operation. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). + CreateBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBranchResponse, error) + + // DeleteBranchWithResponse Delete a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Deletes a specific branch. This is an asynchronous operation. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `DeleteBranch` operationId). + DeleteBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*DeleteBranchResponse, error) + + // GetBranchWithResponse Get a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Retrieves the details of a specific branch by its ID. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `GetBranch` operationId). + GetBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*GetBranchResponse, error) + + // RenameBranchWithBodyWithResponse Rename a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates the name of a specific branch. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). + RenameBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameBranchResponse, error) + + // RenameBranchWithResponse Rename a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Updates the name of a specific branch. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). + RenameBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body RenameBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameBranchResponse, error) + + // ResizeBranchWithBodyWithResponse Resize a Branch + // + // **Preview - this endpoint is experimental and may change without notice.** + // + // Changes the compute allocation for a specific branch. + // Storage size is shared with the parent and is not resized through + // this operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /feedback (the `SubmitFeedback` operationId). - SubmitFeedbackWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). + ResizeBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeBranchResponse, error) - // SubmitFeedbackWithResponse Submit feedback + // ResizeBranchWithResponse Resize a Branch // - // Sends feedback, a bug report, or a support request to Tiger Data. - // - // The submitter's email address is resolved from the caller's - // credentials, and the client version and operating system from the - // `User-Agent` header, so neither is supplied in the body. + // **Preview - this endpoint is experimental and may change without notice.** // - // Returns 204 No Content on success. This endpoint opens no support - // case and returns no ticket to track: use it for unsolicited feedback, - // and raise anything needing a tracked response through support. + // Changes the compute allocation for a specific branch. + // Storage size is shared with the parent and is not resized through + // this operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /feedback (the `SubmitFeedback` operationId). - SubmitFeedbackWithResponse(ctx context.Context, body SubmitFeedbackJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). + ResizeBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body ResizeBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeBranchResponse, error) - // GetProjectsWithResponse List projects accessible to the authenticated caller + // StartBranchWithResponse Start a Branch // - // Returns the projects the caller can access. PAT callers see only the - // project their PAT is scoped to; OAuth user callers see all projects - // they belong to. + // **Preview - this endpoint is experimental and may change without notice.** + // + // Starts a stopped branch. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects (the `GetProjects` operationId). - GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/start (the `StartBranch` operationId). + StartBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*StartBranchResponse, error) - // GetAllowListsWithResponse List All IP Allow Lists + // StopBranchWithResponse Stop a Branch // // **Preview - this endpoint is experimental and may change without notice.** // - // Retrieves every IP allow list in a project. + // Stops a running branch. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/allow-lists (the `GetAllowLists` operationId). - GetAllowListsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetAllowListsResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/stop (the `StopBranch` operationId). + StopBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*StopBranchResponse, error) - // CreateAllowListWithBodyWithResponse Create an IP Allow List + // UpdateBranchPasswordWithBodyWithResponse Update Branch Password // // **Preview - this endpoint is experimental and may change without notice.** // - // Creates an IP allow list in a project. An IP allow list carries no - // effect until it is attached to a service. - // - // The number of CIDR blocks per list and the number of lists per - // project are plan-dependent. + // Sets a new master password for the branch. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). - CreateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). + UpdateBranchPasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateBranchPasswordResponse, error) - // CreateAllowListWithResponse Create an IP Allow List + // UpdateBranchPasswordWithResponse Update Branch Password // // **Preview - this endpoint is experimental and may change without notice.** // - // Creates an IP allow list in a project. An IP allow list carries no - // effect until it is attached to a service. - // - // The number of CIDR blocks per list and the number of lists per - // project are plan-dependent. + // Sets a new master password for the branch. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). - CreateAllowListWithResponse(ctx context.Context, projectID ProjectID, body CreateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). + UpdateBranchPasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body UpdateBranchPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateBranchPasswordResponse, error) - // DeleteAllowListWithResponse Delete an IP Allow List + // DetachServiceFromAllowListWithBodyWithResponse Detach Service from IP Allow List // // **Preview - this endpoint is experimental and may change without notice.** // - // Deletes an IP allow list. Refused if the list is still attached to - // any service. Detach it first. + // Removes the IP restriction an IP allow list placed on a service. The + // IP allow list itself is not deleted. // - // Returns a wrapper object for the known response body format(s). + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with DELETE /projects/{project_id}/allow-lists/{allow_list_id} (the `DeleteAllowList` operationId). - DeleteAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*DeleteAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). + DetachServiceFromAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) - // GetAllowListWithResponse Get an IP Allow List + // DetachServiceFromAllowListWithResponse Detach Service from IP Allow List // // **Preview - this endpoint is experimental and may change without notice.** // - // Retrieves a single IP allow list. + // Removes the IP restriction an IP allow list placed on a service. The + // IP allow list itself is not deleted. // - // Returns a wrapper object for the known response body format(s). + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/allow-lists/{allow_list_id} (the `GetAllowList` operationId). - GetAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*GetAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). + DetachServiceFromAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) - // UpdateAllowListWithBodyWithResponse Update an IP Allow List + // DetachServiceFromExporterWithBodyWithResponse Detach Service from Exporter // // **Preview - this endpoint is experimental and may change without notice.** // - // Updates an IP allow list in place. Send `description` and/or - // `cidr_blocks` to change them; omit either one to leave it - // unchanged. + // Stops sending a service's logs or metrics to an exporter. The exporter + // is not deleted and keeps serving any other service attached to it. // - // Every service the IP allow list is attached to is updated with the - // new CIDR blocks. To remove every CIDR block, delete the IP allow - // list instead of sending an empty `cidr_blocks`. + // Data already delivered to the destination is untouched. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). - UpdateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). + DetachServiceFromExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) - // UpdateAllowListWithResponse Update an IP Allow List + // DetachServiceFromExporterWithResponse Detach Service from Exporter // // **Preview - this endpoint is experimental and may change without notice.** // - // Updates an IP allow list in place. Send `description` and/or - // `cidr_blocks` to change them; omit either one to leave it - // unchanged. + // Stops sending a service's logs or metrics to an exporter. The exporter + // is not deleted and keeps serving any other service attached to it. // - // Every service the IP allow list is attached to is updated with the - // new CIDR blocks. To remove every CIDR block, delete the IP allow - // list instead of sending an empty `cidr_blocks`. + // Data already delivered to the destination is untouched. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). - UpdateAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, body UpdateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). + DetachServiceFromExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) - // GetExportersWithResponse List All Exporters + // DetachServiceFromVPCWithBodyWithResponse Detach Service from VPC // - // **Preview - this endpoint is experimental and may change without notice.** + // Disassociates a service from its VPC. // - // Retrieves every exporter in a project, across every region. + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). + DetachServiceFromVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) + + // DetachServiceFromVPCWithResponse Detach Service from VPC + // + // Disassociates a service from its VPC. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). + DetachServiceFromVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) + + // DisablePoolerWithResponse Disable Connection Pooler for a Service + // + // Deactivates the connection pooler for a specific service within a project. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/exporters (the `GetExporters` operationId). - GetExportersWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetExportersResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). + DisablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DisablePoolerResponse, error) - // CreateExporterWithBodyWithResponse Create an Exporter + // EnableDataTieringWithResponse Enable Data Tiering for a Service // - // **Preview - this endpoint is experimental and may change without notice.** + // Enables tiered storage on the service. Tiering policies move older, + // rarely-accessed data from the high-performance storage tier to a + // low-cost object storage tier. Tiered data stays queryable but becomes + // read-only. // - // Creates an exporter in a project and region. + // There is no way to disable tiering through this API. Contact Tiger + // Data support if you need to turn it off. // - // An exporter carries no data until it is attached to a service. + // Returns a wrapper object for the known response body format(s). // - // Exporters aren't available on every plan. If your project's plan - // doesn't include them, this request is refused here rather than later, - // when you try to attach one. + // Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). + EnableDataTieringWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnableDataTieringResponse, error) + + // EnablePoolerWithResponse Enable Connection Pooler for a Service // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // Activates the connection pooler for a specific service within a project. // - // Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). - CreateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). + EnablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnablePoolerResponse, error) - // CreateExporterWithResponse Create an Exporter + // ForkServiceWithBodyWithResponse Fork a Service // - // **Preview - this endpoint is experimental and may change without notice.** + // Creates a new, independent service within a project by taking a snapshot of an existing one. // - // Creates an exporter in a project and region. + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // An exporter carries no data until it is attached to a service. + // Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). + ForkServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) + + // ForkServiceWithResponse Fork a Service // - // Exporters aren't available on every plan. If your project's plan - // doesn't include them, this request is refused here rather than later, - // when you try to attach one. + // Creates a new, independent service within a project by taking a snapshot of an existing one. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). - CreateExporterWithResponse(ctx context.Context, projectID ProjectID, body CreateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). + ForkServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) - // DeleteExporterWithResponse Delete an Exporter - // - // **Preview - this endpoint is experimental and may change without notice.** + // GetServiceLogsWithResponse Get service logs // - // Deletes an exporter and stops the data it was sending. Any service - // still attached is detached automatically. You don't need to detach it - // first, and nothing errors if you don't. + // Fetch logs for a specific service. Returns up to 500 log entries in reverse + // chronological order. Supports cursor-based pagination via the `cursor` parameter + // and the `last_cursor` field in the response. // - // Data already delivered to the destination is untouched, and nothing on - // the services themselves changes. + // Use the returned `last_cursor` value as the `cursor` parameter on subsequent + // requests to page through all available logs. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with DELETE /projects/{project_id}/exporters/{exporter_id} (the `DeleteExporter` operationId). - DeleteExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*DeleteExporterResponse, error) + // Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). + GetServiceLogsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*GetServiceLogsResponse, error) - // GetExporterWithResponse Get an Exporter - // - // **Preview - this endpoint is experimental and may change without notice.** + // GetServiceMetricsAvailableSeriesWithResponse List available metric series // - // Retrieves a single exporter. + // Returns the names of all metric series available for a service. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/exporters/{exporter_id} (the `GetExporter` operationId). - GetExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*GetExporterResponse, error) + // Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). + GetServiceMetricsAvailableSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceMetricsAvailableSeriesResponse, error) - // UpdateExporterWithBodyWithResponse Update an Exporter + // GetServiceMetricDetailsWithResponse Get details about a metric // - // **Preview - this endpoint is experimental and may change without notice.** + // Returns descriptive metadata for a named metric: what it measures, + // its type, default aggregation, and every label it can be filtered or + // grouped by — its own labels plus the region/role/ordinal labels most + // metrics also carry. Use getServiceMetricsAvailableSeries to discover + // valid metric names. // - // Updates an exporter in place. Send `config` to replace the whole - // configuration; omit it to leave the configuration unchanged. + // Returns a wrapper object for the known response body format(s). // - // Every service the exporter is attached to picks up the change; there - // is no need to detach and reattach. + // Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). + GetServiceMetricDetailsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*GetServiceMetricDetailsResponse, error) + + // GetServiceMetricsSeriesWithBodyWithResponse Get a metric series // - // `type` must be included and must match the exporter's existing type; - // it cannot be changed. To send data somewhere else, create a new - // exporter and move the services over. + // Returns time-series data points for a named metric within a time window. + // Use getServiceMetricsAvailableSeries to discover valid metric names. + // + // Parameters are sent as a JSON body so callers can pass an unbounded + // filter set without query-string length pressure. The response is a list + // of MetricSeries, each carrying its label set as a structured map + // alongside its per-bucket data points. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). - UpdateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). + GetServiceMetricsSeriesWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) - // UpdateExporterWithResponse Update an Exporter + // GetServiceMetricsSeriesWithResponse Get a metric series // - // **Preview - this endpoint is experimental and may change without notice.** + // Returns time-series data points for a named metric within a time window. + // Use getServiceMetricsAvailableSeries to discover valid metric names. // - // Updates an exporter in place. Send `config` to replace the whole - // configuration; omit it to leave the configuration unchanged. + // Parameters are sent as a JSON body so callers can pass an unbounded + // filter set without query-string length pressure. The response is a list + // of MetricSeries, each carrying its label set as a structured map + // alongside its per-bucket data points. // - // Every service the exporter is attached to picks up the change; there - // is no need to detach and reattach. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // `type` must be included and must match the exporter's existing type; - // it cannot be changed. To send data somewhere else, create a new - // exporter and move the services over. + // Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). + GetServiceMetricsSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) + + // RenameServiceWithBodyWithResponse Rename a Service + // + // Updates the name of a specific service. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). + RenameServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) + + // RenameServiceWithResponse Rename a Service + // + // Updates the name of a specific service. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). - UpdateExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, body UpdateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). + RenameServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) - // GetServicesWithResponse List All Services + // GetReplicaSetsWithResponse Get Read Replica Sets // - // Retrieves a list of all services within a specific project. + // Retrieves a list of all read replica sets associated with a primary service within a project. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/services (the `GetServices` operationId). - GetServicesWithResponse(ctx context.Context, projectID ProjectID, params *GetServicesParams, reqEditors ...RequestEditorFn) (*GetServicesResponse, error) + // Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). + GetReplicaSetsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetReplicaSetsResponse, error) - // CreateServiceWithBodyWithResponse Create a Service + // CreateReplicaSetWithBodyWithResponse Create a Read Replica Set // - // Creates a new database service within a project. This is an asynchronous operation. + // Creates a new read replica set for a service. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). - CreateServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). + CreateReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) - // CreateServiceWithResponse Create a Service + // CreateReplicaSetWithResponse Create a Read Replica Set // - // Creates a new database service within a project. This is an asynchronous operation. + // Creates a new read replica set for a service. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). - CreateServiceWithResponse(ctx context.Context, projectID ProjectID, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). + CreateReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) - // DeleteServiceWithResponse Delete a Service + // DeleteReplicaSetWithResponse Delete a Read Replica Set // - // Deletes a specific service. This is an asynchronous operation. + // Deletes a specific read replica set. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with DELETE /projects/{project_id}/services/{service_id} (the `DeleteService` operationId). - DeleteServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) + // Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). + DeleteReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DeleteReplicaSetResponse, error) - // GetServiceWithResponse Get a Service + // DisableReplicaPoolerWithResponse Disable Connection Pooler for a Read Replica // - // Retrieves the details of a specific service by its ID. + // Deactivates the connection pooler for a specific read replica set. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/services/{service_id} (the `GetService` operationId). - GetServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). + DisableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DisableReplicaPoolerResponse, error) - // AttachServiceToAllowListWithBodyWithResponse Attach Service to IP Allow List - // - // **Preview - this endpoint is experimental and may change without notice.** + // EnableReplicaPoolerWithResponse Enable Connection Pooler for a Read Replica // - // Restricts a service's connections to the IP ranges in an IP allow list. - // A service has at most one IP allow list; attaching a second one - // without detaching the first is refused. + // Activates the connection pooler for a specific read replica set. // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // Returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). - AttachServiceToAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). + EnableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*EnableReplicaPoolerResponse, error) - // AttachServiceToAllowListWithResponse Attach Service to IP Allow List - // - // **Preview - this endpoint is experimental and may change without notice.** + // ResizeReplicaSetWithBodyWithResponse Resize a Read Replica Set // - // Restricts a service's connections to the IP ranges in an IP allow list. - // A service has at most one IP allow list; attaching a second one - // without detaching the first is refused. + // Changes the resource allocation for a specific read replica set. // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). - AttachServiceToAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). + ResizeReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) - // AttachServiceToExporterWithBodyWithResponse Attach Service to Exporter + // ResizeReplicaSetWithResponse Resize a Read Replica Set // - // **Preview - this endpoint is experimental and may change without notice.** + // Changes the resource allocation for a specific read replica set. // - // Starts sending a service's logs or metrics to an exporter. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // A service sends to at most one log exporter and one metric exporter at - // a time. Attaching a second exporter of the same kind is refused; - // detach the current one first. + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). + ResizeReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) + + // SetReplicaEnvironmentWithBodyWithResponse Set Environment for a Read Replica // - // The first time a log exporter is attached to a service, the service - // restarts once. Attaching a different log exporter later does not - // restart anything, and neither does attaching a metric exporter. + // Sets the environment type for the read replica set. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). - AttachServiceToExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). + SetReplicaEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) - // AttachServiceToExporterWithResponse Attach Service to Exporter - // - // **Preview - this endpoint is experimental and may change without notice.** - // - // Starts sending a service's logs or metrics to an exporter. - // - // A service sends to at most one log exporter and one metric exporter at - // a time. Attaching a second exporter of the same kind is refused; - // detach the current one first. + // SetReplicaEnvironmentWithResponse Set Environment for a Read Replica // - // The first time a log exporter is attached to a service, the service - // restarts once. Attaching a different log exporter later does not - // restart anything, and neither does attaching a metric exporter. + // Sets the environment type for the read replica set. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). - AttachServiceToExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). + SetReplicaEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) - // AttachServiceToVPCWithBodyWithResponse Attach Service to VPC + // ResizeServiceWithBodyWithResponse Resize a Service // - // Associates a service with a VPC. + // Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). - AttachServiceToVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). + ResizeServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) - // AttachServiceToVPCWithResponse Attach Service to VPC + // ResizeServiceWithResponse Resize a Service // - // Associates a service with a VPC. + // Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). - AttachServiceToVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). + ResizeServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) - // GetBackupRegionsWithResponse List All Backup Regions - // - // **Preview - this endpoint is experimental and may change without notice.** + // SetEnvironmentWithBodyWithResponse Set Environment for a Service // - // Retrieves the additional regions this service's backups are copied to - // (cross-region backups). The region the service runs in is not listed. + // Sets the environment type for the service. // - // Returns a wrapper object for the known response body format(s). + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/services/{service_id}/backup-regions (the `GetBackupRegions` operationId). - GetBackupRegionsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRegionsResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). + SetEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) - // CreateBackupRegionWithBodyWithResponse Add a Backup Region + // SetEnvironmentWithResponse Set Environment for a Service // - // **Preview - this endpoint is experimental and may change without notice.** + // Sets the environment type for the service. // - // Starts copying this service's backups to another region. The region is - // added immediately; existing backups are copied to it in the background. + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). + SetEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) + + // SetHAReplicaWithBodyWithResponse Change HA configuration for a Service + // + // Changes the HA configuration for a specific service. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). - CreateBackupRegionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). + SetHAReplicaWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) - // CreateBackupRegionWithResponse Add a Backup Region - // - // **Preview - this endpoint is experimental and may change without notice.** + // SetHAReplicaWithResponse Change HA configuration for a Service // - // Starts copying this service's backups to another region. The region is - // added immediately; existing backups are copied to it in the background. + // Changes the HA configuration for a specific service. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). - CreateBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBackupRegionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). + SetHAReplicaWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) - // DeleteBackupRegionWithResponse Remove a Backup Region - // - // **Preview - this endpoint is experimental and may change without notice.** + // StartServiceWithResponse Start a Service // - // Stops copying this service's backups to a region. Copies already stored - // there are deleted in the background and cannot be recovered. + // Starts a stopped service within a project. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with DELETE /projects/{project_id}/services/{service_id}/backup-regions/{region_code} (the `DeleteBackupRegion` operationId). - DeleteBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, regionCode BackupRegionCode, reqEditors ...RequestEditorFn) (*DeleteBackupRegionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/start (the `StartService` operationId). + StartServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StartServiceResponse, error) - // GetBackupRetentionWithResponse Get the Backup Retention Policy - // - // **Preview - this endpoint is experimental and may change without notice.** + // StopServiceWithResponse Stop a Service // - // Retrieves how long this service keeps its backups. + // Stops a running service within a project. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/services/{service_id}/backup-retention (the `GetBackupRetention` operationId). - GetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRetentionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/stop (the `StopService` operationId). + StopServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StopServiceResponse, error) - // SetBackupRetentionWithBodyWithResponse Set the Backup Retention Policy - // - // **Preview - this endpoint is experimental and may change without notice.** + // UpdatePasswordWithBodyWithResponse Update Service Password // - // Sets how long this service keeps its backups. Shortening retention - // deletes the backups that no longer fit. + // Sets a new master password for the service within a project. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). - SetBackupRetentionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). + UpdatePasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) - // SetBackupRetentionWithResponse Set the Backup Retention Policy - // - // **Preview - this endpoint is experimental and may change without notice.** + // UpdatePasswordWithResponse Update Service Password // - // Sets how long this service keeps its backups. Shortening retention - // deletes the backups that no longer fit. + // Sets a new master password for the service within a project. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). - SetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetBackupRetentionJSONRequestBody, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) + // Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). + UpdatePasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) - // GetBackupsWithResponse List All Backups - // - // **Preview - this endpoint is experimental and may change without notice.** + // GetVPCsWithResponse List All VPCs // - // Retrieves a list of the full and incremental backups taken for a - // service. Backups run automatically on a schedule; there is no operation - // to create or delete one. To restore data, create a recovery fork with - // `fork_strategy: PITR`. + // Retrieves a list of all Virtual Private Clouds (VPCs). // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /projects/{project_id}/services/{service_id}/backups (the `GetBackups` operationId). - GetBackupsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupsResponse, error) + // Corresponds with GET /projects/{project_id}/vpcs (the `GetVPCs` operationId). + GetVPCsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetVPCsResponse, error) - // DetachServiceFromAllowListWithBodyWithResponse Detach Service from IP Allow List - // - // **Preview - this endpoint is experimental and may change without notice.** + // CreateVPCWithBodyWithResponse Create a VPC // - // Removes the IP restriction an IP allow list placed on a service. The - // IP allow list itself is not deleted. + // Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). - DetachServiceFromAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). + CreateVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) - // DetachServiceFromAllowListWithResponse Detach Service from IP Allow List - // - // **Preview - this endpoint is experimental and may change without notice.** + // CreateVPCWithResponse Create a VPC // - // Removes the IP restriction an IP allow list placed on a service. The - // IP allow list itself is not deleted. + // Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). - DetachServiceFromAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). + CreateVPCWithResponse(ctx context.Context, projectID ProjectID, body CreateVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) - // DetachServiceFromExporterWithBodyWithResponse Detach Service from Exporter - // - // **Preview - this endpoint is experimental and may change without notice.** - // - // Stops sending a service's logs or metrics to an exporter. The exporter - // is not deleted and keeps serving any other service attached to it. + // DeleteVPCWithResponse Delete a VPC // - // Data already delivered to the destination is untouched. + // Deletes a specific VPC. This is an asynchronous operation. // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // Returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). - DetachServiceFromExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) + // Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id} (the `DeleteVPC` operationId). + DeleteVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*DeleteVPCResponse, error) - // DetachServiceFromExporterWithResponse Detach Service from Exporter + // GetVPCWithResponse Get a VPC // - // **Preview - this endpoint is experimental and may change without notice.** + // Retrieves the details of a specific VPC by its ID. // - // Stops sending a service's logs or metrics to an exporter. The exporter - // is not deleted and keeps serving any other service attached to it. + // Returns a wrapper object for the known response body format(s). // - // Data already delivered to the destination is untouched. + // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id} (the `GetVPC` operationId). + GetVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCResponse, error) + + // GetVPCPeeringsWithResponse List VPC Peerings // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // Retrieves a list of all VPC peering connections for a given VPC. // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). - DetachServiceFromExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings (the `GetVPCPeerings` operationId). + GetVPCPeeringsWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCPeeringsResponse, error) - // DetachServiceFromVPCWithBodyWithResponse Detach Service from VPC + // CreateVPCPeeringWithBodyWithResponse Create a VPC Peering // - // Disassociates a service from its VPC. + // Creates a new VPC peering connection. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). - DetachServiceFromVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). + CreateVPCPeeringWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) - // DetachServiceFromVPCWithResponse Detach Service from VPC + // CreateVPCPeeringWithResponse Create a VPC Peering // - // Disassociates a service from its VPC. + // Creates a new VPC peering connection. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). - DetachServiceFromVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). + CreateVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) - // DisablePoolerWithResponse Disable Connection Pooler for a Service + // DeleteVPCPeeringWithResponse Delete a VPC Peering // - // Deactivates the connection pooler for a specific service within a project. + // Deletes a specific VPC peering connection. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). - DisablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DisablePoolerResponse, error) + // Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `DeleteVPCPeering` operationId). + DeleteVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*DeleteVPCPeeringResponse, error) - // EnableDataTieringWithResponse Enable Data Tiering for a Service - // - // Enables tiered storage on the service. Tiering policies move older, - // rarely-accessed data from the high-performance storage tier to a - // low-cost object storage tier. Tiered data stays queryable but becomes - // read-only. + // GetVPCPeeringWithResponse Get a VPC Peering // - // There is no way to disable tiering through this API. Contact Tiger - // Data support if you need to turn it off. + // Retrieves the details of a specific VPC peering connection. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). - EnableDataTieringWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnableDataTieringResponse, error) + // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `GetVPCPeering` operationId). + GetVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*GetVPCPeeringResponse, error) - // EnablePoolerWithResponse Enable Connection Pooler for a Service + // RenameVPCWithBodyWithResponse Rename a VPC // - // Activates the connection pooler for a specific service within a project. + // Updates the name of a specific VPC. // - // Returns a wrapper object for the known response body format(s). + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). - EnablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnablePoolerResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). + RenameVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) - // ForkServiceWithBodyWithResponse Fork a Service + // RenameVPCWithResponse Rename a VPC // - // Creates a new, independent service within a project by taking a snapshot of an existing one. + // Updates the name of a specific VPC. // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). - ForkServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) + // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). + RenameVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) +} + +type IdentifyUserResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *AnalyticsResponse + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r IdentifyUserResponse) GetJSON200() *AnalyticsResponse { + return r.JSON200 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r IdentifyUserResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r IdentifyUserResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r IdentifyUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r IdentifyUserResponse) 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 IdentifyUserResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type TrackEventResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *AnalyticsResponse + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r TrackEventResponse) GetJSON200() *AnalyticsResponse { + return r.JSON200 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r TrackEventResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r TrackEventResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r TrackEventResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r TrackEventResponse) 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 TrackEventResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetAuthInfoResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *AuthInfo + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetAuthInfoResponse) GetJSON200() *AuthInfo { + return r.JSON200 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r GetAuthInfoResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r GetAuthInfoResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetAuthInfoResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAuthInfoResponse) 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 GetAuthInfoResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type LogoutResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r LogoutResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r LogoutResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r LogoutResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ForkServiceWithResponse Fork a Service - // - // Creates a new, independent service within a project by taking a snapshot of an existing one. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). - ForkServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r LogoutResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // GetServiceLogsWithResponse Get service logs - // - // Fetch logs for a specific service. Returns up to 500 log entries in reverse - // chronological order. Supports cursor-based pagination via the `cursor` parameter - // and the `last_cursor` field in the response. - // - // Use the returned `last_cursor` value as the `cursor` parameter on subsequent - // requests to page through all available logs. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). - GetServiceLogsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*GetServiceLogsResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r LogoutResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // GetServiceMetricsAvailableSeriesWithResponse List available metric series - // - // Returns the names of all metric series available for a service. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). - GetServiceMetricsAvailableSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceMetricsAvailableSeriesResponse, error) +type SubmitFeedbackResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // GetServiceMetricDetailsWithResponse Get details about a metric - // - // Returns descriptive metadata for a named metric: what it measures, - // its type, default aggregation, and every label it can be filtered or - // grouped by — its own labels plus the region/role/ordinal labels most - // metrics also carry. Use getServiceMetricsAvailableSeries to discover - // valid metric names. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). - GetServiceMetricDetailsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*GetServiceMetricDetailsResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r SubmitFeedbackResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // GetServiceMetricsSeriesWithBodyWithResponse Get a metric series - // - // Returns time-series data points for a named metric within a time window. - // Use getServiceMetricsAvailableSeries to discover valid metric names. - // - // Parameters are sent as a JSON body so callers can pass an unbounded - // filter set without query-string length pressure. The response is a list - // of MetricSeries, each carrying its label set as a structured map - // alongside its per-bucket data points. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). - GetServiceMetricsSeriesWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) +// GetBody returns the raw response body bytes +func (r SubmitFeedbackResponse) GetBody() []byte { + return r.Body +} - // GetServiceMetricsSeriesWithResponse Get a metric series - // - // Returns time-series data points for a named metric within a time window. - // Use getServiceMetricsAvailableSeries to discover valid metric names. - // - // Parameters are sent as a JSON body so callers can pass an unbounded - // filter set without query-string length pressure. The response is a list - // of MetricSeries, each carrying its label set as a structured map - // alongside its per-bucket data points. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). - GetServiceMetricsSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) +// Status returns HTTPResponse.Status +func (r SubmitFeedbackResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // RenameServiceWithBodyWithResponse Rename a Service - // - // Updates the name of a specific service. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). - RenameServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r SubmitFeedbackResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // RenameServiceWithResponse Rename a Service - // - // Updates the name of a specific service. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). - RenameServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r SubmitFeedbackResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // GetReplicaSetsWithResponse Get Read Replica Sets - // - // Retrieves a list of all read replica sets associated with a primary service within a project. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). - GetReplicaSetsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetReplicaSetsResponse, error) +type GetProjectsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]Project + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // CreateReplicaSetWithBodyWithResponse Create a Read Replica Set - // - // Creates a new read replica set for a service. This is an asynchronous operation. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). - CreateReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetProjectsResponse) GetJSON200() *[]Project { + return r.JSON200 +} - // CreateReplicaSetWithResponse Create a Read Replica Set - // - // Creates a new read replica set for a service. This is an asynchronous operation. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). - CreateReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r GetProjectsResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // DeleteReplicaSetWithResponse Delete a Read Replica Set - // - // Deletes a specific read replica set. This is an asynchronous operation. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). - DeleteReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DeleteReplicaSetResponse, error) +// GetBody returns the raw response body bytes +func (r GetProjectsResponse) GetBody() []byte { + return r.Body +} - // DisableReplicaPoolerWithResponse Disable Connection Pooler for a Read Replica - // - // Deactivates the connection pooler for a specific read replica set. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). - DisableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DisableReplicaPoolerResponse, error) +// Status returns HTTPResponse.Status +func (r GetProjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // EnableReplicaPoolerWithResponse Enable Connection Pooler for a Read Replica - // - // Activates the connection pooler for a specific read replica set. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). - EnableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*EnableReplicaPoolerResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetProjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ResizeReplicaSetWithBodyWithResponse Resize a Read Replica Set - // - // Changes the resource allocation for a specific read replica set. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). - ResizeReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetProjectsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // ResizeReplicaSetWithResponse Resize a Read Replica Set - // - // Changes the resource allocation for a specific read replica set. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). - ResizeReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) +type GetAllowListsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]AllowList + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // SetReplicaEnvironmentWithBodyWithResponse Set Environment for a Read Replica - // - // Sets the environment type for the read replica set. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). - SetReplicaEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetAllowListsResponse) GetJSON200() *[]AllowList { + return r.JSON200 +} - // SetReplicaEnvironmentWithResponse Set Environment for a Read Replica - // - // Sets the environment type for the read replica set. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). - SetReplicaEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r GetAllowListsResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // ResizeServiceWithBodyWithResponse Resize a Service - // - // Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). - ResizeServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) +// GetBody returns the raw response body bytes +func (r GetAllowListsResponse) GetBody() []byte { + return r.Body +} - // ResizeServiceWithResponse Resize a Service - // - // Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). - ResizeServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) +// Status returns HTTPResponse.Status +func (r GetAllowListsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // SetEnvironmentWithBodyWithResponse Set Environment for a Service - // - // Sets the environment type for the service. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). - SetEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetAllowListsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // SetEnvironmentWithResponse Set Environment for a Service - // - // Sets the environment type for the service. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). - SetEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetAllowListsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // SetHAReplicaWithBodyWithResponse Change HA configuration for a Service - // - // Changes the HA configuration for a specific service. This is an asynchronous operation. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). - SetHAReplicaWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) +type CreateAllowListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *AllowList + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // SetHAReplicaWithResponse Change HA configuration for a Service - // - // Changes the HA configuration for a specific service. This is an asynchronous operation. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). - SetHAReplicaWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r CreateAllowListResponse) GetJSON201() *AllowList { + return r.JSON201 +} - // StartServiceWithResponse Start a Service - // - // Starts a stopped service within a project. This is an asynchronous operation. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/start (the `StartService` operationId). - StartServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StartServiceResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r CreateAllowListResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // StopServiceWithResponse Stop a Service - // - // Stops a running service within a project. This is an asynchronous operation. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/stop (the `StopService` operationId). - StopServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StopServiceResponse, error) +// GetBody returns the raw response body bytes +func (r CreateAllowListResponse) GetBody() []byte { + return r.Body +} - // UpdatePasswordWithBodyWithResponse Update Service Password - // - // Sets a new master password for the service within a project. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). - UpdatePasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) +// Status returns HTTPResponse.Status +func (r CreateAllowListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // UpdatePasswordWithResponse Update Service Password - // - // Sets a new master password for the service within a project. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). - UpdatePasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r CreateAllowListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // GetVPCsWithResponse List All VPCs - // - // Retrieves a list of all Virtual Private Clouds (VPCs). - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/vpcs (the `GetVPCs` operationId). - GetVPCsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetVPCsResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CreateAllowListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} - // CreateVPCWithBodyWithResponse Create a VPC - // - // Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). - CreateVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) +type DeleteAllowListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // CreateVPCWithResponse Create a VPC - // - // Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). - CreateVPCWithResponse(ctx context.Context, projectID ProjectID, body CreateVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r DeleteAllowListResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // DeleteVPCWithResponse Delete a VPC - // - // Deletes a specific VPC. This is an asynchronous operation. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id} (the `DeleteVPC` operationId). - DeleteVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*DeleteVPCResponse, error) +// GetBody returns the raw response body bytes +func (r DeleteAllowListResponse) GetBody() []byte { + return r.Body +} - // GetVPCWithResponse Get a VPC - // - // Retrieves the details of a specific VPC by its ID. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id} (the `GetVPC` operationId). - GetVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCResponse, error) +// Status returns HTTPResponse.Status +func (r DeleteAllowListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // GetVPCPeeringsWithResponse List VPC Peerings - // - // Retrieves a list of all VPC peering connections for a given VPC. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings (the `GetVPCPeerings` operationId). - GetVPCPeeringsWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCPeeringsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteAllowListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // CreateVPCPeeringWithBodyWithResponse Create a VPC Peering - // - // Creates a new VPC peering connection. This is an asynchronous operation. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). - CreateVPCPeeringWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteAllowListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetAllowListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *AllowList + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} - // CreateVPCPeeringWithResponse Create a VPC Peering - // - // Creates a new VPC peering connection. This is an asynchronous operation. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). - CreateVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetAllowListResponse) GetJSON200() *AllowList { + return r.JSON200 +} - // DeleteVPCPeeringWithResponse Delete a VPC Peering - // - // Deletes a specific VPC peering connection. This is an asynchronous operation. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `DeleteVPCPeering` operationId). - DeleteVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*DeleteVPCPeeringResponse, error) +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r GetAllowListResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} - // GetVPCPeeringWithResponse Get a VPC Peering - // - // Retrieves the details of a specific VPC peering connection. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `GetVPCPeering` operationId). - GetVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*GetVPCPeeringResponse, error) +// GetBody returns the raw response body bytes +func (r GetAllowListResponse) GetBody() []byte { + return r.Body +} - // RenameVPCWithBodyWithResponse Rename a VPC - // - // Updates the name of a specific VPC. - // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). - RenameVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) +// Status returns HTTPResponse.Status +func (r GetAllowListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // RenameVPCWithResponse Rename a VPC - // - // Updates the name of a specific VPC. - // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). - // - // Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). - RenameVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetAllowListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 } -type IdentifyUserResponse struct { +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetAllowListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdateAllowListResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *AnalyticsResponse + JSON200 *AllowList // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r IdentifyUserResponse) GetJSON200() *AnalyticsResponse { +func (r UpdateAllowListResponse) GetJSON200() *AllowList { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r IdentifyUserResponse) GetJSON4XX() *ClientError { +func (r UpdateAllowListResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r IdentifyUserResponse) GetBody() []byte { +func (r UpdateAllowListResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r IdentifyUserResponse) Status() string { +func (r UpdateAllowListResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7124,7 +8827,7 @@ func (r IdentifyUserResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r IdentifyUserResponse) StatusCode() int { +func (r UpdateAllowListResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7132,39 +8835,39 @@ func (r IdentifyUserResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r IdentifyUserResponse) ContentType() string { +func (r UpdateAllowListResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type TrackEventResponse struct { +type GetProjectBranchesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *AnalyticsResponse + JSON200 *[]Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r TrackEventResponse) GetJSON200() *AnalyticsResponse { +func (r GetProjectBranchesResponse) GetJSON200() *[]Branch { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r TrackEventResponse) GetJSON4XX() *ClientError { +func (r GetProjectBranchesResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r TrackEventResponse) GetBody() []byte { +func (r GetProjectBranchesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r TrackEventResponse) Status() string { +func (r GetProjectBranchesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7172,7 +8875,7 @@ func (r TrackEventResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r TrackEventResponse) StatusCode() int { +func (r GetProjectBranchesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7180,39 +8883,39 @@ func (r TrackEventResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r TrackEventResponse) ContentType() string { +func (r GetProjectBranchesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetAuthInfoResponse struct { +type GetExportersResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *AuthInfo + JSON200 *[]Exporter // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetAuthInfoResponse) GetJSON200() *AuthInfo { +func (r GetExportersResponse) GetJSON200() *[]Exporter { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetAuthInfoResponse) GetJSON4XX() *ClientError { +func (r GetExportersResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetAuthInfoResponse) GetBody() []byte { +func (r GetExportersResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetAuthInfoResponse) Status() string { +func (r GetExportersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7220,7 +8923,7 @@ func (r GetAuthInfoResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAuthInfoResponse) StatusCode() int { +func (r GetExportersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7228,14 +8931,62 @@ func (r GetAuthInfoResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetAuthInfoResponse) ContentType() string { +func (r GetExportersResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type LogoutResponse struct { +type CreateExporterResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *Exporter + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r CreateExporterResponse) GetJSON201() *Exporter { + return r.JSON201 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r CreateExporterResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r CreateExporterResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r CreateExporterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateExporterResponse) 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 CreateExporterResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteExporterResponse struct { Body []byte HTTPResponse *http.Response // JSON4XX the response for an HTTP 4XX `application/json` response @@ -7243,17 +8994,17 @@ type LogoutResponse struct { } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r LogoutResponse) GetJSON4XX() *ClientError { +func (r DeleteExporterResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r LogoutResponse) GetBody() []byte { +func (r DeleteExporterResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r LogoutResponse) Status() string { +func (r DeleteExporterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7261,7 +9012,7 @@ func (r LogoutResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r LogoutResponse) StatusCode() int { +func (r DeleteExporterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7269,32 +9020,39 @@ func (r LogoutResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r LogoutResponse) ContentType() string { +func (r DeleteExporterResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SubmitFeedbackResponse struct { +type GetExporterResponse struct { Body []byte HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Exporter // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetExporterResponse) GetJSON200() *Exporter { + return r.JSON200 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r SubmitFeedbackResponse) GetJSON4XX() *ClientError { +func (r GetExporterResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r SubmitFeedbackResponse) GetBody() []byte { +func (r GetExporterResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r SubmitFeedbackResponse) Status() string { +func (r GetExporterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7302,7 +9060,7 @@ func (r SubmitFeedbackResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SubmitFeedbackResponse) StatusCode() int { +func (r GetExporterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7310,39 +9068,39 @@ func (r SubmitFeedbackResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SubmitFeedbackResponse) ContentType() string { +func (r GetExporterResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetProjectsResponse struct { +type UpdateExporterResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]Project + JSON200 *Exporter // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetProjectsResponse) GetJSON200() *[]Project { +func (r UpdateExporterResponse) GetJSON200() *Exporter { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetProjectsResponse) GetJSON4XX() *ClientError { +func (r UpdateExporterResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetProjectsResponse) GetBody() []byte { +func (r UpdateExporterResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetProjectsResponse) Status() string { +func (r UpdateExporterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7350,7 +9108,7 @@ func (r GetProjectsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetProjectsResponse) StatusCode() int { +func (r UpdateExporterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7358,39 +9116,39 @@ func (r GetProjectsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetProjectsResponse) ContentType() string { +func (r UpdateExporterResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetAllowListsResponse struct { +type ResolveRefResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]AllowList + JSON200 *ResolveResult // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetAllowListsResponse) GetJSON200() *[]AllowList { +func (r ResolveRefResponse) GetJSON200() *ResolveResult { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetAllowListsResponse) GetJSON4XX() *ClientError { +func (r ResolveRefResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetAllowListsResponse) GetBody() []byte { +func (r ResolveRefResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetAllowListsResponse) Status() string { +func (r ResolveRefResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7398,7 +9156,7 @@ func (r GetAllowListsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAllowListsResponse) StatusCode() int { +func (r ResolveRefResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7406,39 +9164,39 @@ func (r GetAllowListsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetAllowListsResponse) ContentType() string { +func (r ResolveRefResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateAllowListResponse struct { +type GetServicesResponse struct { Body []byte HTTPResponse *http.Response - // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *AllowList + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateAllowListResponse) GetJSON201() *AllowList { - return r.JSON201 +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetServicesResponse) GetJSON200() *[]Service { + return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateAllowListResponse) GetJSON4XX() *ClientError { +func (r GetServicesResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r CreateAllowListResponse) GetBody() []byte { +func (r GetServicesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateAllowListResponse) Status() string { +func (r GetServicesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7446,7 +9204,7 @@ func (r CreateAllowListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateAllowListResponse) StatusCode() int { +func (r GetServicesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7454,32 +9212,39 @@ func (r CreateAllowListResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateAllowListResponse) ContentType() string { +func (r GetServicesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteAllowListResponse struct { +type CreateServiceResponse struct { Body []byte HTTPResponse *http.Response + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r CreateServiceResponse) GetJSON202() *Service { + return r.JSON202 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteAllowListResponse) GetJSON4XX() *ClientError { +func (r CreateServiceResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r DeleteAllowListResponse) GetBody() []byte { +func (r CreateServiceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteAllowListResponse) Status() string { +func (r CreateServiceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7487,7 +9252,7 @@ func (r DeleteAllowListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteAllowListResponse) StatusCode() int { +func (r CreateServiceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7495,39 +9260,32 @@ func (r DeleteAllowListResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteAllowListResponse) ContentType() string { +func (r CreateServiceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetAllowListResponse struct { +type DeleteServiceResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *AllowList // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetAllowListResponse) GetJSON200() *AllowList { - return r.JSON200 -} - // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetAllowListResponse) GetJSON4XX() *ClientError { +func (r DeleteServiceResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetAllowListResponse) GetBody() []byte { +func (r DeleteServiceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetAllowListResponse) Status() string { +func (r DeleteServiceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7535,7 +9293,7 @@ func (r GetAllowListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAllowListResponse) StatusCode() int { +func (r DeleteServiceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7543,39 +9301,39 @@ func (r GetAllowListResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetAllowListResponse) ContentType() string { +func (r DeleteServiceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateAllowListResponse struct { +type GetServiceResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *AllowList + JSON200 *Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r UpdateAllowListResponse) GetJSON200() *AllowList { +func (r GetServiceResponse) GetJSON200() *Service { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r UpdateAllowListResponse) GetJSON4XX() *ClientError { +func (r GetServiceResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r UpdateAllowListResponse) GetBody() []byte { +func (r GetServiceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdateAllowListResponse) Status() string { +func (r GetServiceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7583,7 +9341,7 @@ func (r UpdateAllowListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateAllowListResponse) StatusCode() int { +func (r GetServiceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7591,39 +9349,39 @@ func (r UpdateAllowListResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateAllowListResponse) ContentType() string { +func (r GetServiceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetExportersResponse struct { +type AttachServiceToAllowListResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]Exporter + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetExportersResponse) GetJSON200() *[]Exporter { - return r.JSON200 +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r AttachServiceToAllowListResponse) GetJSON202() *Service { + return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetExportersResponse) GetJSON4XX() *ClientError { +func (r AttachServiceToAllowListResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetExportersResponse) GetBody() []byte { +func (r AttachServiceToAllowListResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetExportersResponse) Status() string { +func (r AttachServiceToAllowListResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7631,7 +9389,7 @@ func (r GetExportersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetExportersResponse) StatusCode() int { +func (r AttachServiceToAllowListResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7639,39 +9397,39 @@ func (r GetExportersResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetExportersResponse) ContentType() string { +func (r AttachServiceToAllowListResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateExporterResponse struct { +type AttachServiceToExporterResponse struct { Body []byte HTTPResponse *http.Response - // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *Exporter + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateExporterResponse) GetJSON201() *Exporter { - return r.JSON201 +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r AttachServiceToExporterResponse) GetJSON202() *Service { + return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateExporterResponse) GetJSON4XX() *ClientError { +func (r AttachServiceToExporterResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r CreateExporterResponse) GetBody() []byte { +func (r AttachServiceToExporterResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateExporterResponse) Status() string { +func (r AttachServiceToExporterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7679,7 +9437,7 @@ func (r CreateExporterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateExporterResponse) StatusCode() int { +func (r AttachServiceToExporterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7687,32 +9445,39 @@ func (r CreateExporterResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateExporterResponse) ContentType() string { +func (r AttachServiceToExporterResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteExporterResponse struct { +type AttachServiceToVPCResponse struct { Body []byte HTTPResponse *http.Response + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *SuccessMessage // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r AttachServiceToVPCResponse) GetJSON202() *SuccessMessage { + return r.JSON202 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteExporterResponse) GetJSON4XX() *ClientError { +func (r AttachServiceToVPCResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r DeleteExporterResponse) GetBody() []byte { +func (r AttachServiceToVPCResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteExporterResponse) Status() string { +func (r AttachServiceToVPCResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7720,7 +9485,7 @@ func (r DeleteExporterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteExporterResponse) StatusCode() int { +func (r AttachServiceToVPCResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7728,39 +9493,39 @@ func (r DeleteExporterResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteExporterResponse) ContentType() string { +func (r AttachServiceToVPCResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetExporterResponse struct { +type GetBackupRegionsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Exporter + JSON200 *[]BackupRegion // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetExporterResponse) GetJSON200() *Exporter { +func (r GetBackupRegionsResponse) GetJSON200() *[]BackupRegion { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetExporterResponse) GetJSON4XX() *ClientError { +func (r GetBackupRegionsResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetExporterResponse) GetBody() []byte { +func (r GetBackupRegionsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetExporterResponse) Status() string { +func (r GetBackupRegionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7768,7 +9533,7 @@ func (r GetExporterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetExporterResponse) StatusCode() int { +func (r GetBackupRegionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7776,39 +9541,39 @@ func (r GetExporterResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetExporterResponse) ContentType() string { +func (r GetBackupRegionsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateExporterResponse struct { +type CreateBackupRegionResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Exporter + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *BackupRegion // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r UpdateExporterResponse) GetJSON200() *Exporter { - return r.JSON200 +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r CreateBackupRegionResponse) GetJSON201() *BackupRegion { + return r.JSON201 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r UpdateExporterResponse) GetJSON4XX() *ClientError { +func (r CreateBackupRegionResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r UpdateExporterResponse) GetBody() []byte { +func (r CreateBackupRegionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdateExporterResponse) Status() string { +func (r CreateBackupRegionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7816,7 +9581,7 @@ func (r UpdateExporterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateExporterResponse) StatusCode() int { +func (r CreateBackupRegionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7824,39 +9589,32 @@ func (r UpdateExporterResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateExporterResponse) ContentType() string { +func (r CreateBackupRegionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetServicesResponse struct { +type DeleteBackupRegionResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetServicesResponse) GetJSON200() *[]Service { - return r.JSON200 -} - // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetServicesResponse) GetJSON4XX() *ClientError { +func (r DeleteBackupRegionResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetServicesResponse) GetBody() []byte { +func (r DeleteBackupRegionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetServicesResponse) Status() string { +func (r DeleteBackupRegionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7864,7 +9622,7 @@ func (r GetServicesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetServicesResponse) StatusCode() int { +func (r DeleteBackupRegionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7872,39 +9630,39 @@ func (r GetServicesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetServicesResponse) ContentType() string { +func (r DeleteBackupRegionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateServiceResponse struct { +type GetBackupRetentionResponse struct { Body []byte HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Service + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *BackupRetentionByTime // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r CreateServiceResponse) GetJSON202() *Service { - return r.JSON202 +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetBackupRetentionResponse) GetJSON200() *BackupRetentionByTime { + return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateServiceResponse) GetJSON4XX() *ClientError { +func (r GetBackupRetentionResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r CreateServiceResponse) GetBody() []byte { +func (r GetBackupRetentionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateServiceResponse) Status() string { +func (r GetBackupRetentionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7912,7 +9670,7 @@ func (r CreateServiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateServiceResponse) StatusCode() int { +func (r GetBackupRetentionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7920,32 +9678,39 @@ func (r CreateServiceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateServiceResponse) ContentType() string { +func (r GetBackupRetentionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteServiceResponse struct { +type SetBackupRetentionResponse struct { Body []byte HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *BackupRetentionByTime // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r SetBackupRetentionResponse) GetJSON200() *BackupRetentionByTime { + return r.JSON200 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteServiceResponse) GetJSON4XX() *ClientError { +func (r SetBackupRetentionResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r DeleteServiceResponse) GetBody() []byte { +func (r SetBackupRetentionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteServiceResponse) Status() string { +func (r SetBackupRetentionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7953,7 +9718,7 @@ func (r DeleteServiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteServiceResponse) StatusCode() int { +func (r SetBackupRetentionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7961,39 +9726,39 @@ func (r DeleteServiceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteServiceResponse) ContentType() string { +func (r SetBackupRetentionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetServiceResponse struct { +type GetBackupsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Service + JSON200 *[]Backup // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetServiceResponse) GetJSON200() *Service { +func (r GetBackupsResponse) GetJSON200() *[]Backup { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetServiceResponse) GetJSON4XX() *ClientError { +func (r GetBackupsResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetServiceResponse) GetBody() []byte { +func (r GetBackupsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetServiceResponse) Status() string { +func (r GetBackupsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8001,7 +9766,7 @@ func (r GetServiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetServiceResponse) StatusCode() int { +func (r GetBackupsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8009,39 +9774,39 @@ func (r GetServiceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetServiceResponse) ContentType() string { +func (r GetBackupsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AttachServiceToAllowListResponse struct { +type GetBranchesResponse struct { Body []byte HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Service + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r AttachServiceToAllowListResponse) GetJSON202() *Service { - return r.JSON202 +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetBranchesResponse) GetJSON200() *[]Branch { + return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r AttachServiceToAllowListResponse) GetJSON4XX() *ClientError { +func (r GetBranchesResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r AttachServiceToAllowListResponse) GetBody() []byte { +func (r GetBranchesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AttachServiceToAllowListResponse) Status() string { +func (r GetBranchesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8049,7 +9814,7 @@ func (r AttachServiceToAllowListResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AttachServiceToAllowListResponse) StatusCode() int { +func (r GetBranchesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8057,39 +9822,39 @@ func (r AttachServiceToAllowListResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AttachServiceToAllowListResponse) ContentType() string { +func (r GetBranchesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AttachServiceToExporterResponse struct { +type CreateBranchResponse struct { Body []byte HTTPResponse *http.Response // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Service + JSON202 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r AttachServiceToExporterResponse) GetJSON202() *Service { +func (r CreateBranchResponse) GetJSON202() *Branch { return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r AttachServiceToExporterResponse) GetJSON4XX() *ClientError { +func (r CreateBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r AttachServiceToExporterResponse) GetBody() []byte { +func (r CreateBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AttachServiceToExporterResponse) Status() string { +func (r CreateBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8097,7 +9862,7 @@ func (r AttachServiceToExporterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AttachServiceToExporterResponse) StatusCode() int { +func (r CreateBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8105,39 +9870,32 @@ func (r AttachServiceToExporterResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AttachServiceToExporterResponse) ContentType() string { +func (r CreateBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type AttachServiceToVPCResponse struct { +type DeleteBranchResponse struct { Body []byte HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *SuccessMessage // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r AttachServiceToVPCResponse) GetJSON202() *SuccessMessage { - return r.JSON202 -} - // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r AttachServiceToVPCResponse) GetJSON4XX() *ClientError { +func (r DeleteBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r AttachServiceToVPCResponse) GetBody() []byte { +func (r DeleteBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r AttachServiceToVPCResponse) Status() string { +func (r DeleteBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8145,7 +9903,7 @@ func (r AttachServiceToVPCResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AttachServiceToVPCResponse) StatusCode() int { +func (r DeleteBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8153,39 +9911,39 @@ func (r AttachServiceToVPCResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r AttachServiceToVPCResponse) ContentType() string { +func (r DeleteBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetBackupRegionsResponse struct { +type GetBranchResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]BackupRegion + JSON200 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetBackupRegionsResponse) GetJSON200() *[]BackupRegion { +func (r GetBranchResponse) GetJSON200() *Branch { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetBackupRegionsResponse) GetJSON4XX() *ClientError { +func (r GetBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetBackupRegionsResponse) GetBody() []byte { +func (r GetBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetBackupRegionsResponse) Status() string { +func (r GetBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8193,7 +9951,7 @@ func (r GetBackupRegionsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetBackupRegionsResponse) StatusCode() int { +func (r GetBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8201,39 +9959,39 @@ func (r GetBackupRegionsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetBackupRegionsResponse) ContentType() string { +func (r GetBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateBackupRegionResponse struct { +type RenameBranchResponse struct { Body []byte HTTPResponse *http.Response - // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *BackupRegion + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateBackupRegionResponse) GetJSON201() *BackupRegion { - return r.JSON201 +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RenameBranchResponse) GetJSON200() *Branch { + return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateBackupRegionResponse) GetJSON4XX() *ClientError { +func (r RenameBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r CreateBackupRegionResponse) GetBody() []byte { +func (r RenameBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateBackupRegionResponse) Status() string { +func (r RenameBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8241,7 +9999,7 @@ func (r CreateBackupRegionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateBackupRegionResponse) StatusCode() int { +func (r RenameBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8249,32 +10007,39 @@ func (r CreateBackupRegionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateBackupRegionResponse) ContentType() string { +func (r RenameBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteBackupRegionResponse struct { +type ResizeBranchResponse struct { Body []byte HTTPResponse *http.Response + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r ResizeBranchResponse) GetJSON202() *Branch { + return r.JSON202 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteBackupRegionResponse) GetJSON4XX() *ClientError { +func (r ResizeBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r DeleteBackupRegionResponse) GetBody() []byte { +func (r ResizeBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteBackupRegionResponse) Status() string { +func (r ResizeBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8282,7 +10047,7 @@ func (r DeleteBackupRegionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteBackupRegionResponse) StatusCode() int { +func (r ResizeBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8290,39 +10055,39 @@ func (r DeleteBackupRegionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteBackupRegionResponse) ContentType() string { +func (r ResizeBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetBackupRetentionResponse struct { +type StartBranchResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *BackupRetentionByTime + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetBackupRetentionResponse) GetJSON200() *BackupRetentionByTime { - return r.JSON200 +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StartBranchResponse) GetJSON202() *Branch { + return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetBackupRetentionResponse) GetJSON4XX() *ClientError { +func (r StartBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetBackupRetentionResponse) GetBody() []byte { +func (r StartBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetBackupRetentionResponse) Status() string { +func (r StartBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8330,7 +10095,7 @@ func (r GetBackupRetentionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetBackupRetentionResponse) StatusCode() int { +func (r StartBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8338,39 +10103,39 @@ func (r GetBackupRetentionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetBackupRetentionResponse) ContentType() string { +func (r StartBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SetBackupRetentionResponse struct { +type StopBranchResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *BackupRetentionByTime + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Branch // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r SetBackupRetentionResponse) GetJSON200() *BackupRetentionByTime { - return r.JSON200 +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StopBranchResponse) GetJSON202() *Branch { + return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r SetBackupRetentionResponse) GetJSON4XX() *ClientError { +func (r StopBranchResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r SetBackupRetentionResponse) GetBody() []byte { +func (r StopBranchResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r SetBackupRetentionResponse) Status() string { +func (r StopBranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8378,7 +10143,7 @@ func (r SetBackupRetentionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetBackupRetentionResponse) StatusCode() int { +func (r StopBranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8386,39 +10151,32 @@ func (r SetBackupRetentionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SetBackupRetentionResponse) ContentType() string { +func (r StopBranchResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetBackupsResponse struct { +type UpdateBranchPasswordResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]Backup // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetBackupsResponse) GetJSON200() *[]Backup { - return r.JSON200 -} - // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetBackupsResponse) GetJSON4XX() *ClientError { +func (r UpdateBranchPasswordResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetBackupsResponse) GetBody() []byte { +func (r UpdateBranchPasswordResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetBackupsResponse) Status() string { +func (r UpdateBranchPasswordResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8426,7 +10184,7 @@ func (r GetBackupsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetBackupsResponse) StatusCode() int { +func (r UpdateBranchPasswordResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8434,7 +10192,7 @@ func (r GetBackupsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetBackupsResponse) ContentType() string { +func (r UpdateBranchPasswordResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } @@ -9490,32 +11248,217 @@ func (r SetHAReplicaResponse) ContentType() string { return "" } -type StartServiceResponse struct { +type StartServiceResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Service + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StartServiceResponse) GetJSON202() *Service { + return r.JSON202 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r StartServiceResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r StartServiceResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r StartServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r StartServiceResponse) 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 StartServiceResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type StopServiceResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *Service + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StopServiceResponse) GetJSON202() *Service { + return r.JSON202 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r StopServiceResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r StopServiceResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r StopServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r StopServiceResponse) 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 StopServiceResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdatePasswordResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r UpdatePasswordResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r UpdatePasswordResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r UpdatePasswordResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePasswordResponse) 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 UpdatePasswordResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetVPCsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *[]VPC + // JSON4XX the response for an HTTP 4XX `application/json` response + JSON4XX *ClientError +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetVPCsResponse) GetJSON200() *[]VPC { + return r.JSON200 +} + +// GetJSON4XX returns the response for an HTTP 4XX `application/json` response +func (r GetVPCsResponse) GetJSON4XX() *ClientError { + return r.JSON4XX +} + +// GetBody returns the raw response body bytes +func (r GetVPCsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r GetVPCsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetVPCsResponse) 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 GetVPCsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type CreateVPCResponse struct { Body []byte HTTPResponse *http.Response // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Service + JSON202 *VPC // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r StartServiceResponse) GetJSON202() *Service { +func (r CreateVPCResponse) GetJSON202() *VPC { return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r StartServiceResponse) GetJSON4XX() *ClientError { +func (r CreateVPCResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r StartServiceResponse) GetBody() []byte { +func (r CreateVPCResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r StartServiceResponse) Status() string { +func (r CreateVPCResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9523,7 +11466,7 @@ func (r StartServiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r StartServiceResponse) StatusCode() int { +func (r CreateVPCResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9531,39 +11474,32 @@ func (r StartServiceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r StartServiceResponse) ContentType() string { +func (r CreateVPCResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type StopServiceResponse struct { +type DeleteVPCResponse struct { Body []byte HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Service // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r StopServiceResponse) GetJSON202() *Service { - return r.JSON202 -} - // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r StopServiceResponse) GetJSON4XX() *ClientError { +func (r DeleteVPCResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r StopServiceResponse) GetBody() []byte { +func (r DeleteVPCResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r StopServiceResponse) Status() string { +func (r DeleteVPCResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9571,7 +11507,7 @@ func (r StopServiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r StopServiceResponse) StatusCode() int { +func (r DeleteVPCResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9579,32 +11515,39 @@ func (r StopServiceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r StopServiceResponse) ContentType() string { +func (r DeleteVPCResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdatePasswordResponse struct { +type GetVPCResponse struct { Body []byte HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *VPC // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetVPCResponse) GetJSON200() *VPC { + return r.JSON200 +} + // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r UpdatePasswordResponse) GetJSON4XX() *ClientError { +func (r GetVPCResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r UpdatePasswordResponse) GetBody() []byte { +func (r GetVPCResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdatePasswordResponse) Status() string { +func (r GetVPCResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9612,7 +11555,7 @@ func (r UpdatePasswordResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdatePasswordResponse) StatusCode() int { +func (r GetVPCResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9620,39 +11563,39 @@ func (r UpdatePasswordResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdatePasswordResponse) ContentType() string { +func (r GetVPCResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetVPCsResponse struct { +type GetVPCPeeringsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]VPC + JSON200 *[]Peering // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetVPCsResponse) GetJSON200() *[]VPC { +func (r GetVPCPeeringsResponse) GetJSON200() *[]Peering { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetVPCsResponse) GetJSON4XX() *ClientError { +func (r GetVPCPeeringsResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetVPCsResponse) GetBody() []byte { +func (r GetVPCPeeringsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetVPCsResponse) Status() string { +func (r GetVPCPeeringsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9660,7 +11603,7 @@ func (r GetVPCsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetVPCsResponse) StatusCode() int { +func (r GetVPCPeeringsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9668,39 +11611,39 @@ func (r GetVPCsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetVPCsResponse) ContentType() string { +func (r GetVPCPeeringsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateVPCResponse struct { +type CreateVPCPeeringResponse struct { Body []byte HTTPResponse *http.Response // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *VPC + JSON202 *Peering // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r CreateVPCResponse) GetJSON202() *VPC { +func (r CreateVPCPeeringResponse) GetJSON202() *Peering { return r.JSON202 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateVPCResponse) GetJSON4XX() *ClientError { +func (r CreateVPCPeeringResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r CreateVPCResponse) GetBody() []byte { +func (r CreateVPCPeeringResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateVPCResponse) Status() string { +func (r CreateVPCPeeringResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9708,7 +11651,7 @@ func (r CreateVPCResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateVPCResponse) StatusCode() int { +func (r CreateVPCPeeringResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9716,14 +11659,14 @@ func (r CreateVPCResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateVPCResponse) ContentType() string { +func (r CreateVPCPeeringResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteVPCResponse struct { +type DeleteVPCPeeringResponse struct { Body []byte HTTPResponse *http.Response // JSON4XX the response for an HTTP 4XX `application/json` response @@ -9731,17 +11674,17 @@ type DeleteVPCResponse struct { } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteVPCResponse) GetJSON4XX() *ClientError { +func (r DeleteVPCPeeringResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r DeleteVPCResponse) GetBody() []byte { +func (r DeleteVPCPeeringResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteVPCResponse) Status() string { +func (r DeleteVPCPeeringResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9749,7 +11692,7 @@ func (r DeleteVPCResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteVPCResponse) StatusCode() int { +func (r DeleteVPCPeeringResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9757,39 +11700,39 @@ func (r DeleteVPCResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteVPCResponse) ContentType() string { +func (r DeleteVPCPeeringResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetVPCResponse struct { +type GetVPCPeeringResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *VPC + JSON200 *Peering // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetVPCResponse) GetJSON200() *VPC { +func (r GetVPCPeeringResponse) GetJSON200() *Peering { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetVPCResponse) GetJSON4XX() *ClientError { +func (r GetVPCPeeringResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetVPCResponse) GetBody() []byte { +func (r GetVPCPeeringResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetVPCResponse) Status() string { +func (r GetVPCPeeringResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9797,7 +11740,7 @@ func (r GetVPCResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetVPCResponse) StatusCode() int { +func (r GetVPCPeeringResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9805,1869 +11748,2299 @@ func (r GetVPCResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetVPCResponse) ContentType() string { +func (r GetVPCPeeringResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetVPCPeeringsResponse struct { +type RenameVPCResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *[]Peering + JSON200 *SuccessMessage // JSON4XX the response for an HTTP 4XX `application/json` response JSON4XX *ClientError } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetVPCPeeringsResponse) GetJSON200() *[]Peering { +func (r RenameVPCResponse) GetJSON200() *SuccessMessage { return r.JSON200 } // GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetVPCPeeringsResponse) GetJSON4XX() *ClientError { +func (r RenameVPCResponse) GetJSON4XX() *ClientError { return r.JSON4XX } // GetBody returns the raw response body bytes -func (r GetVPCPeeringsResponse) GetBody() []byte { +func (r RenameVPCResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetVPCPeeringsResponse) Status() string { +func (r RenameVPCResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } - return http.StatusText(0) + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RenameVPCResponse) 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 RenameVPCResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// IdentifyUserWithBodyWithResponse Identify a user +// +// Identifies a user with optional properties for analytics tracking. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). +func (c *ClientWithResponses) IdentifyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) { + rsp, err := c.IdentifyUserWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseIdentifyUserResponse(rsp) +} + +// IdentifyUserWithResponse Identify a user +// +// Identifies a user with optional properties for analytics tracking. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). +func (c *ClientWithResponses) IdentifyUserWithResponse(ctx context.Context, body IdentifyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) { + rsp, err := c.IdentifyUser(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseIdentifyUserResponse(rsp) +} + +// TrackEventWithBodyWithResponse Track an analytics event +// +// Tracks an analytics event with optional properties. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /analytics/track (the `TrackEvent` operationId). +func (c *ClientWithResponses) TrackEventWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) { + rsp, err := c.TrackEventWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseTrackEventResponse(rsp) +} + +// TrackEventWithResponse Track an analytics event +// +// Tracks an analytics event with optional properties. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /analytics/track (the `TrackEvent` operationId). +func (c *ClientWithResponses) TrackEventWithResponse(ctx context.Context, body TrackEventJSONRequestBody, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) { + rsp, err := c.TrackEvent(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseTrackEventResponse(rsp) +} + +// GetAuthInfoWithResponse Get Authentication Info +// +// Returns the authenticated caller's identity. The response shape depends on the credential type: `apiKey` for PAT +// callers, `oauth` for OAuth user callers. Exactly one of `api_key` or `oauth` is populated; +// `type` discriminates. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /auth/info (the `GetAuthInfo` operationId). +func (c *ClientWithResponses) GetAuthInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthInfoResponse, error) { + rsp, err := c.GetAuthInfo(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAuthInfoResponse(rsp) +} + +// LogoutWithBodyWithResponse Log out and revoke refresh token +// +// Revokes the caller's refresh token server-side. For OAuth Bearer +// callers, include the refresh token in the request body — it is held +// client-side and cannot be derived from the access token. Callers +// without a refresh token to revoke may post an +// empty body to clear server-side session state best-effort. +// +// Returns 204 No Content on success. The caller is still responsible +// for dropping any locally-cached credentials. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /auth/logout (the `Logout` operationId). +func (c *ClientWithResponses) LogoutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LogoutResponse, error) { + rsp, err := c.LogoutWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseLogoutResponse(rsp) +} + +// LogoutWithResponse Log out and revoke refresh token +// +// Revokes the caller's refresh token server-side. For OAuth Bearer +// callers, include the refresh token in the request body — it is held +// client-side and cannot be derived from the access token. Callers +// without a refresh token to revoke may post an +// empty body to clear server-side session state best-effort. +// +// Returns 204 No Content on success. The caller is still responsible +// for dropping any locally-cached credentials. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /auth/logout (the `Logout` operationId). +func (c *ClientWithResponses) LogoutWithResponse(ctx context.Context, body LogoutJSONRequestBody, reqEditors ...RequestEditorFn) (*LogoutResponse, error) { + rsp, err := c.Logout(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseLogoutResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetVPCPeeringsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// SubmitFeedbackWithBodyWithResponse Submit feedback +// +// Sends feedback, a bug report, or a support request to Tiger Data. +// +// The submitter's email address is resolved from the caller's +// credentials, and the client version and operating system from the +// `User-Agent` header, so neither is supplied in the body. +// +// Returns 204 No Content on success. This endpoint opens no support +// case and returns no ticket to track: use it for unsolicited feedback, +// and raise anything needing a tracked response through support. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /feedback (the `SubmitFeedback` operationId). +func (c *ClientWithResponses) SubmitFeedbackWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) { + rsp, err := c.SubmitFeedbackWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseSubmitFeedbackResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetVPCPeeringsResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// SubmitFeedbackWithResponse Submit feedback +// +// Sends feedback, a bug report, or a support request to Tiger Data. +// +// The submitter's email address is resolved from the caller's +// credentials, and the client version and operating system from the +// `User-Agent` header, so neither is supplied in the body. +// +// Returns 204 No Content on success. This endpoint opens no support +// case and returns no ticket to track: use it for unsolicited feedback, +// and raise anything needing a tracked response through support. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /feedback (the `SubmitFeedback` operationId). +func (c *ClientWithResponses) SubmitFeedbackWithResponse(ctx context.Context, body SubmitFeedbackJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) { + rsp, err := c.SubmitFeedback(ctx, body, reqEditors...) + if err != nil { + return nil, err } - return "" -} - -type CreateVPCPeeringResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *Peering - // JSON4XX the response for an HTTP 4XX `application/json` response - JSON4XX *ClientError + return ParseSubmitFeedbackResponse(rsp) } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r CreateVPCPeeringResponse) GetJSON202() *Peering { - return r.JSON202 +// GetProjectsWithResponse List projects accessible to the authenticated caller +// +// Returns the projects the caller can access. PAT callers see only the +// project their PAT is scoped to; OAuth user callers see all projects +// they belong to. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects (the `GetProjects` operationId). +func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) { + rsp, err := c.GetProjects(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectsResponse(rsp) } -// GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r CreateVPCPeeringResponse) GetJSON4XX() *ClientError { - return r.JSON4XX +// GetAllowListsWithResponse List All IP Allow Lists +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves every IP allow list in a project. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/allow-lists (the `GetAllowLists` operationId). +func (c *ClientWithResponses) GetAllowListsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetAllowListsResponse, error) { + rsp, err := c.GetAllowLists(ctx, projectID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAllowListsResponse(rsp) } -// GetBody returns the raw response body bytes -func (r CreateVPCPeeringResponse) GetBody() []byte { - return r.Body +// CreateAllowListWithBodyWithResponse Create an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Creates an IP allow list in a project. An IP allow list carries no +// effect until it is attached to a service. +// +// The number of CIDR blocks per list and the number of lists per +// project are plan-dependent. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). +func (c *ClientWithResponses) CreateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) { + rsp, err := c.CreateAllowListWithBody(ctx, projectID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAllowListResponse(rsp) } -// Status returns HTTPResponse.Status -func (r CreateVPCPeeringResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateAllowListWithResponse Create an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Creates an IP allow list in a project. An IP allow list carries no +// effect until it is attached to a service. +// +// The number of CIDR blocks per list and the number of lists per +// project are plan-dependent. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). +func (c *ClientWithResponses) CreateAllowListWithResponse(ctx context.Context, projectID ProjectID, body CreateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) { + rsp, err := c.CreateAllowList(ctx, projectID, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateAllowListResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateVPCPeeringResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteAllowListWithResponse Delete an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Deletes an IP allow list. Refused if the list is still attached to +// any service. Detach it first. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /projects/{project_id}/allow-lists/{allow_list_id} (the `DeleteAllowList` operationId). +func (c *ClientWithResponses) DeleteAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*DeleteAllowListResponse, error) { + rsp, err := c.DeleteAllowList(ctx, projectID, allowListID, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteAllowListResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateVPCPeeringResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// GetAllowListWithResponse Get an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves a single IP allow list. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/allow-lists/{allow_list_id} (the `GetAllowList` operationId). +func (c *ClientWithResponses) GetAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*GetAllowListResponse, error) { + rsp, err := c.GetAllowList(ctx, projectID, allowListID, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseGetAllowListResponse(rsp) } -type DeleteVPCPeeringResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON4XX the response for an HTTP 4XX `application/json` response - JSON4XX *ClientError +// UpdateAllowListWithBodyWithResponse Update an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Updates an IP allow list in place. Send `description` and/or +// `cidr_blocks` to change them; omit either one to leave it +// unchanged. +// +// Every service the IP allow list is attached to is updated with the +// new CIDR blocks. To remove every CIDR block, delete the IP allow +// list instead of sending an empty `cidr_blocks`. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). +func (c *ClientWithResponses) UpdateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) { + rsp, err := c.UpdateAllowListWithBody(ctx, projectID, allowListID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAllowListResponse(rsp) } -// GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r DeleteVPCPeeringResponse) GetJSON4XX() *ClientError { - return r.JSON4XX +// UpdateAllowListWithResponse Update an IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Updates an IP allow list in place. Send `description` and/or +// `cidr_blocks` to change them; omit either one to leave it +// unchanged. +// +// Every service the IP allow list is attached to is updated with the +// new CIDR blocks. To remove every CIDR block, delete the IP allow +// list instead of sending an empty `cidr_blocks`. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). +func (c *ClientWithResponses) UpdateAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, body UpdateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) { + rsp, err := c.UpdateAllowList(ctx, projectID, allowListID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAllowListResponse(rsp) } -// GetBody returns the raw response body bytes -func (r DeleteVPCPeeringResponse) GetBody() []byte { - return r.Body +// GetProjectBranchesWithResponse List All Branches in a Project +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves a list of all branches within a specific project, regardless +// of parent service. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/branches (the `GetProjectBranches` operationId). +func (c *ClientWithResponses) GetProjectBranchesWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetProjectBranchesResponse, error) { + rsp, err := c.GetProjectBranches(ctx, projectID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectBranchesResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteVPCPeeringResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetExportersWithResponse List All Exporters +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves every exporter in a project, across every region. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/exporters (the `GetExporters` operationId). +func (c *ClientWithResponses) GetExportersWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetExportersResponse, error) { + rsp, err := c.GetExporters(ctx, projectID, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetExportersResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteVPCPeeringResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateExporterWithBodyWithResponse Create an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Creates an exporter in a project and region. +// +// An exporter carries no data until it is attached to a service. +// +// Exporters aren't available on every plan. If your project's plan +// doesn't include them, this request is refused here rather than later, +// when you try to attach one. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). +func (c *ClientWithResponses) CreateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) { + rsp, err := c.CreateExporterWithBody(ctx, projectID, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateExporterResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteVPCPeeringResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// CreateExporterWithResponse Create an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Creates an exporter in a project and region. +// +// An exporter carries no data until it is attached to a service. +// +// Exporters aren't available on every plan. If your project's plan +// doesn't include them, this request is refused here rather than later, +// when you try to attach one. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). +func (c *ClientWithResponses) CreateExporterWithResponse(ctx context.Context, projectID ProjectID, body CreateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) { + rsp, err := c.CreateExporter(ctx, projectID, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseCreateExporterResponse(rsp) } -type GetVPCPeeringResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Peering - // JSON4XX the response for an HTTP 4XX `application/json` response - JSON4XX *ClientError +// DeleteExporterWithResponse Delete an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Deletes an exporter and stops the data it was sending. Any service +// still attached is detached automatically. You don't need to detach it +// first, and nothing errors if you don't. +// +// Data already delivered to the destination is untouched, and nothing on +// the services themselves changes. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /projects/{project_id}/exporters/{exporter_id} (the `DeleteExporter` operationId). +func (c *ClientWithResponses) DeleteExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*DeleteExporterResponse, error) { + rsp, err := c.DeleteExporter(ctx, projectID, exporterID, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteExporterResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetVPCPeeringResponse) GetJSON200() *Peering { - return r.JSON200 +// GetExporterWithResponse Get an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves a single exporter. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/exporters/{exporter_id} (the `GetExporter` operationId). +func (c *ClientWithResponses) GetExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*GetExporterResponse, error) { + rsp, err := c.GetExporter(ctx, projectID, exporterID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExporterResponse(rsp) } -// GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r GetVPCPeeringResponse) GetJSON4XX() *ClientError { - return r.JSON4XX +// UpdateExporterWithBodyWithResponse Update an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Updates an exporter in place. Send `config` to replace the whole +// configuration; omit it to leave the configuration unchanged. +// +// Every service the exporter is attached to picks up the change; there +// is no need to detach and reattach. +// +// `type` must be included and must match the exporter's existing type; +// it cannot be changed. To send data somewhere else, create a new +// exporter and move the services over. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). +func (c *ClientWithResponses) UpdateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) { + rsp, err := c.UpdateExporterWithBody(ctx, projectID, exporterID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateExporterResponse(rsp) } -// GetBody returns the raw response body bytes -func (r GetVPCPeeringResponse) GetBody() []byte { - return r.Body +// UpdateExporterWithResponse Update an Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Updates an exporter in place. Send `config` to replace the whole +// configuration; omit it to leave the configuration unchanged. +// +// Every service the exporter is attached to picks up the change; there +// is no need to detach and reattach. +// +// `type` must be included and must match the exporter's existing type; +// it cannot be changed. To send data somewhere else, create a new +// exporter and move the services over. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). +func (c *ClientWithResponses) UpdateExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, body UpdateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) { + rsp, err := c.UpdateExporter(ctx, projectID, exporterID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateExporterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetVPCPeeringResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ResolveRefWithResponse Resolve a Service, Branch, or Read Replica Set +// +// Resolves `ref` to the service, branch, or read replica set it names. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/resolve (the `ResolveRef` operationId). +func (c *ClientWithResponses) ResolveRefWithResponse(ctx context.Context, projectID ProjectID, params *ResolveRefParams, reqEditors ...RequestEditorFn) (*ResolveRefResponse, error) { + rsp, err := c.ResolveRef(ctx, projectID, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseResolveRefResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetVPCPeeringResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetServicesWithResponse List All Services +// +// Retrieves a list of all services within a specific project. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/services (the `GetServices` operationId). +func (c *ClientWithResponses) GetServicesWithResponse(ctx context.Context, projectID ProjectID, params *GetServicesParams, reqEditors ...RequestEditorFn) (*GetServicesResponse, error) { + rsp, err := c.GetServices(ctx, projectID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetServicesResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetVPCPeeringResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// CreateServiceWithBodyWithResponse Create a Service +// +// Creates a new database service within a project. This is an asynchronous operation. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). +func (c *ClientWithResponses) CreateServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { + rsp, err := c.CreateServiceWithBody(ctx, projectID, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseCreateServiceResponse(rsp) } -type RenameVPCResponse struct { - Body []byte - HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *SuccessMessage - // JSON4XX the response for an HTTP 4XX `application/json` response - JSON4XX *ClientError +// CreateServiceWithResponse Create a Service +// +// Creates a new database service within a project. This is an asynchronous operation. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). +func (c *ClientWithResponses) CreateServiceWithResponse(ctx context.Context, projectID ProjectID, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { + rsp, err := c.CreateService(ctx, projectID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateServiceResponse(rsp) } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r RenameVPCResponse) GetJSON200() *SuccessMessage { - return r.JSON200 +// DeleteServiceWithResponse Delete a Service +// +// Deletes a specific service. This is an asynchronous operation. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /projects/{project_id}/services/{service_id} (the `DeleteService` operationId). +func (c *ClientWithResponses) DeleteServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) { + rsp, err := c.DeleteService(ctx, projectID, serviceID, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteServiceResponse(rsp) } -// GetJSON4XX returns the response for an HTTP 4XX `application/json` response -func (r RenameVPCResponse) GetJSON4XX() *ClientError { - return r.JSON4XX +// GetServiceWithResponse Get a Service +// +// Retrieves the details of a specific service by its ID. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/services/{service_id} (the `GetService` operationId). +func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) { + rsp, err := c.GetService(ctx, projectID, serviceID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetServiceResponse(rsp) } -// GetBody returns the raw response body bytes -func (r RenameVPCResponse) GetBody() []byte { - return r.Body +// AttachServiceToAllowListWithBodyWithResponse Attach Service to IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Restricts a service's connections to the IP ranges in an IP allow list. +// A service has at most one IP allow list; attaching a second one +// without detaching the first is refused. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). +func (c *ClientWithResponses) AttachServiceToAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) { + rsp, err := c.AttachServiceToAllowListWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAttachServiceToAllowListResponse(rsp) } -// Status returns HTTPResponse.Status -func (r RenameVPCResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// AttachServiceToAllowListWithResponse Attach Service to IP Allow List +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Restricts a service's connections to the IP ranges in an IP allow list. +// A service has at most one IP allow list; attaching a second one +// without detaching the first is refused. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). +func (c *ClientWithResponses) AttachServiceToAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) { + rsp, err := c.AttachServiceToAllowList(ctx, projectID, serviceID, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseAttachServiceToAllowListResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r RenameVPCResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// AttachServiceToExporterWithBodyWithResponse Attach Service to Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Starts sending a service's logs or metrics to an exporter. +// +// A service sends to at most one log exporter and one metric exporter at +// a time. Attaching a second exporter of the same kind is refused; +// detach the current one first. +// +// The first time a log exporter is attached to a service, the service +// restarts once. Attaching a different log exporter later does not +// restart anything, and neither does attaching a metric exporter. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). +func (c *ClientWithResponses) AttachServiceToExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) { + rsp, err := c.AttachServiceToExporterWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseAttachServiceToExporterResponse(rsp) } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r RenameVPCResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +// AttachServiceToExporterWithResponse Attach Service to Exporter +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Starts sending a service's logs or metrics to an exporter. +// +// A service sends to at most one log exporter and one metric exporter at +// a time. Attaching a second exporter of the same kind is refused; +// detach the current one first. +// +// The first time a log exporter is attached to a service, the service +// restarts once. Attaching a different log exporter later does not +// restart anything, and neither does attaching a metric exporter. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). +func (c *ClientWithResponses) AttachServiceToExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) { + rsp, err := c.AttachServiceToExporter(ctx, projectID, serviceID, body, reqEditors...) + if err != nil { + return nil, err } - return "" + return ParseAttachServiceToExporterResponse(rsp) } -// IdentifyUserWithBodyWithResponse Identify a user +// AttachServiceToVPCWithBodyWithResponse Attach Service to VPC // -// Identifies a user with optional properties for analytics tracking. +// Associates a service with a VPC. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). -func (c *ClientWithResponses) IdentifyUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) { - rsp, err := c.IdentifyUserWithBody(ctx, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). +func (c *ClientWithResponses) AttachServiceToVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) { + rsp, err := c.AttachServiceToVPCWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseIdentifyUserResponse(rsp) + return ParseAttachServiceToVPCResponse(rsp) } -// IdentifyUserWithResponse Identify a user +// AttachServiceToVPCWithResponse Attach Service to VPC // -// Identifies a user with optional properties for analytics tracking. +// Associates a service with a VPC. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /analytics/identify (the `IdentifyUser` operationId). -func (c *ClientWithResponses) IdentifyUserWithResponse(ctx context.Context, body IdentifyUserJSONRequestBody, reqEditors ...RequestEditorFn) (*IdentifyUserResponse, error) { - rsp, err := c.IdentifyUser(ctx, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). +func (c *ClientWithResponses) AttachServiceToVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) { + rsp, err := c.AttachServiceToVPC(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseIdentifyUserResponse(rsp) + return ParseAttachServiceToVPCResponse(rsp) } -// TrackEventWithBodyWithResponse Track an analytics event +// GetBackupRegionsWithResponse List All Backup Regions // -// Tracks an analytics event with optional properties. +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves the additional regions this service's backups are copied to +// (cross-region backups). The region the service runs in is not listed. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/services/{service_id}/backup-regions (the `GetBackupRegions` operationId). +func (c *ClientWithResponses) GetBackupRegionsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRegionsResponse, error) { + rsp, err := c.GetBackupRegions(ctx, projectID, serviceID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetBackupRegionsResponse(rsp) +} + +// CreateBackupRegionWithBodyWithResponse Add a Backup Region +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Starts copying this service's backups to another region. The region is +// added immediately; existing backups are copied to it in the background. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /analytics/track (the `TrackEvent` operationId). -func (c *ClientWithResponses) TrackEventWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) { - rsp, err := c.TrackEventWithBody(ctx, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). +func (c *ClientWithResponses) CreateBackupRegionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) { + rsp, err := c.CreateBackupRegionWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseTrackEventResponse(rsp) + return ParseCreateBackupRegionResponse(rsp) } -// TrackEventWithResponse Track an analytics event +// CreateBackupRegionWithResponse Add a Backup Region // -// Tracks an analytics event with optional properties. +// **Preview - this endpoint is experimental and may change without notice.** +// +// Starts copying this service's backups to another region. The region is +// added immediately; existing backups are copied to it in the background. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /analytics/track (the `TrackEvent` operationId). -func (c *ClientWithResponses) TrackEventWithResponse(ctx context.Context, body TrackEventJSONRequestBody, reqEditors ...RequestEditorFn) (*TrackEventResponse, error) { - rsp, err := c.TrackEvent(ctx, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). +func (c *ClientWithResponses) CreateBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBackupRegionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) { + rsp, err := c.CreateBackupRegion(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseTrackEventResponse(rsp) + return ParseCreateBackupRegionResponse(rsp) } -// GetAuthInfoWithResponse Get Authentication Info +// DeleteBackupRegionWithResponse Remove a Backup Region // -// Returns the authenticated caller's identity. The response shape depends on the credential type: `apiKey` for PAT -// callers, `oauth` for OAuth user callers. Exactly one of `api_key` or `oauth` is populated; -// `type` discriminates. +// **Preview - this endpoint is experimental and may change without notice.** +// +// Stops copying this service's backups to a region. Copies already stored +// there are deleted in the background and cannot be recovered. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /auth/info (the `GetAuthInfo` operationId). -func (c *ClientWithResponses) GetAuthInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthInfoResponse, error) { - rsp, err := c.GetAuthInfo(ctx, reqEditors...) +// Corresponds with DELETE /projects/{project_id}/services/{service_id}/backup-regions/{region_code} (the `DeleteBackupRegion` operationId). +func (c *ClientWithResponses) DeleteBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, regionCode BackupRegionCode, reqEditors ...RequestEditorFn) (*DeleteBackupRegionResponse, error) { + rsp, err := c.DeleteBackupRegion(ctx, projectID, serviceID, regionCode, reqEditors...) if err != nil { return nil, err } - return ParseGetAuthInfoResponse(rsp) + return ParseDeleteBackupRegionResponse(rsp) } -// LogoutWithBodyWithResponse Log out and revoke refresh token +// GetBackupRetentionWithResponse Get the Backup Retention Policy // -// Revokes the caller's refresh token server-side. For OAuth Bearer -// callers, include the refresh token in the request body — it is held -// client-side and cannot be derived from the access token. Callers -// without a refresh token to revoke may post an -// empty body to clear server-side session state best-effort. +// **Preview - this endpoint is experimental and may change without notice.** // -// Returns 204 No Content on success. The caller is still responsible -// for dropping any locally-cached credentials. +// Retrieves how long this service keeps its backups. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/services/{service_id}/backup-retention (the `GetBackupRetention` operationId). +func (c *ClientWithResponses) GetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRetentionResponse, error) { + rsp, err := c.GetBackupRetention(ctx, projectID, serviceID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetBackupRetentionResponse(rsp) +} + +// SetBackupRetentionWithBodyWithResponse Set the Backup Retention Policy +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Sets how long this service keeps its backups. Shortening retention +// deletes the backups that no longer fit. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /auth/logout (the `Logout` operationId). -func (c *ClientWithResponses) LogoutWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LogoutResponse, error) { - rsp, err := c.LogoutWithBody(ctx, contentType, body, reqEditors...) +// Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). +func (c *ClientWithResponses) SetBackupRetentionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) { + rsp, err := c.SetBackupRetentionWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseLogoutResponse(rsp) + return ParseSetBackupRetentionResponse(rsp) } -// LogoutWithResponse Log out and revoke refresh token +// SetBackupRetentionWithResponse Set the Backup Retention Policy // -// Revokes the caller's refresh token server-side. For OAuth Bearer -// callers, include the refresh token in the request body — it is held -// client-side and cannot be derived from the access token. Callers -// without a refresh token to revoke may post an -// empty body to clear server-side session state best-effort. +// **Preview - this endpoint is experimental and may change without notice.** // -// Returns 204 No Content on success. The caller is still responsible -// for dropping any locally-cached credentials. +// Sets how long this service keeps its backups. Shortening retention +// deletes the backups that no longer fit. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /auth/logout (the `Logout` operationId). -func (c *ClientWithResponses) LogoutWithResponse(ctx context.Context, body LogoutJSONRequestBody, reqEditors ...RequestEditorFn) (*LogoutResponse, error) { - rsp, err := c.Logout(ctx, body, reqEditors...) +// Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). +func (c *ClientWithResponses) SetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetBackupRetentionJSONRequestBody, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) { + rsp, err := c.SetBackupRetention(ctx, projectID, serviceID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetBackupRetentionResponse(rsp) +} + +// GetBackupsWithResponse List All Backups +// +// **Preview - this endpoint is experimental and may change without notice.** +// +// Retrieves a list of the full and incremental backups taken for a +// service. Backups run automatically on a schedule; there is no operation +// to create or delete one. To restore data, create a recovery fork with +// `fork_strategy: PITR`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /projects/{project_id}/services/{service_id}/backups (the `GetBackups` operationId). +func (c *ClientWithResponses) GetBackupsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupsResponse, error) { + rsp, err := c.GetBackups(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseLogoutResponse(rsp) + return ParseGetBackupsResponse(rsp) } -// SubmitFeedbackWithBodyWithResponse Submit feedback +// GetBranchesWithResponse List All Branches // -// Sends feedback, a bug report, or a support request to Tiger Data. -// -// The submitter's email address is resolved from the caller's -// credentials, and the client version and operating system from the -// `User-Agent` header, so neither is supplied in the body. +// **Preview - this endpoint is experimental and may change without notice.** // -// Returns 204 No Content on success. This endpoint opens no support -// case and returns no ticket to track: use it for unsolicited feedback, -// and raise anything needing a tracked response through support. +// Retrieves a list of all branches created from a service within a project. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /feedback (the `SubmitFeedback` operationId). -func (c *ClientWithResponses) SubmitFeedbackWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) { - rsp, err := c.SubmitFeedbackWithBody(ctx, contentType, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/branches (the `GetBranches` operationId). +func (c *ClientWithResponses) GetBranchesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetBranchesParams, reqEditors ...RequestEditorFn) (*GetBranchesResponse, error) { + rsp, err := c.GetBranches(ctx, projectID, serviceID, params, reqEditors...) if err != nil { return nil, err } - return ParseSubmitFeedbackResponse(rsp) + return ParseGetBranchesResponse(rsp) } -// SubmitFeedbackWithResponse Submit feedback +// CreateBranchWithBodyWithResponse Create a Branch // -// Sends feedback, a bug report, or a support request to Tiger Data. -// -// The submitter's email address is resolved from the caller's -// credentials, and the client version and operating system from the -// `User-Agent` header, so neither is supplied in the body. +// **Preview - this endpoint is experimental and may change without notice.** // -// Returns 204 No Content on success. This endpoint opens no support -// case and returns no ticket to track: use it for unsolicited feedback, -// and raise anything needing a tracked response through support. +// Creates a new branch from the service identified by `service_id`. A +// branch shares its parent's data at the moment of creation and gets +// its own, independently-sized compute. This is an asynchronous +// operation. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /feedback (the `SubmitFeedback` operationId). -func (c *ClientWithResponses) SubmitFeedbackWithResponse(ctx context.Context, body SubmitFeedbackJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitFeedbackResponse, error) { - rsp, err := c.SubmitFeedback(ctx, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). +func (c *ClientWithResponses) CreateBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBranchResponse, error) { + rsp, err := c.CreateBranchWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseSubmitFeedbackResponse(rsp) + return ParseCreateBranchResponse(rsp) } -// GetProjectsWithResponse List projects accessible to the authenticated caller +// CreateBranchWithResponse Create a Branch // -// Returns the projects the caller can access. PAT callers see only the -// project their PAT is scoped to; OAuth user callers see all projects -// they belong to. +// **Preview - this endpoint is experimental and may change without notice.** // -// Returns a wrapper object for the known response body format(s). +// Creates a new branch from the service identified by `service_id`. A +// branch shares its parent's data at the moment of creation and gets +// its own, independently-sized compute. This is an asynchronous +// operation. // -// Corresponds with GET /projects (the `GetProjects` operationId). -func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) { - rsp, err := c.GetProjects(ctx, reqEditors...) +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches (the `CreateBranch` operationId). +func (c *ClientWithResponses) CreateBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBranchResponse, error) { + rsp, err := c.CreateBranch(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetProjectsResponse(rsp) + return ParseCreateBranchResponse(rsp) } -// GetAllowListsWithResponse List All IP Allow Lists +// DeleteBranchWithResponse Delete a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Retrieves every IP allow list in a project. +// Deletes a specific branch. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/allow-lists (the `GetAllowLists` operationId). -func (c *ClientWithResponses) GetAllowListsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetAllowListsResponse, error) { - rsp, err := c.GetAllowLists(ctx, projectID, reqEditors...) +// Corresponds with DELETE /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `DeleteBranch` operationId). +func (c *ClientWithResponses) DeleteBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*DeleteBranchResponse, error) { + rsp, err := c.DeleteBranch(ctx, projectID, serviceID, branchID, reqEditors...) if err != nil { return nil, err } - return ParseGetAllowListsResponse(rsp) + return ParseDeleteBranchResponse(rsp) } -// CreateAllowListWithBodyWithResponse Create an IP Allow List +// GetBranchWithResponse Get a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Creates an IP allow list in a project. An IP allow list carries no -// effect until it is attached to a service. -// -// The number of CIDR blocks per list and the number of lists per -// project are plan-dependent. +// Retrieves the details of a specific branch by its ID. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). -func (c *ClientWithResponses) CreateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) { - rsp, err := c.CreateAllowListWithBody(ctx, projectID, contentType, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/branches/{branch_id} (the `GetBranch` operationId). +func (c *ClientWithResponses) GetBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*GetBranchResponse, error) { + rsp, err := c.GetBranch(ctx, projectID, serviceID, branchID, reqEditors...) if err != nil { return nil, err } - return ParseCreateAllowListResponse(rsp) + return ParseGetBranchResponse(rsp) } -// CreateAllowListWithResponse Create an IP Allow List +// RenameBranchWithBodyWithResponse Rename a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Creates an IP allow list in a project. An IP allow list carries no -// effect until it is attached to a service. -// -// The number of CIDR blocks per list and the number of lists per -// project are plan-dependent. +// Updates the name of a specific branch. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/allow-lists (the `CreateAllowList` operationId). -func (c *ClientWithResponses) CreateAllowListWithResponse(ctx context.Context, projectID ProjectID, body CreateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAllowListResponse, error) { - rsp, err := c.CreateAllowList(ctx, projectID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). +func (c *ClientWithResponses) RenameBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameBranchResponse, error) { + rsp, err := c.RenameBranchWithBody(ctx, projectID, serviceID, branchID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAllowListResponse(rsp) + return ParseRenameBranchResponse(rsp) } -// DeleteAllowListWithResponse Delete an IP Allow List +// RenameBranchWithResponse Rename a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Deletes an IP allow list. Refused if the list is still attached to -// any service. Detach it first. +// Updates the name of a specific branch. // -// Returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with DELETE /projects/{project_id}/allow-lists/{allow_list_id} (the `DeleteAllowList` operationId). -func (c *ClientWithResponses) DeleteAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*DeleteAllowListResponse, error) { - rsp, err := c.DeleteAllowList(ctx, projectID, allowListID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename (the `RenameBranch` operationId). +func (c *ClientWithResponses) RenameBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body RenameBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameBranchResponse, error) { + rsp, err := c.RenameBranch(ctx, projectID, serviceID, branchID, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteAllowListResponse(rsp) + return ParseRenameBranchResponse(rsp) } -// GetAllowListWithResponse Get an IP Allow List +// ResizeBranchWithBodyWithResponse Resize a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Retrieves a single IP allow list. +// Changes the compute allocation for a specific branch. +// Storage size is shared with the parent and is not resized through +// this operation. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/allow-lists/{allow_list_id} (the `GetAllowList` operationId). -func (c *ClientWithResponses) GetAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, reqEditors ...RequestEditorFn) (*GetAllowListResponse, error) { - rsp, err := c.GetAllowList(ctx, projectID, allowListID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). +func (c *ClientWithResponses) ResizeBranchWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeBranchResponse, error) { + rsp, err := c.ResizeBranchWithBody(ctx, projectID, serviceID, branchID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetAllowListResponse(rsp) + return ParseResizeBranchResponse(rsp) } -// UpdateAllowListWithBodyWithResponse Update an IP Allow List +// ResizeBranchWithResponse Resize a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Updates an IP allow list in place. Send `description` and/or -// `cidr_blocks` to change them; omit either one to leave it -// unchanged. -// -// Every service the IP allow list is attached to is updated with the -// new CIDR blocks. To remove every CIDR block, delete the IP allow -// list instead of sending an empty `cidr_blocks`. +// Changes the compute allocation for a specific branch. +// Storage size is shared with the parent and is not resized through +// this operation. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). -func (c *ClientWithResponses) UpdateAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) { - rsp, err := c.UpdateAllowListWithBody(ctx, projectID, allowListID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize (the `ResizeBranch` operationId). +func (c *ClientWithResponses) ResizeBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body ResizeBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeBranchResponse, error) { + rsp, err := c.ResizeBranch(ctx, projectID, serviceID, branchID, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAllowListResponse(rsp) + return ParseResizeBranchResponse(rsp) } -// UpdateAllowListWithResponse Update an IP Allow List +// StartBranchWithResponse Start a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Updates an IP allow list in place. Send `description` and/or -// `cidr_blocks` to change them; omit either one to leave it -// unchanged. -// -// Every service the IP allow list is attached to is updated with the -// new CIDR blocks. To remove every CIDR block, delete the IP allow -// list instead of sending an empty `cidr_blocks`. +// Starts a stopped branch. This is an asynchronous operation. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with PATCH /projects/{project_id}/allow-lists/{allow_list_id} (the `UpdateAllowList` operationId). -func (c *ClientWithResponses) UpdateAllowListWithResponse(ctx context.Context, projectID ProjectID, allowListID AllowListID, body UpdateAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAllowListResponse, error) { - rsp, err := c.UpdateAllowList(ctx, projectID, allowListID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/start (the `StartBranch` operationId). +func (c *ClientWithResponses) StartBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*StartBranchResponse, error) { + rsp, err := c.StartBranch(ctx, projectID, serviceID, branchID, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAllowListResponse(rsp) + return ParseStartBranchResponse(rsp) } -// GetExportersWithResponse List All Exporters +// StopBranchWithResponse Stop a Branch // // **Preview - this endpoint is experimental and may change without notice.** // -// Retrieves every exporter in a project, across every region. +// Stops a running branch. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/exporters (the `GetExporters` operationId). -func (c *ClientWithResponses) GetExportersWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetExportersResponse, error) { - rsp, err := c.GetExporters(ctx, projectID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/stop (the `StopBranch` operationId). +func (c *ClientWithResponses) StopBranchWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, reqEditors ...RequestEditorFn) (*StopBranchResponse, error) { + rsp, err := c.StopBranch(ctx, projectID, serviceID, branchID, reqEditors...) if err != nil { return nil, err } - return ParseGetExportersResponse(rsp) + return ParseStopBranchResponse(rsp) } -// CreateExporterWithBodyWithResponse Create an Exporter +// UpdateBranchPasswordWithBodyWithResponse Update Branch Password // // **Preview - this endpoint is experimental and may change without notice.** // -// Creates an exporter in a project and region. -// -// An exporter carries no data until it is attached to a service. -// -// Exporters aren't available on every plan. If your project's plan -// doesn't include them, this request is refused here rather than later, -// when you try to attach one. +// Sets a new master password for the branch. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). -func (c *ClientWithResponses) CreateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) { - rsp, err := c.CreateExporterWithBody(ctx, projectID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). +func (c *ClientWithResponses) UpdateBranchPasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateBranchPasswordResponse, error) { + rsp, err := c.UpdateBranchPasswordWithBody(ctx, projectID, serviceID, branchID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateExporterResponse(rsp) + return ParseUpdateBranchPasswordResponse(rsp) } -// CreateExporterWithResponse Create an Exporter +// UpdateBranchPasswordWithResponse Update Branch Password // // **Preview - this endpoint is experimental and may change without notice.** // -// Creates an exporter in a project and region. -// -// An exporter carries no data until it is attached to a service. -// -// Exporters aren't available on every plan. If your project's plan -// doesn't include them, this request is refused here rather than later, -// when you try to attach one. +// Sets a new master password for the branch. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/exporters (the `CreateExporter` operationId). -func (c *ClientWithResponses) CreateExporterWithResponse(ctx context.Context, projectID ProjectID, body CreateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExporterResponse, error) { - rsp, err := c.CreateExporter(ctx, projectID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword (the `UpdateBranchPassword` operationId). +func (c *ClientWithResponses) UpdateBranchPasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, branchID BranchID, body UpdateBranchPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateBranchPasswordResponse, error) { + rsp, err := c.UpdateBranchPassword(ctx, projectID, serviceID, branchID, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateExporterResponse(rsp) + return ParseUpdateBranchPasswordResponse(rsp) } -// DeleteExporterWithResponse Delete an Exporter +// DetachServiceFromAllowListWithBodyWithResponse Detach Service from IP Allow List // // **Preview - this endpoint is experimental and may change without notice.** // -// Deletes an exporter and stops the data it was sending. Any service -// still attached is detached automatically. You don't need to detach it -// first, and nothing errors if you don't. -// -// Data already delivered to the destination is untouched, and nothing on -// the services themselves changes. +// Removes the IP restriction an IP allow list placed on a service. The +// IP allow list itself is not deleted. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with DELETE /projects/{project_id}/exporters/{exporter_id} (the `DeleteExporter` operationId). -func (c *ClientWithResponses) DeleteExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*DeleteExporterResponse, error) { - rsp, err := c.DeleteExporter(ctx, projectID, exporterID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). +func (c *ClientWithResponses) DetachServiceFromAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) { + rsp, err := c.DetachServiceFromAllowListWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteExporterResponse(rsp) + return ParseDetachServiceFromAllowListResponse(rsp) } -// GetExporterWithResponse Get an Exporter +// DetachServiceFromAllowListWithResponse Detach Service from IP Allow List // // **Preview - this endpoint is experimental and may change without notice.** // -// Retrieves a single exporter. +// Removes the IP restriction an IP allow list placed on a service. The +// IP allow list itself is not deleted. // -// Returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/exporters/{exporter_id} (the `GetExporter` operationId). -func (c *ClientWithResponses) GetExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, reqEditors ...RequestEditorFn) (*GetExporterResponse, error) { - rsp, err := c.GetExporter(ctx, projectID, exporterID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). +func (c *ClientWithResponses) DetachServiceFromAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) { + rsp, err := c.DetachServiceFromAllowList(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetExporterResponse(rsp) + return ParseDetachServiceFromAllowListResponse(rsp) } -// UpdateExporterWithBodyWithResponse Update an Exporter +// DetachServiceFromExporterWithBodyWithResponse Detach Service from Exporter // // **Preview - this endpoint is experimental and may change without notice.** // -// Updates an exporter in place. Send `config` to replace the whole -// configuration; omit it to leave the configuration unchanged. -// -// Every service the exporter is attached to picks up the change; there -// is no need to detach and reattach. +// Stops sending a service's logs or metrics to an exporter. The exporter +// is not deleted and keeps serving any other service attached to it. // -// `type` must be included and must match the exporter's existing type; -// it cannot be changed. To send data somewhere else, create a new -// exporter and move the services over. +// Data already delivered to the destination is untouched. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). -func (c *ClientWithResponses) UpdateExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) { - rsp, err := c.UpdateExporterWithBody(ctx, projectID, exporterID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). +func (c *ClientWithResponses) DetachServiceFromExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) { + rsp, err := c.DetachServiceFromExporterWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateExporterResponse(rsp) + return ParseDetachServiceFromExporterResponse(rsp) } -// UpdateExporterWithResponse Update an Exporter +// DetachServiceFromExporterWithResponse Detach Service from Exporter // // **Preview - this endpoint is experimental and may change without notice.** // -// Updates an exporter in place. Send `config` to replace the whole -// configuration; omit it to leave the configuration unchanged. -// -// Every service the exporter is attached to picks up the change; there -// is no need to detach and reattach. +// Stops sending a service's logs or metrics to an exporter. The exporter +// is not deleted and keeps serving any other service attached to it. // -// `type` must be included and must match the exporter's existing type; -// it cannot be changed. To send data somewhere else, create a new -// exporter and move the services over. +// Data already delivered to the destination is untouched. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with PATCH /projects/{project_id}/exporters/{exporter_id} (the `UpdateExporter` operationId). -func (c *ClientWithResponses) UpdateExporterWithResponse(ctx context.Context, projectID ProjectID, exporterID ExporterID, body UpdateExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateExporterResponse, error) { - rsp, err := c.UpdateExporter(ctx, projectID, exporterID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). +func (c *ClientWithResponses) DetachServiceFromExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) { + rsp, err := c.DetachServiceFromExporter(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateExporterResponse(rsp) + return ParseDetachServiceFromExporterResponse(rsp) } -// GetServicesWithResponse List All Services +// DetachServiceFromVPCWithBodyWithResponse Detach Service from VPC // -// Retrieves a list of all services within a specific project. +// Disassociates a service from its VPC. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services (the `GetServices` operationId). -func (c *ClientWithResponses) GetServicesWithResponse(ctx context.Context, projectID ProjectID, params *GetServicesParams, reqEditors ...RequestEditorFn) (*GetServicesResponse, error) { - rsp, err := c.GetServices(ctx, projectID, params, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). +func (c *ClientWithResponses) DetachServiceFromVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) { + rsp, err := c.DetachServiceFromVPCWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetServicesResponse(rsp) + return ParseDetachServiceFromVPCResponse(rsp) } -// CreateServiceWithBodyWithResponse Create a Service +// DetachServiceFromVPCWithResponse Detach Service from VPC // -// Creates a new database service within a project. This is an asynchronous operation. +// Disassociates a service from its VPC. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). -func (c *ClientWithResponses) CreateServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { - rsp, err := c.CreateServiceWithBody(ctx, projectID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). +func (c *ClientWithResponses) DetachServiceFromVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) { + rsp, err := c.DetachServiceFromVPC(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateServiceResponse(rsp) + return ParseDetachServiceFromVPCResponse(rsp) } -// CreateServiceWithResponse Create a Service +// DisablePoolerWithResponse Disable Connection Pooler for a Service // -// Creates a new database service within a project. This is an asynchronous operation. +// Deactivates the connection pooler for a specific service within a project. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services (the `CreateService` operationId). -func (c *ClientWithResponses) CreateServiceWithResponse(ctx context.Context, projectID ProjectID, body CreateServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateServiceResponse, error) { - rsp, err := c.CreateService(ctx, projectID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). +func (c *ClientWithResponses) DisablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DisablePoolerResponse, error) { + rsp, err := c.DisablePooler(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseCreateServiceResponse(rsp) + return ParseDisablePoolerResponse(rsp) } -// DeleteServiceWithResponse Delete a Service +// EnableDataTieringWithResponse Enable Data Tiering for a Service // -// Deletes a specific service. This is an asynchronous operation. +// Enables tiered storage on the service. Tiering policies move older, +// rarely-accessed data from the high-performance storage tier to a +// low-cost object storage tier. Tiered data stays queryable but becomes +// read-only. +// +// There is no way to disable tiering through this API. Contact Tiger +// Data support if you need to turn it off. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with DELETE /projects/{project_id}/services/{service_id} (the `DeleteService` operationId). -func (c *ClientWithResponses) DeleteServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DeleteServiceResponse, error) { - rsp, err := c.DeleteService(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). +func (c *ClientWithResponses) EnableDataTieringWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnableDataTieringResponse, error) { + rsp, err := c.EnableDataTiering(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseDeleteServiceResponse(rsp) + return ParseEnableDataTieringResponse(rsp) } -// GetServiceWithResponse Get a Service +// EnablePoolerWithResponse Enable Connection Pooler for a Service // -// Retrieves the details of a specific service by its ID. +// Activates the connection pooler for a specific service within a project. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id} (the `GetService` operationId). -func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) { - rsp, err := c.GetService(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). +func (c *ClientWithResponses) EnablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnablePoolerResponse, error) { + rsp, err := c.EnablePooler(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceResponse(rsp) + return ParseEnablePoolerResponse(rsp) } -// AttachServiceToAllowListWithBodyWithResponse Attach Service to IP Allow List -// -// **Preview - this endpoint is experimental and may change without notice.** +// ForkServiceWithBodyWithResponse Fork a Service // -// Restricts a service's connections to the IP ranges in an IP allow list. -// A service has at most one IP allow list; attaching a second one -// without detaching the first is refused. +// Creates a new, independent service within a project by taking a snapshot of an existing one. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). -func (c *ClientWithResponses) AttachServiceToAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) { - rsp, err := c.AttachServiceToAllowListWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). +func (c *ClientWithResponses) ForkServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) { + rsp, err := c.ForkServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToAllowListResponse(rsp) + return ParseForkServiceResponse(rsp) } -// AttachServiceToAllowListWithResponse Attach Service to IP Allow List -// -// **Preview - this endpoint is experimental and may change without notice.** +// ForkServiceWithResponse Fork a Service // -// Restricts a service's connections to the IP ranges in an IP allow list. -// A service has at most one IP allow list; attaching a second one -// without detaching the first is refused. +// Creates a new, independent service within a project by taking a snapshot of an existing one. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToAllowList (the `AttachServiceToAllowList` operationId). -func (c *ClientWithResponses) AttachServiceToAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToAllowListResponse, error) { - rsp, err := c.AttachServiceToAllowList(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). +func (c *ClientWithResponses) ForkServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) { + rsp, err := c.ForkService(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToAllowListResponse(rsp) + return ParseForkServiceResponse(rsp) } -// AttachServiceToExporterWithBodyWithResponse Attach Service to Exporter -// -// **Preview - this endpoint is experimental and may change without notice.** -// -// Starts sending a service's logs or metrics to an exporter. +// GetServiceLogsWithResponse Get service logs // -// A service sends to at most one log exporter and one metric exporter at -// a time. Attaching a second exporter of the same kind is refused; -// detach the current one first. +// Fetch logs for a specific service. Returns up to 500 log entries in reverse +// chronological order. Supports cursor-based pagination via the `cursor` parameter +// and the `last_cursor` field in the response. // -// The first time a log exporter is attached to a service, the service -// restarts once. Attaching a different log exporter later does not -// restart anything, and neither does attaching a metric exporter. +// Use the returned `last_cursor` value as the `cursor` parameter on subsequent +// requests to page through all available logs. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). -func (c *ClientWithResponses) AttachServiceToExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) { - rsp, err := c.AttachServiceToExporterWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). +func (c *ClientWithResponses) GetServiceLogsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*GetServiceLogsResponse, error) { + rsp, err := c.GetServiceLogs(ctx, projectID, serviceID, params, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToExporterResponse(rsp) + return ParseGetServiceLogsResponse(rsp) } -// AttachServiceToExporterWithResponse Attach Service to Exporter -// -// **Preview - this endpoint is experimental and may change without notice.** -// -// Starts sending a service's logs or metrics to an exporter. -// -// A service sends to at most one log exporter and one metric exporter at -// a time. Attaching a second exporter of the same kind is refused; -// detach the current one first. +// GetServiceMetricsAvailableSeriesWithResponse List available metric series // -// The first time a log exporter is attached to a service, the service -// restarts once. Attaching a different log exporter later does not -// restart anything, and neither does attaching a metric exporter. +// Returns the names of all metric series available for a service. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToExporter (the `AttachServiceToExporter` operationId). -func (c *ClientWithResponses) AttachServiceToExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToExporterResponse, error) { - rsp, err := c.AttachServiceToExporter(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). +func (c *ClientWithResponses) GetServiceMetricsAvailableSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceMetricsAvailableSeriesResponse, error) { + rsp, err := c.GetServiceMetricsAvailableSeries(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToExporterResponse(rsp) + return ParseGetServiceMetricsAvailableSeriesResponse(rsp) } -// AttachServiceToVPCWithBodyWithResponse Attach Service to VPC +// GetServiceMetricDetailsWithResponse Get details about a metric // -// Associates a service with a VPC. +// Returns descriptive metadata for a named metric: what it measures, +// its type, default aggregation, and every label it can be filtered or +// grouped by — its own labels plus the region/role/ordinal labels most +// metrics also carry. Use getServiceMetricsAvailableSeries to discover +// valid metric names. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). -func (c *ClientWithResponses) AttachServiceToVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) { - rsp, err := c.AttachServiceToVPCWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). +func (c *ClientWithResponses) GetServiceMetricDetailsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*GetServiceMetricDetailsResponse, error) { + rsp, err := c.GetServiceMetricDetails(ctx, projectID, serviceID, metricName, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToVPCResponse(rsp) + return ParseGetServiceMetricDetailsResponse(rsp) } -// AttachServiceToVPCWithResponse Attach Service to VPC +// GetServiceMetricsSeriesWithBodyWithResponse Get a metric series // -// Associates a service with a VPC. +// Returns time-series data points for a named metric within a time window. +// Use getServiceMetricsAvailableSeries to discover valid metric names. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Parameters are sent as a JSON body so callers can pass an unbounded +// filter set without query-string length pressure. The response is a list +// of MetricSeries, each carrying its label set as a structured map +// alongside its per-bucket data points. // -// Corresponds with POST /projects/{project_id}/services/{service_id}/attachToVPC (the `AttachServiceToVPC` operationId). -func (c *ClientWithResponses) AttachServiceToVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body AttachServiceToVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachServiceToVPCResponse, error) { - rsp, err := c.AttachServiceToVPC(ctx, projectID, serviceID, body, reqEditors...) +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). +func (c *ClientWithResponses) GetServiceMetricsSeriesWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) { + rsp, err := c.GetServiceMetricsSeriesWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseAttachServiceToVPCResponse(rsp) + return ParseGetServiceMetricsSeriesResponse(rsp) } -// GetBackupRegionsWithResponse List All Backup Regions +// GetServiceMetricsSeriesWithResponse Get a metric series // -// **Preview - this endpoint is experimental and may change without notice.** +// Returns time-series data points for a named metric within a time window. +// Use getServiceMetricsAvailableSeries to discover valid metric names. // -// Retrieves the additional regions this service's backups are copied to -// (cross-region backups). The region the service runs in is not listed. +// Parameters are sent as a JSON body so callers can pass an unbounded +// filter set without query-string length pressure. The response is a list +// of MetricSeries, each carrying its label set as a structured map +// alongside its per-bucket data points. // -// Returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/backup-regions (the `GetBackupRegions` operationId). -func (c *ClientWithResponses) GetBackupRegionsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRegionsResponse, error) { - rsp, err := c.GetBackupRegions(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). +func (c *ClientWithResponses) GetServiceMetricsSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) { + rsp, err := c.GetServiceMetricsSeries(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetBackupRegionsResponse(rsp) + return ParseGetServiceMetricsSeriesResponse(rsp) } -// CreateBackupRegionWithBodyWithResponse Add a Backup Region -// -// **Preview - this endpoint is experimental and may change without notice.** +// RenameServiceWithBodyWithResponse Rename a Service // -// Starts copying this service's backups to another region. The region is -// added immediately; existing backups are copied to it in the background. +// Updates the name of a specific service. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). -func (c *ClientWithResponses) CreateBackupRegionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) { - rsp, err := c.CreateBackupRegionWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). +func (c *ClientWithResponses) RenameServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) { + rsp, err := c.RenameServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateBackupRegionResponse(rsp) + return ParseRenameServiceResponse(rsp) } -// CreateBackupRegionWithResponse Add a Backup Region -// -// **Preview - this endpoint is experimental and may change without notice.** +// RenameServiceWithResponse Rename a Service // -// Starts copying this service's backups to another region. The region is -// added immediately; existing backups are copied to it in the background. +// Updates the name of a specific service. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/backup-regions (the `CreateBackupRegion` operationId). -func (c *ClientWithResponses) CreateBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateBackupRegionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBackupRegionResponse, error) { - rsp, err := c.CreateBackupRegion(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). +func (c *ClientWithResponses) RenameServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) { + rsp, err := c.RenameService(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateBackupRegionResponse(rsp) + return ParseRenameServiceResponse(rsp) } -// DeleteBackupRegionWithResponse Remove a Backup Region -// -// **Preview - this endpoint is experimental and may change without notice.** +// GetReplicaSetsWithResponse Get Read Replica Sets // -// Stops copying this service's backups to a region. Copies already stored -// there are deleted in the background and cannot be recovered. +// Retrieves a list of all read replica sets associated with a primary service within a project. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with DELETE /projects/{project_id}/services/{service_id}/backup-regions/{region_code} (the `DeleteBackupRegion` operationId). -func (c *ClientWithResponses) DeleteBackupRegionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, regionCode BackupRegionCode, reqEditors ...RequestEditorFn) (*DeleteBackupRegionResponse, error) { - rsp, err := c.DeleteBackupRegion(ctx, projectID, serviceID, regionCode, reqEditors...) +// Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). +func (c *ClientWithResponses) GetReplicaSetsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetReplicaSetsResponse, error) { + rsp, err := c.GetReplicaSets(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseDeleteBackupRegionResponse(rsp) + return ParseGetReplicaSetsResponse(rsp) } -// GetBackupRetentionWithResponse Get the Backup Retention Policy +// CreateReplicaSetWithBodyWithResponse Create a Read Replica Set // -// **Preview - this endpoint is experimental and may change without notice.** +// Creates a new read replica set for a service. This is an asynchronous operation. // -// Retrieves how long this service keeps its backups. +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Returns a wrapper object for the known response body format(s). +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). +func (c *ClientWithResponses) CreateReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) { + rsp, err := c.CreateReplicaSetWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateReplicaSetResponse(rsp) +} + +// CreateReplicaSetWithResponse Create a Read Replica Set +// +// Creates a new read replica set for a service. This is an asynchronous operation. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/backup-retention (the `GetBackupRetention` operationId). -func (c *ClientWithResponses) GetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupRetentionResponse, error) { - rsp, err := c.GetBackupRetention(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). +func (c *ClientWithResponses) CreateReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) { + rsp, err := c.CreateReplicaSet(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetBackupRetentionResponse(rsp) + return ParseCreateReplicaSetResponse(rsp) } -// SetBackupRetentionWithBodyWithResponse Set the Backup Retention Policy -// -// **Preview - this endpoint is experimental and may change without notice.** +// DeleteReplicaSetWithResponse Delete a Read Replica Set // -// Sets how long this service keeps its backups. Shortening retention -// deletes the backups that no longer fit. +// Deletes a specific read replica set. This is an asynchronous operation. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). -func (c *ClientWithResponses) SetBackupRetentionWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) { - rsp, err := c.SetBackupRetentionWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). +func (c *ClientWithResponses) DeleteReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DeleteReplicaSetResponse, error) { + rsp, err := c.DeleteReplicaSet(ctx, projectID, serviceID, replicaSetID, reqEditors...) if err != nil { return nil, err } - return ParseSetBackupRetentionResponse(rsp) + return ParseDeleteReplicaSetResponse(rsp) } -// SetBackupRetentionWithResponse Set the Backup Retention Policy -// -// **Preview - this endpoint is experimental and may change without notice.** +// DisableReplicaPoolerWithResponse Disable Connection Pooler for a Read Replica // -// Sets how long this service keeps its backups. Shortening retention -// deletes the backups that no longer fit. +// Deactivates the connection pooler for a specific read replica set. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with PUT /projects/{project_id}/services/{service_id}/backup-retention (the `SetBackupRetention` operationId). -func (c *ClientWithResponses) SetBackupRetentionWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetBackupRetentionJSONRequestBody, reqEditors ...RequestEditorFn) (*SetBackupRetentionResponse, error) { - rsp, err := c.SetBackupRetention(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). +func (c *ClientWithResponses) DisableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DisableReplicaPoolerResponse, error) { + rsp, err := c.DisableReplicaPooler(ctx, projectID, serviceID, replicaSetID, reqEditors...) if err != nil { return nil, err } - return ParseSetBackupRetentionResponse(rsp) + return ParseDisableReplicaPoolerResponse(rsp) } -// GetBackupsWithResponse List All Backups -// -// **Preview - this endpoint is experimental and may change without notice.** +// EnableReplicaPoolerWithResponse Enable Connection Pooler for a Read Replica // -// Retrieves a list of the full and incremental backups taken for a -// service. Backups run automatically on a schedule; there is no operation -// to create or delete one. To restore data, create a recovery fork with -// `fork_strategy: PITR`. +// Activates the connection pooler for a specific read replica set. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/backups (the `GetBackups` operationId). -func (c *ClientWithResponses) GetBackupsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetBackupsResponse, error) { - rsp, err := c.GetBackups(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). +func (c *ClientWithResponses) EnableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*EnableReplicaPoolerResponse, error) { + rsp, err := c.EnableReplicaPooler(ctx, projectID, serviceID, replicaSetID, reqEditors...) if err != nil { return nil, err } - return ParseGetBackupsResponse(rsp) + return ParseEnableReplicaPoolerResponse(rsp) } -// DetachServiceFromAllowListWithBodyWithResponse Detach Service from IP Allow List -// -// **Preview - this endpoint is experimental and may change without notice.** +// ResizeReplicaSetWithBodyWithResponse Resize a Read Replica Set // -// Removes the IP restriction an IP allow list placed on a service. The -// IP allow list itself is not deleted. +// Changes the resource allocation for a specific read replica set. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). -func (c *ClientWithResponses) DetachServiceFromAllowListWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) { - rsp, err := c.DetachServiceFromAllowListWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). +func (c *ClientWithResponses) ResizeReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) { + rsp, err := c.ResizeReplicaSetWithBody(ctx, projectID, serviceID, replicaSetID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromAllowListResponse(rsp) + return ParseResizeReplicaSetResponse(rsp) } -// DetachServiceFromAllowListWithResponse Detach Service from IP Allow List -// -// **Preview - this endpoint is experimental and may change without notice.** +// ResizeReplicaSetWithResponse Resize a Read Replica Set // -// Removes the IP restriction an IP allow list placed on a service. The -// IP allow list itself is not deleted. +// Changes the resource allocation for a specific read replica set. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromAllowList (the `DetachServiceFromAllowList` operationId). -func (c *ClientWithResponses) DetachServiceFromAllowListWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromAllowListJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromAllowListResponse, error) { - rsp, err := c.DetachServiceFromAllowList(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). +func (c *ClientWithResponses) ResizeReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) { + rsp, err := c.ResizeReplicaSet(ctx, projectID, serviceID, replicaSetID, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromAllowListResponse(rsp) + return ParseResizeReplicaSetResponse(rsp) } -// DetachServiceFromExporterWithBodyWithResponse Detach Service from Exporter -// -// **Preview - this endpoint is experimental and may change without notice.** -// -// Stops sending a service's logs or metrics to an exporter. The exporter -// is not deleted and keeps serving any other service attached to it. +// SetReplicaEnvironmentWithBodyWithResponse Set Environment for a Read Replica // -// Data already delivered to the destination is untouched. +// Sets the environment type for the read replica set. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). -func (c *ClientWithResponses) DetachServiceFromExporterWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) { - rsp, err := c.DetachServiceFromExporterWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). +func (c *ClientWithResponses) SetReplicaEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) { + rsp, err := c.SetReplicaEnvironmentWithBody(ctx, projectID, serviceID, replicaSetID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromExporterResponse(rsp) + return ParseSetReplicaEnvironmentResponse(rsp) } -// DetachServiceFromExporterWithResponse Detach Service from Exporter -// -// **Preview - this endpoint is experimental and may change without notice.** -// -// Stops sending a service's logs or metrics to an exporter. The exporter -// is not deleted and keeps serving any other service attached to it. +// SetReplicaEnvironmentWithResponse Set Environment for a Read Replica // -// Data already delivered to the destination is untouched. +// Sets the environment type for the read replica set. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromExporter (the `DetachServiceFromExporter` operationId). -func (c *ClientWithResponses) DetachServiceFromExporterWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromExporterJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromExporterResponse, error) { - rsp, err := c.DetachServiceFromExporter(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). +func (c *ClientWithResponses) SetReplicaEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) { + rsp, err := c.SetReplicaEnvironment(ctx, projectID, serviceID, replicaSetID, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromExporterResponse(rsp) + return ParseSetReplicaEnvironmentResponse(rsp) } -// DetachServiceFromVPCWithBodyWithResponse Detach Service from VPC +// ResizeServiceWithBodyWithResponse Resize a Service // -// Disassociates a service from its VPC. +// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). -func (c *ClientWithResponses) DetachServiceFromVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) { - rsp, err := c.DetachServiceFromVPCWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). +func (c *ClientWithResponses) ResizeServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) { + rsp, err := c.ResizeServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromVPCResponse(rsp) + return ParseResizeServiceResponse(rsp) } -// DetachServiceFromVPCWithResponse Detach Service from VPC +// ResizeServiceWithResponse Resize a Service // -// Disassociates a service from its VPC. +// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/detachFromVPC (the `DetachServiceFromVPC` operationId). -func (c *ClientWithResponses) DetachServiceFromVPCWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body DetachServiceFromVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*DetachServiceFromVPCResponse, error) { - rsp, err := c.DetachServiceFromVPC(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). +func (c *ClientWithResponses) ResizeServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) { + rsp, err := c.ResizeService(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseDetachServiceFromVPCResponse(rsp) + return ParseResizeServiceResponse(rsp) } -// DisablePoolerWithResponse Disable Connection Pooler for a Service +// SetEnvironmentWithBodyWithResponse Set Environment for a Service // -// Deactivates the connection pooler for a specific service within a project. +// Sets the environment type for the service. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/disablePooler (the `DisablePooler` operationId). -func (c *ClientWithResponses) DisablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*DisablePoolerResponse, error) { - rsp, err := c.DisablePooler(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). +func (c *ClientWithResponses) SetEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) { + rsp, err := c.SetEnvironmentWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDisablePoolerResponse(rsp) + return ParseSetEnvironmentResponse(rsp) } -// EnableDataTieringWithResponse Enable Data Tiering for a Service -// -// Enables tiered storage on the service. Tiering policies move older, -// rarely-accessed data from the high-performance storage tier to a -// low-cost object storage tier. Tiered data stays queryable but becomes -// read-only. +// SetEnvironmentWithResponse Set Environment for a Service // -// There is no way to disable tiering through this API. Contact Tiger -// Data support if you need to turn it off. +// Sets the environment type for the service. // -// Returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/enableDataTiering (the `EnableDataTiering` operationId). -func (c *ClientWithResponses) EnableDataTieringWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnableDataTieringResponse, error) { - rsp, err := c.EnableDataTiering(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). +func (c *ClientWithResponses) SetEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) { + rsp, err := c.SetEnvironment(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseEnableDataTieringResponse(rsp) + return ParseSetEnvironmentResponse(rsp) } -// EnablePoolerWithResponse Enable Connection Pooler for a Service +// SetHAReplicaWithBodyWithResponse Change HA configuration for a Service // -// Activates the connection pooler for a specific service within a project. +// Changes the HA configuration for a specific service. This is an asynchronous operation. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/enablePooler (the `EnablePooler` operationId). -func (c *ClientWithResponses) EnablePoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*EnablePoolerResponse, error) { - rsp, err := c.EnablePooler(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). +func (c *ClientWithResponses) SetHAReplicaWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) { + rsp, err := c.SetHAReplicaWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseEnablePoolerResponse(rsp) + return ParseSetHAReplicaResponse(rsp) } -// ForkServiceWithBodyWithResponse Fork a Service +// SetHAReplicaWithResponse Change HA configuration for a Service // -// Creates a new, independent service within a project by taking a snapshot of an existing one. +// Changes the HA configuration for a specific service. This is an asynchronous operation. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). -func (c *ClientWithResponses) ForkServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) { - rsp, err := c.ForkServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). +func (c *ClientWithResponses) SetHAReplicaWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) { + rsp, err := c.SetHAReplica(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseForkServiceResponse(rsp) + return ParseSetHAReplicaResponse(rsp) } -// ForkServiceWithResponse Fork a Service +// StartServiceWithResponse Start a Service // -// Creates a new, independent service within a project by taking a snapshot of an existing one. +// Starts a stopped service within a project. This is an asynchronous operation. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/forkService (the `ForkService` operationId). -func (c *ClientWithResponses) ForkServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ForkServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ForkServiceResponse, error) { - rsp, err := c.ForkService(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/start (the `StartService` operationId). +func (c *ClientWithResponses) StartServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StartServiceResponse, error) { + rsp, err := c.StartService(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseForkServiceResponse(rsp) + return ParseStartServiceResponse(rsp) } -// GetServiceLogsWithResponse Get service logs -// -// Fetch logs for a specific service. Returns up to 500 log entries in reverse -// chronological order. Supports cursor-based pagination via the `cursor` parameter -// and the `last_cursor` field in the response. +// StopServiceWithResponse Stop a Service // -// Use the returned `last_cursor` value as the `cursor` parameter on subsequent -// requests to page through all available logs. +// Stops a running service within a project. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/logs (the `GetServiceLogs` operationId). -func (c *ClientWithResponses) GetServiceLogsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, params *GetServiceLogsParams, reqEditors ...RequestEditorFn) (*GetServiceLogsResponse, error) { - rsp, err := c.GetServiceLogs(ctx, projectID, serviceID, params, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/stop (the `StopService` operationId). +func (c *ClientWithResponses) StopServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StopServiceResponse, error) { + rsp, err := c.StopService(ctx, projectID, serviceID, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceLogsResponse(rsp) + return ParseStopServiceResponse(rsp) +} + +// UpdatePasswordWithBodyWithResponse Update Service Password +// +// Sets a new master password for the service within a project. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). +func (c *ClientWithResponses) UpdatePasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) { + rsp, err := c.UpdatePasswordWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePasswordResponse(rsp) } -// GetServiceMetricsAvailableSeriesWithResponse List available metric series +// UpdatePasswordWithResponse Update Service Password // -// Returns the names of all metric series available for a service. +// Sets a new master password for the service within a project. // -// Returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/available-series (the `GetServiceMetricsAvailableSeries` operationId). -func (c *ClientWithResponses) GetServiceMetricsAvailableSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetServiceMetricsAvailableSeriesResponse, error) { - rsp, err := c.GetServiceMetricsAvailableSeries(ctx, projectID, serviceID, reqEditors...) +// Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). +func (c *ClientWithResponses) UpdatePasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) { + rsp, err := c.UpdatePassword(ctx, projectID, serviceID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceMetricsAvailableSeriesResponse(rsp) + return ParseUpdatePasswordResponse(rsp) } -// GetServiceMetricDetailsWithResponse Get details about a metric +// GetVPCsWithResponse List All VPCs // -// Returns descriptive metadata for a named metric: what it measures, -// its type, default aggregation, and every label it can be filtered or -// grouped by — its own labels plus the region/role/ordinal labels most -// metrics also carry. Use getServiceMetricsAvailableSeries to discover -// valid metric names. +// Retrieves a list of all Virtual Private Clouds (VPCs). // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/metrics/details/{metric_name} (the `GetServiceMetricDetails` operationId). -func (c *ClientWithResponses) GetServiceMetricDetailsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, metricName string, reqEditors ...RequestEditorFn) (*GetServiceMetricDetailsResponse, error) { - rsp, err := c.GetServiceMetricDetails(ctx, projectID, serviceID, metricName, reqEditors...) +// Corresponds with GET /projects/{project_id}/vpcs (the `GetVPCs` operationId). +func (c *ClientWithResponses) GetVPCsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetVPCsResponse, error) { + rsp, err := c.GetVPCs(ctx, projectID, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceMetricDetailsResponse(rsp) + return ParseGetVPCsResponse(rsp) } -// GetServiceMetricsSeriesWithBodyWithResponse Get a metric series -// -// Returns time-series data points for a named metric within a time window. -// Use getServiceMetricsAvailableSeries to discover valid metric names. +// CreateVPCWithBodyWithResponse Create a VPC // -// Parameters are sent as a JSON body so callers can pass an unbounded -// filter set without query-string length pressure. The response is a list -// of MetricSeries, each carrying its label set as a structured map -// alongside its per-bucket data points. +// Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). -func (c *ClientWithResponses) GetServiceMetricsSeriesWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) { - rsp, err := c.GetServiceMetricsSeriesWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). +func (c *ClientWithResponses) CreateVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) { + rsp, err := c.CreateVPCWithBody(ctx, projectID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceMetricsSeriesResponse(rsp) + return ParseCreateVPCResponse(rsp) } -// GetServiceMetricsSeriesWithResponse Get a metric series -// -// Returns time-series data points for a named metric within a time window. -// Use getServiceMetricsAvailableSeries to discover valid metric names. +// CreateVPCWithResponse Create a VPC // -// Parameters are sent as a JSON body so callers can pass an unbounded -// filter set without query-string length pressure. The response is a list -// of MetricSeries, each carrying its label set as a structured map -// alongside its per-bucket data points. +// Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/metrics/series (the `GetServiceMetricsSeries` operationId). -func (c *ClientWithResponses) GetServiceMetricsSeriesWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body GetServiceMetricsSeriesJSONRequestBody, reqEditors ...RequestEditorFn) (*GetServiceMetricsSeriesResponse, error) { - rsp, err := c.GetServiceMetricsSeries(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). +func (c *ClientWithResponses) CreateVPCWithResponse(ctx context.Context, projectID ProjectID, body CreateVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) { + rsp, err := c.CreateVPC(ctx, projectID, body, reqEditors...) if err != nil { return nil, err } - return ParseGetServiceMetricsSeriesResponse(rsp) + return ParseCreateVPCResponse(rsp) } -// RenameServiceWithBodyWithResponse Rename a Service +// DeleteVPCWithResponse Delete a VPC // -// Updates the name of a specific service. +// Deletes a specific VPC. This is an asynchronous operation. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). -func (c *ClientWithResponses) RenameServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) { - rsp, err := c.RenameServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id} (the `DeleteVPC` operationId). +func (c *ClientWithResponses) DeleteVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*DeleteVPCResponse, error) { + rsp, err := c.DeleteVPC(ctx, projectID, vpcID, reqEditors...) if err != nil { return nil, err } - return ParseRenameServiceResponse(rsp) + return ParseDeleteVPCResponse(rsp) } -// RenameServiceWithResponse Rename a Service +// GetVPCWithResponse Get a VPC // -// Updates the name of a specific service. +// Retrieves the details of a specific VPC by its ID. // -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/rename (the `RenameService` operationId). -func (c *ClientWithResponses) RenameServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body RenameServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameServiceResponse, error) { - rsp, err := c.RenameService(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id} (the `GetVPC` operationId). +func (c *ClientWithResponses) GetVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCResponse, error) { + rsp, err := c.GetVPC(ctx, projectID, vpcID, reqEditors...) if err != nil { return nil, err } - return ParseRenameServiceResponse(rsp) + return ParseGetVPCResponse(rsp) } -// GetReplicaSetsWithResponse Get Read Replica Sets +// GetVPCPeeringsWithResponse List VPC Peerings // -// Retrieves a list of all read replica sets associated with a primary service within a project. +// Retrieves a list of all VPC peering connections for a given VPC. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with GET /projects/{project_id}/services/{service_id}/replicaSets (the `GetReplicaSets` operationId). -func (c *ClientWithResponses) GetReplicaSetsWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*GetReplicaSetsResponse, error) { - rsp, err := c.GetReplicaSets(ctx, projectID, serviceID, reqEditors...) +// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings (the `GetVPCPeerings` operationId). +func (c *ClientWithResponses) GetVPCPeeringsWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCPeeringsResponse, error) { + rsp, err := c.GetVPCPeerings(ctx, projectID, vpcID, reqEditors...) if err != nil { return nil, err } - return ParseGetReplicaSetsResponse(rsp) + return ParseGetVPCPeeringsResponse(rsp) } -// CreateReplicaSetWithBodyWithResponse Create a Read Replica Set +// CreateVPCPeeringWithBodyWithResponse Create a VPC Peering // -// Creates a new read replica set for a service. This is an asynchronous operation. +// Creates a new VPC peering connection. This is an asynchronous operation. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). -func (c *ClientWithResponses) CreateReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) { - rsp, err := c.CreateReplicaSetWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). +func (c *ClientWithResponses) CreateVPCPeeringWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) { + rsp, err := c.CreateVPCPeeringWithBody(ctx, projectID, vpcID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateReplicaSetResponse(rsp) + return ParseCreateVPCPeeringResponse(rsp) } -// CreateReplicaSetWithResponse Create a Read Replica Set +// CreateVPCPeeringWithResponse Create a VPC Peering // -// Creates a new read replica set for a service. This is an asynchronous operation. +// Creates a new VPC peering connection. This is an asynchronous operation. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets (the `CreateReplicaSet` operationId). -func (c *ClientWithResponses) CreateReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body CreateReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReplicaSetResponse, error) { - rsp, err := c.CreateReplicaSet(ctx, projectID, serviceID, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). +func (c *ClientWithResponses) CreateVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) { + rsp, err := c.CreateVPCPeering(ctx, projectID, vpcID, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateReplicaSetResponse(rsp) + return ParseCreateVPCPeeringResponse(rsp) } -// DeleteReplicaSetWithResponse Delete a Read Replica Set +// DeleteVPCPeeringWithResponse Delete a VPC Peering // -// Deletes a specific read replica set. This is an asynchronous operation. +// Deletes a specific VPC peering connection. This is an asynchronous operation. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with DELETE /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id} (the `DeleteReplicaSet` operationId). -func (c *ClientWithResponses) DeleteReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DeleteReplicaSetResponse, error) { - rsp, err := c.DeleteReplicaSet(ctx, projectID, serviceID, replicaSetID, reqEditors...) +// Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `DeleteVPCPeering` operationId). +func (c *ClientWithResponses) DeleteVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*DeleteVPCPeeringResponse, error) { + rsp, err := c.DeleteVPCPeering(ctx, projectID, vpcID, peeringID, reqEditors...) if err != nil { return nil, err } - return ParseDeleteReplicaSetResponse(rsp) + return ParseDeleteVPCPeeringResponse(rsp) } -// DisableReplicaPoolerWithResponse Disable Connection Pooler for a Read Replica +// GetVPCPeeringWithResponse Get a VPC Peering // -// Deactivates the connection pooler for a specific read replica set. +// Retrieves the details of a specific VPC peering connection. // // Returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/disablePooler (the `DisableReplicaPooler` operationId). -func (c *ClientWithResponses) DisableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*DisableReplicaPoolerResponse, error) { - rsp, err := c.DisableReplicaPooler(ctx, projectID, serviceID, replicaSetID, reqEditors...) +// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `GetVPCPeering` operationId). +func (c *ClientWithResponses) GetVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*GetVPCPeeringResponse, error) { + rsp, err := c.GetVPCPeering(ctx, projectID, vpcID, peeringID, reqEditors...) if err != nil { return nil, err } - return ParseDisableReplicaPoolerResponse(rsp) + return ParseGetVPCPeeringResponse(rsp) } -// EnableReplicaPoolerWithResponse Enable Connection Pooler for a Read Replica +// RenameVPCWithBodyWithResponse Rename a VPC // -// Activates the connection pooler for a specific read replica set. +// Updates the name of a specific VPC. // -// Returns a wrapper object for the known response body format(s). +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/enablePooler (the `EnableReplicaPooler` operationId). -func (c *ClientWithResponses) EnableReplicaPoolerWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, reqEditors ...RequestEditorFn) (*EnableReplicaPoolerResponse, error) { - rsp, err := c.EnableReplicaPooler(ctx, projectID, serviceID, replicaSetID, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). +func (c *ClientWithResponses) RenameVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) { + rsp, err := c.RenameVPCWithBody(ctx, projectID, vpcID, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseEnableReplicaPoolerResponse(rsp) + return ParseRenameVPCResponse(rsp) } -// ResizeReplicaSetWithBodyWithResponse Resize a Read Replica Set +// RenameVPCWithResponse Rename a VPC // -// Changes the resource allocation for a specific read replica set. +// Updates the name of a specific VPC. // -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). -func (c *ClientWithResponses) ResizeReplicaSetWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) { - rsp, err := c.ResizeReplicaSetWithBody(ctx, projectID, serviceID, replicaSetID, contentType, body, reqEditors...) +// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). +func (c *ClientWithResponses) RenameVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) { + rsp, err := c.RenameVPC(ctx, projectID, vpcID, body, reqEditors...) if err != nil { return nil, err } - return ParseResizeReplicaSetResponse(rsp) + return ParseRenameVPCResponse(rsp) } -// ResizeReplicaSetWithResponse Resize a Read Replica Set -// -// Changes the resource allocation for a specific read replica set. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/resize (the `ResizeReplicaSet` operationId). -func (c *ClientWithResponses) ResizeReplicaSetWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body ResizeReplicaSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeReplicaSetResponse, error) { - rsp, err := c.ResizeReplicaSet(ctx, projectID, serviceID, replicaSetID, body, reqEditors...) +// ParseIdentifyUserResponse parses an HTTP response from a IdentifyUserWithResponse call +func ParseIdentifyUserResponse(rsp *http.Response) (*IdentifyUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseResizeReplicaSetResponse(rsp) + + response := &IdentifyUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyticsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + + } + + return response, nil } -// SetReplicaEnvironmentWithBodyWithResponse Set Environment for a Read Replica -// -// Sets the environment type for the read replica set. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). -func (c *ClientWithResponses) SetReplicaEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) { - rsp, err := c.SetReplicaEnvironmentWithBody(ctx, projectID, serviceID, replicaSetID, contentType, body, reqEditors...) +// ParseTrackEventResponse parses an HTTP response from a TrackEventWithResponse call +func ParseTrackEventResponse(rsp *http.Response) (*TrackEventResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSetReplicaEnvironmentResponse(rsp) + + response := &TrackEventResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyticsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + + } + + return response, nil } -// SetReplicaEnvironmentWithResponse Set Environment for a Read Replica -// -// Sets the environment type for the read replica set. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment (the `SetReplicaEnvironment` operationId). -func (c *ClientWithResponses) SetReplicaEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, replicaSetID ReplicaSetID, body SetReplicaEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetReplicaEnvironmentResponse, error) { - rsp, err := c.SetReplicaEnvironment(ctx, projectID, serviceID, replicaSetID, body, reqEditors...) +// ParseGetAuthInfoResponse parses an HTTP response from a GetAuthInfoWithResponse call +func ParseGetAuthInfoResponse(rsp *http.Response) (*GetAuthInfoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSetReplicaEnvironmentResponse(rsp) -} -// ResizeServiceWithBodyWithResponse Resize a Service -// -// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). -func (c *ClientWithResponses) ResizeServiceWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) { - rsp, err := c.ResizeServiceWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &GetAuthInfoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseResizeServiceResponse(rsp) -} -// ResizeServiceWithResponse Resize a Service -// -// Changes the CPU and memory allocation for a specific service within a project. This is an asynchronous operation. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/resize (the `ResizeService` operationId). -func (c *ClientWithResponses) ResizeServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body ResizeServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ResizeServiceResponse, error) { - rsp, err := c.ResizeService(ctx, projectID, serviceID, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AuthInfo + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseResizeServiceResponse(rsp) + + return response, nil } -// SetEnvironmentWithBodyWithResponse Set Environment for a Service -// -// Sets the environment type for the service. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). -func (c *ClientWithResponses) SetEnvironmentWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) { - rsp, err := c.SetEnvironmentWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// ParseLogoutResponse parses an HTTP response from a LogoutWithResponse call +func ParseLogoutResponse(rsp *http.Response) (*LogoutResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSetEnvironmentResponse(rsp) -} -// SetEnvironmentWithResponse Set Environment for a Service -// -// Sets the environment type for the service. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/setEnvironment (the `SetEnvironment` operationId). -func (c *ClientWithResponses) SetEnvironmentWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvironmentResponse, error) { - rsp, err := c.SetEnvironment(ctx, projectID, serviceID, body, reqEditors...) - if err != nil { - return nil, err + response := &LogoutResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseSetEnvironmentResponse(rsp) -} -// SetHAReplicaWithBodyWithResponse Change HA configuration for a Service -// -// Changes the HA configuration for a specific service. This is an asynchronous operation. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). -func (c *ClientWithResponses) SetHAReplicaWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) { - rsp, err := c.SetHAReplicaWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case rsp.StatusCode == 204: + break // No content-type + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseSetHAReplicaResponse(rsp) + + return response, nil } -// SetHAReplicaWithResponse Change HA configuration for a Service -// -// Changes the HA configuration for a specific service. This is an asynchronous operation. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/setHA (the `SetHAReplica` operationId). -func (c *ClientWithResponses) SetHAReplicaWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body SetHAReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*SetHAReplicaResponse, error) { - rsp, err := c.SetHAReplica(ctx, projectID, serviceID, body, reqEditors...) +// ParseSubmitFeedbackResponse parses an HTTP response from a SubmitFeedbackWithResponse call +func ParseSubmitFeedbackResponse(rsp *http.Response) (*SubmitFeedbackResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseSetHAReplicaResponse(rsp) -} -// StartServiceWithResponse Start a Service -// -// Starts a stopped service within a project. This is an asynchronous operation. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/start (the `StartService` operationId). -func (c *ClientWithResponses) StartServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StartServiceResponse, error) { - rsp, err := c.StartService(ctx, projectID, serviceID, reqEditors...) - if err != nil { - return nil, err + response := &SubmitFeedbackResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseStartServiceResponse(rsp) -} -// StopServiceWithResponse Stop a Service -// -// Stops a running service within a project. This is an asynchronous operation. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/stop (the `StopService` operationId). -func (c *ClientWithResponses) StopServiceWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, reqEditors ...RequestEditorFn) (*StopServiceResponse, error) { - rsp, err := c.StopService(ctx, projectID, serviceID, reqEditors...) - if err != nil { - return nil, err + switch { + case rsp.StatusCode == 204: + break // No content-type + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseStopServiceResponse(rsp) + + return response, nil } -// UpdatePasswordWithBodyWithResponse Update Service Password -// -// Sets a new master password for the service within a project. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). -func (c *ClientWithResponses) UpdatePasswordWithBodyWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) { - rsp, err := c.UpdatePasswordWithBody(ctx, projectID, serviceID, contentType, body, reqEditors...) +// ParseGetProjectsResponse parses an HTTP response from a GetProjectsWithResponse call +func ParseGetProjectsResponse(rsp *http.Response) (*GetProjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdatePasswordResponse(rsp) -} -// UpdatePasswordWithResponse Update Service Password -// -// Sets a new master password for the service within a project. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/services/{service_id}/updatePassword (the `UpdatePassword` operationId). -func (c *ClientWithResponses) UpdatePasswordWithResponse(ctx context.Context, projectID ProjectID, serviceID ServiceID, body UpdatePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePasswordResponse, error) { - rsp, err := c.UpdatePassword(ctx, projectID, serviceID, body, reqEditors...) - if err != nil { - return nil, err + response := &GetProjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdatePasswordResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Project + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + + } + + return response, nil } -// GetVPCsWithResponse List All VPCs -// -// Retrieves a list of all Virtual Private Clouds (VPCs). -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /projects/{project_id}/vpcs (the `GetVPCs` operationId). -func (c *ClientWithResponses) GetVPCsWithResponse(ctx context.Context, projectID ProjectID, reqEditors ...RequestEditorFn) (*GetVPCsResponse, error) { - rsp, err := c.GetVPCs(ctx, projectID, reqEditors...) +// ParseGetAllowListsResponse parses an HTTP response from a GetAllowListsWithResponse call +func ParseGetAllowListsResponse(rsp *http.Response) (*GetAllowListsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetVPCsResponse(rsp) + + response := &GetAllowListsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []AllowList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + + } + + return response, nil } -// CreateVPCWithBodyWithResponse Create a VPC -// -// Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). -func (c *ClientWithResponses) CreateVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) { - rsp, err := c.CreateVPCWithBody(ctx, projectID, contentType, body, reqEditors...) +// ParseCreateAllowListResponse parses an HTTP response from a CreateAllowListWithResponse call +func ParseCreateAllowListResponse(rsp *http.Response) (*CreateAllowListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateVPCResponse(rsp) -} -// CreateVPCWithResponse Create a VPC -// -// Creates a new Virtual Private Cloud (VPC). This is an asynchronous operation. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs (the `CreateVPC` operationId). -func (c *ClientWithResponses) CreateVPCWithResponse(ctx context.Context, projectID ProjectID, body CreateVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCResponse, error) { - rsp, err := c.CreateVPC(ctx, projectID, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateAllowListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateVPCResponse(rsp) -} -// DeleteVPCWithResponse Delete a VPC -// -// Deletes a specific VPC. This is an asynchronous operation. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id} (the `DeleteVPC` operationId). -func (c *ClientWithResponses) DeleteVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*DeleteVPCResponse, error) { - rsp, err := c.DeleteVPC(ctx, projectID, vpcID, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AllowList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseDeleteVPCResponse(rsp) + + return response, nil } -// GetVPCWithResponse Get a VPC -// -// Retrieves the details of a specific VPC by its ID. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id} (the `GetVPC` operationId). -func (c *ClientWithResponses) GetVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCResponse, error) { - rsp, err := c.GetVPC(ctx, projectID, vpcID, reqEditors...) +// ParseDeleteAllowListResponse parses an HTTP response from a DeleteAllowListWithResponse call +func ParseDeleteAllowListResponse(rsp *http.Response) (*DeleteAllowListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetVPCResponse(rsp) -} -// GetVPCPeeringsWithResponse List VPC Peerings -// -// Retrieves a list of all VPC peering connections for a given VPC. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings (the `GetVPCPeerings` operationId). -func (c *ClientWithResponses) GetVPCPeeringsWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, reqEditors ...RequestEditorFn) (*GetVPCPeeringsResponse, error) { - rsp, err := c.GetVPCPeerings(ctx, projectID, vpcID, reqEditors...) - if err != nil { - return nil, err + response := &DeleteAllowListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetVPCPeeringsResponse(rsp) -} -// CreateVPCPeeringWithBodyWithResponse Create a VPC Peering -// -// Creates a new VPC peering connection. This is an asynchronous operation. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). -func (c *ClientWithResponses) CreateVPCPeeringWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) { - rsp, err := c.CreateVPCPeeringWithBody(ctx, projectID, vpcID, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case rsp.StatusCode == 204: + break // No content-type + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseCreateVPCPeeringResponse(rsp) + + return response, nil } -// CreateVPCPeeringWithResponse Create a VPC Peering -// -// Creates a new VPC peering connection. This is an asynchronous operation. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/peerings (the `CreateVPCPeering` operationId). -func (c *ClientWithResponses) CreateVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body CreateVPCPeeringJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVPCPeeringResponse, error) { - rsp, err := c.CreateVPCPeering(ctx, projectID, vpcID, body, reqEditors...) +// ParseGetAllowListResponse parses an HTTP response from a GetAllowListWithResponse call +func ParseGetAllowListResponse(rsp *http.Response) (*GetAllowListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateVPCPeeringResponse(rsp) -} -// DeleteVPCPeeringWithResponse Delete a VPC Peering -// -// Deletes a specific VPC peering connection. This is an asynchronous operation. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `DeleteVPCPeering` operationId). -func (c *ClientWithResponses) DeleteVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*DeleteVPCPeeringResponse, error) { - rsp, err := c.DeleteVPCPeering(ctx, projectID, vpcID, peeringID, reqEditors...) - if err != nil { - return nil, err + response := &GetAllowListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseDeleteVPCPeeringResponse(rsp) -} -// GetVPCPeeringWithResponse Get a VPC Peering -// -// Retrieves the details of a specific VPC peering connection. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id} (the `GetVPCPeering` operationId). -func (c *ClientWithResponses) GetVPCPeeringWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, peeringID PeeringID, reqEditors ...RequestEditorFn) (*GetVPCPeeringResponse, error) { - rsp, err := c.GetVPCPeering(ctx, projectID, vpcID, peeringID, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AllowList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + } - return ParseGetVPCPeeringResponse(rsp) + + return response, nil } -// RenameVPCWithBodyWithResponse Rename a VPC -// -// Updates the name of a specific VPC. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). -func (c *ClientWithResponses) RenameVPCWithBodyWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) { - rsp, err := c.RenameVPCWithBody(ctx, projectID, vpcID, contentType, body, reqEditors...) +// ParseUpdateAllowListResponse parses an HTTP response from a UpdateAllowListWithResponse call +func ParseUpdateAllowListResponse(rsp *http.Response) (*UpdateAllowListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseRenameVPCResponse(rsp) -} -// RenameVPCWithResponse Rename a VPC -// -// Updates the name of a specific VPC. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /projects/{project_id}/vpcs/{vpc_id}/rename (the `RenameVPC` operationId). -func (c *ClientWithResponses) RenameVPCWithResponse(ctx context.Context, projectID ProjectID, vpcID VPCId, body RenameVPCJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameVPCResponse, error) { - rsp, err := c.RenameVPC(ctx, projectID, vpcID, body, reqEditors...) - if err != nil { - return nil, err + response := &UpdateAllowListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseRenameVPCResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AllowList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: + var dest ClientError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON4XX = &dest + + } + + return response, nil } -// ParseIdentifyUserResponse parses an HTTP response from a IdentifyUserWithResponse call -func ParseIdentifyUserResponse(rsp *http.Response) (*IdentifyUserResponse, error) { +// ParseGetProjectBranchesResponse parses an HTTP response from a GetProjectBranchesWithResponse call +func ParseGetProjectBranchesResponse(rsp *http.Response) (*GetProjectBranchesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &IdentifyUserResponse{ + response := &GetProjectBranchesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AnalyticsResponse + var dest []Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11685,22 +14058,22 @@ func ParseIdentifyUserResponse(rsp *http.Response) (*IdentifyUserResponse, error return response, nil } -// ParseTrackEventResponse parses an HTTP response from a TrackEventWithResponse call -func ParseTrackEventResponse(rsp *http.Response) (*TrackEventResponse, error) { +// ParseGetExportersResponse parses an HTTP response from a GetExportersWithResponse call +func ParseGetExportersResponse(rsp *http.Response) (*GetExportersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &TrackEventResponse{ + response := &GetExportersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AnalyticsResponse + var dest []Exporter if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11718,26 +14091,26 @@ func ParseTrackEventResponse(rsp *http.Response) (*TrackEventResponse, error) { return response, nil } -// ParseGetAuthInfoResponse parses an HTTP response from a GetAuthInfoWithResponse call -func ParseGetAuthInfoResponse(rsp *http.Response) (*GetAuthInfoResponse, error) { +// ParseCreateExporterResponse parses an HTTP response from a CreateExporterWithResponse call +func ParseCreateExporterResponse(rsp *http.Response) (*CreateExporterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAuthInfoResponse{ + response := &CreateExporterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AuthInfo + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Exporter if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -11751,15 +14124,15 @@ func ParseGetAuthInfoResponse(rsp *http.Response) (*GetAuthInfoResponse, error) return response, nil } -// ParseLogoutResponse parses an HTTP response from a LogoutWithResponse call -func ParseLogoutResponse(rsp *http.Response) (*LogoutResponse, error) { +// ParseDeleteExporterResponse parses an HTTP response from a DeleteExporterWithResponse call +func ParseDeleteExporterResponse(rsp *http.Response) (*DeleteExporterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &LogoutResponse{ + response := &DeleteExporterResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -11780,22 +14153,26 @@ func ParseLogoutResponse(rsp *http.Response) (*LogoutResponse, error) { return response, nil } -// ParseSubmitFeedbackResponse parses an HTTP response from a SubmitFeedbackWithResponse call -func ParseSubmitFeedbackResponse(rsp *http.Response) (*SubmitFeedbackResponse, error) { +// ParseGetExporterResponse parses an HTTP response from a GetExporterWithResponse call +func ParseGetExporterResponse(rsp *http.Response) (*GetExporterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SubmitFeedbackResponse{ + response := &GetExporterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 204: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Exporter + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -11809,22 +14186,22 @@ func ParseSubmitFeedbackResponse(rsp *http.Response) (*SubmitFeedbackResponse, e return response, nil } -// ParseGetProjectsResponse parses an HTTP response from a GetProjectsWithResponse call -func ParseGetProjectsResponse(rsp *http.Response) (*GetProjectsResponse, error) { +// ParseUpdateExporterResponse parses an HTTP response from a UpdateExporterWithResponse call +func ParseUpdateExporterResponse(rsp *http.Response) (*UpdateExporterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetProjectsResponse{ + response := &UpdateExporterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Project + var dest Exporter if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11842,22 +14219,22 @@ func ParseGetProjectsResponse(rsp *http.Response) (*GetProjectsResponse, error) return response, nil } -// ParseGetAllowListsResponse parses an HTTP response from a GetAllowListsWithResponse call -func ParseGetAllowListsResponse(rsp *http.Response) (*GetAllowListsResponse, error) { +// ParseResolveRefResponse parses an HTTP response from a ResolveRefWithResponse call +func ParseResolveRefResponse(rsp *http.Response) (*ResolveRefResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAllowListsResponse{ + response := &ResolveRefResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []AllowList + var dest ResolveResult if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11875,26 +14252,26 @@ func ParseGetAllowListsResponse(rsp *http.Response) (*GetAllowListsResponse, err return response, nil } -// ParseCreateAllowListResponse parses an HTTP response from a CreateAllowListWithResponse call -func ParseCreateAllowListResponse(rsp *http.Response) (*CreateAllowListResponse, error) { +// ParseGetServicesResponse parses an HTTP response from a GetServicesWithResponse call +func ParseGetServicesResponse(rsp *http.Response) (*GetServicesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAllowListResponse{ + response := &GetServicesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest AllowList + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Service if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -11908,22 +14285,26 @@ func ParseCreateAllowListResponse(rsp *http.Response) (*CreateAllowListResponse, return response, nil } -// ParseDeleteAllowListResponse parses an HTTP response from a DeleteAllowListWithResponse call -func ParseDeleteAllowListResponse(rsp *http.Response) (*DeleteAllowListResponse, error) { +// ParseCreateServiceResponse parses an HTTP response from a CreateServiceWithResponse call +func ParseCreateServiceResponse(rsp *http.Response) (*CreateServiceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAllowListResponse{ + response := &CreateServiceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 204: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Service + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -11937,26 +14318,22 @@ func ParseDeleteAllowListResponse(rsp *http.Response) (*DeleteAllowListResponse, return response, nil } -// ParseGetAllowListResponse parses an HTTP response from a GetAllowListWithResponse call -func ParseGetAllowListResponse(rsp *http.Response) (*GetAllowListResponse, error) { +// ParseDeleteServiceResponse parses an HTTP response from a DeleteServiceWithResponse call +func ParseDeleteServiceResponse(rsp *http.Response) (*DeleteServiceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAllowListResponse{ + response := &DeleteServiceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AllowList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + case rsp.StatusCode == 202: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -11970,22 +14347,22 @@ func ParseGetAllowListResponse(rsp *http.Response) (*GetAllowListResponse, error return response, nil } -// ParseUpdateAllowListResponse parses an HTTP response from a UpdateAllowListWithResponse call -func ParseUpdateAllowListResponse(rsp *http.Response) (*UpdateAllowListResponse, error) { +// ParseGetServiceResponse parses an HTTP response from a GetServiceWithResponse call +func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAllowListResponse{ + response := &GetServiceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AllowList + var dest Service if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12003,26 +14380,26 @@ func ParseUpdateAllowListResponse(rsp *http.Response) (*UpdateAllowListResponse, return response, nil } -// ParseGetExportersResponse parses an HTTP response from a GetExportersWithResponse call -func ParseGetExportersResponse(rsp *http.Response) (*GetExportersResponse, error) { +// ParseAttachServiceToAllowListResponse parses an HTTP response from a AttachServiceToAllowListWithResponse call +func ParseAttachServiceToAllowListResponse(rsp *http.Response) (*AttachServiceToAllowListResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetExportersResponse{ + response := &AttachServiceToAllowListResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Exporter + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Service if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12036,26 +14413,26 @@ func ParseGetExportersResponse(rsp *http.Response) (*GetExportersResponse, error return response, nil } -// ParseCreateExporterResponse parses an HTTP response from a CreateExporterWithResponse call -func ParseCreateExporterResponse(rsp *http.Response) (*CreateExporterResponse, error) { +// ParseAttachServiceToExporterResponse parses an HTTP response from a AttachServiceToExporterWithResponse call +func ParseAttachServiceToExporterResponse(rsp *http.Response) (*AttachServiceToExporterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateExporterResponse{ + response := &AttachServiceToExporterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Exporter + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Service if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12069,22 +14446,26 @@ func ParseCreateExporterResponse(rsp *http.Response) (*CreateExporterResponse, e return response, nil } -// ParseDeleteExporterResponse parses an HTTP response from a DeleteExporterWithResponse call -func ParseDeleteExporterResponse(rsp *http.Response) (*DeleteExporterResponse, error) { +// ParseAttachServiceToVPCResponse parses an HTTP response from a AttachServiceToVPCWithResponse call +func ParseAttachServiceToVPCResponse(rsp *http.Response) (*AttachServiceToVPCResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteExporterResponse{ + response := &AttachServiceToVPCResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 204: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest SuccessMessage + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12098,22 +14479,22 @@ func ParseDeleteExporterResponse(rsp *http.Response) (*DeleteExporterResponse, e return response, nil } -// ParseGetExporterResponse parses an HTTP response from a GetExporterWithResponse call -func ParseGetExporterResponse(rsp *http.Response) (*GetExporterResponse, error) { +// ParseGetBackupRegionsResponse parses an HTTP response from a GetBackupRegionsWithResponse call +func ParseGetBackupRegionsResponse(rsp *http.Response) (*GetBackupRegionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetExporterResponse{ + response := &GetBackupRegionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Exporter + var dest []BackupRegion if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12131,26 +14512,26 @@ func ParseGetExporterResponse(rsp *http.Response) (*GetExporterResponse, error) return response, nil } -// ParseUpdateExporterResponse parses an HTTP response from a UpdateExporterWithResponse call -func ParseUpdateExporterResponse(rsp *http.Response) (*UpdateExporterResponse, error) { +// ParseCreateBackupRegionResponse parses an HTTP response from a CreateBackupRegionWithResponse call +func ParseCreateBackupRegionResponse(rsp *http.Response) (*CreateBackupRegionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateExporterResponse{ + response := &CreateBackupRegionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Exporter + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest BackupRegion if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12164,26 +14545,22 @@ func ParseUpdateExporterResponse(rsp *http.Response) (*UpdateExporterResponse, e return response, nil } -// ParseGetServicesResponse parses an HTTP response from a GetServicesWithResponse call -func ParseGetServicesResponse(rsp *http.Response) (*GetServicesResponse, error) { +// ParseDeleteBackupRegionResponse parses an HTTP response from a DeleteBackupRegionWithResponse call +func ParseDeleteBackupRegionResponse(rsp *http.Response) (*DeleteBackupRegionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetServicesResponse{ + response := &DeleteBackupRegionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Service - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + case rsp.StatusCode == 204: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12197,26 +14574,26 @@ func ParseGetServicesResponse(rsp *http.Response) (*GetServicesResponse, error) return response, nil } -// ParseCreateServiceResponse parses an HTTP response from a CreateServiceWithResponse call -func ParseCreateServiceResponse(rsp *http.Response) (*CreateServiceResponse, error) { +// ParseGetBackupRetentionResponse parses an HTTP response from a GetBackupRetentionWithResponse call +func ParseGetBackupRetentionResponse(rsp *http.Response) (*GetBackupRetentionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateServiceResponse{ + response := &GetBackupRetentionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest Service + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BackupRetentionByTime if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12230,22 +14607,26 @@ func ParseCreateServiceResponse(rsp *http.Response) (*CreateServiceResponse, err return response, nil } -// ParseDeleteServiceResponse parses an HTTP response from a DeleteServiceWithResponse call -func ParseDeleteServiceResponse(rsp *http.Response) (*DeleteServiceResponse, error) { +// ParseSetBackupRetentionResponse parses an HTTP response from a SetBackupRetentionWithResponse call +func ParseSetBackupRetentionResponse(rsp *http.Response) (*SetBackupRetentionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteServiceResponse{ + response := &SetBackupRetentionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 202: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BackupRetentionByTime + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12259,22 +14640,22 @@ func ParseDeleteServiceResponse(rsp *http.Response) (*DeleteServiceResponse, err return response, nil } -// ParseGetServiceResponse parses an HTTP response from a GetServiceWithResponse call -func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error) { +// ParseGetBackupsResponse parses an HTTP response from a GetBackupsWithResponse call +func ParseGetBackupsResponse(rsp *http.Response) (*GetBackupsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetServiceResponse{ + response := &GetBackupsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Service + var dest []Backup if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12292,26 +14673,26 @@ func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error) { return response, nil } -// ParseAttachServiceToAllowListResponse parses an HTTP response from a AttachServiceToAllowListWithResponse call -func ParseAttachServiceToAllowListResponse(rsp *http.Response) (*AttachServiceToAllowListResponse, error) { +// ParseGetBranchesResponse parses an HTTP response from a GetBranchesWithResponse call +func ParseGetBranchesResponse(rsp *http.Response) (*GetBranchesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AttachServiceToAllowListResponse{ + response := &GetBranchesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest Service + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12325,22 +14706,22 @@ func ParseAttachServiceToAllowListResponse(rsp *http.Response) (*AttachServiceTo return response, nil } -// ParseAttachServiceToExporterResponse parses an HTTP response from a AttachServiceToExporterWithResponse call -func ParseAttachServiceToExporterResponse(rsp *http.Response) (*AttachServiceToExporterResponse, error) { +// ParseCreateBranchResponse parses an HTTP response from a CreateBranchWithResponse call +func ParseCreateBranchResponse(rsp *http.Response) (*CreateBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AttachServiceToExporterResponse{ + response := &CreateBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest Service + var dest Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12358,26 +14739,22 @@ func ParseAttachServiceToExporterResponse(rsp *http.Response) (*AttachServiceToE return response, nil } -// ParseAttachServiceToVPCResponse parses an HTTP response from a AttachServiceToVPCWithResponse call -func ParseAttachServiceToVPCResponse(rsp *http.Response) (*AttachServiceToVPCResponse, error) { +// ParseDeleteBranchResponse parses an HTTP response from a DeleteBranchWithResponse call +func ParseDeleteBranchResponse(rsp *http.Response) (*DeleteBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AttachServiceToVPCResponse{ + response := &DeleteBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest SuccessMessage - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest + case rsp.StatusCode == 202: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12391,22 +14768,22 @@ func ParseAttachServiceToVPCResponse(rsp *http.Response) (*AttachServiceToVPCRes return response, nil } -// ParseGetBackupRegionsResponse parses an HTTP response from a GetBackupRegionsWithResponse call -func ParseGetBackupRegionsResponse(rsp *http.Response) (*GetBackupRegionsResponse, error) { +// ParseGetBranchResponse parses an HTTP response from a GetBranchWithResponse call +func ParseGetBranchResponse(rsp *http.Response) (*GetBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetBackupRegionsResponse{ + response := &GetBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []BackupRegion + var dest Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12424,26 +14801,26 @@ func ParseGetBackupRegionsResponse(rsp *http.Response) (*GetBackupRegionsRespons return response, nil } -// ParseCreateBackupRegionResponse parses an HTTP response from a CreateBackupRegionWithResponse call -func ParseCreateBackupRegionResponse(rsp *http.Response) (*CreateBackupRegionResponse, error) { +// ParseRenameBranchResponse parses an HTTP response from a RenameBranchWithResponse call +func ParseRenameBranchResponse(rsp *http.Response) (*RenameBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateBackupRegionResponse{ + response := &RenameBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest BackupRegion + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12457,22 +14834,26 @@ func ParseCreateBackupRegionResponse(rsp *http.Response) (*CreateBackupRegionRes return response, nil } -// ParseDeleteBackupRegionResponse parses an HTTP response from a DeleteBackupRegionWithResponse call -func ParseDeleteBackupRegionResponse(rsp *http.Response) (*DeleteBackupRegionResponse, error) { +// ParseResizeBranchResponse parses an HTTP response from a ResizeBranchWithResponse call +func ParseResizeBranchResponse(rsp *http.Response) (*ResizeBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteBackupRegionResponse{ + response := &ResizeBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 204: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Branch + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12486,26 +14867,26 @@ func ParseDeleteBackupRegionResponse(rsp *http.Response) (*DeleteBackupRegionRes return response, nil } -// ParseGetBackupRetentionResponse parses an HTTP response from a GetBackupRetentionWithResponse call -func ParseGetBackupRetentionResponse(rsp *http.Response) (*GetBackupRetentionResponse, error) { +// ParseStartBranchResponse parses an HTTP response from a StartBranchWithResponse call +func ParseStartBranchResponse(rsp *http.Response) (*StartBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetBackupRetentionResponse{ + response := &StartBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupRetentionByTime + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12519,26 +14900,26 @@ func ParseGetBackupRetentionResponse(rsp *http.Response) (*GetBackupRetentionRes return response, nil } -// ParseSetBackupRetentionResponse parses an HTTP response from a SetBackupRetentionWithResponse call -func ParseSetBackupRetentionResponse(rsp *http.Response) (*SetBackupRetentionResponse, error) { +// ParseStopBranchResponse parses an HTTP response from a StopBranchWithResponse call +func ParseStopBranchResponse(rsp *http.Response) (*StopBranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SetBackupRetentionResponse{ + response := &StopBranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupRetentionByTime + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError @@ -12552,26 +14933,22 @@ func ParseSetBackupRetentionResponse(rsp *http.Response) (*SetBackupRetentionRes return response, nil } -// ParseGetBackupsResponse parses an HTTP response from a GetBackupsWithResponse call -func ParseGetBackupsResponse(rsp *http.Response) (*GetBackupsResponse, error) { +// ParseUpdateBranchPasswordResponse parses an HTTP response from a UpdateBranchPasswordWithResponse call +func ParseUpdateBranchPasswordResponse(rsp *http.Response) (*UpdateBranchPasswordResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetBackupsResponse{ + response := &UpdateBranchPasswordResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Backup - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + case rsp.StatusCode == 204: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode/100 == 4: var dest ClientError diff --git a/internal/api/mocks/mock_client.go b/internal/api/mocks/mock_client.go index e83869e0..f9e215f4 100644 --- a/internal/api/mocks/mock_client.go +++ b/internal/api/mocks/mock_client.go @@ -282,6 +282,46 @@ func (mr *MockClientInterfaceMockRecorder) CreateBackupRegionWithBody(ctx, proje return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBackupRegionWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreateBackupRegionWithBody), varargs...) } +// CreateBranch mocks base method. +func (m *MockClientInterface) CreateBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, body api.CreateBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateBranch indicates an expected call of CreateBranch. +func (mr *MockClientInterfaceMockRecorder) CreateBranch(ctx, projectID, serviceID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBranch", reflect.TypeOf((*MockClientInterface)(nil).CreateBranch), varargs...) +} + +// CreateBranchWithBody mocks base method. +func (m *MockClientInterface) CreateBranchWithBody(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateBranchWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateBranchWithBody indicates an expected call of CreateBranchWithBody. +func (mr *MockClientInterfaceMockRecorder) CreateBranchWithBody(ctx, projectID, serviceID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBranchWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreateBranchWithBody), varargs...) +} + // CreateExporter mocks base method. func (m *MockClientInterface) CreateExporter(ctx context.Context, projectID api.ProjectID, body api.CreateExporterJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -522,6 +562,26 @@ func (mr *MockClientInterfaceMockRecorder) DeleteBackupRegion(ctx, projectID, se return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBackupRegion", reflect.TypeOf((*MockClientInterface)(nil).DeleteBackupRegion), varargs...) } +// DeleteBranch mocks base method. +func (m *MockClientInterface) DeleteBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteBranch indicates an expected call of DeleteBranch. +func (mr *MockClientInterfaceMockRecorder) DeleteBranch(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBranch", reflect.TypeOf((*MockClientInterface)(nil).DeleteBranch), varargs...) +} + // DeleteExporter mocks base method. func (m *MockClientInterface) DeleteExporter(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1002,6 +1062,46 @@ func (mr *MockClientInterfaceMockRecorder) GetBackups(ctx, projectID, serviceID return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackups", reflect.TypeOf((*MockClientInterface)(nil).GetBackups), varargs...) } +// GetBranch mocks base method. +func (m *MockClientInterface) GetBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBranch indicates an expected call of GetBranch. +func (mr *MockClientInterfaceMockRecorder) GetBranch(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBranch", reflect.TypeOf((*MockClientInterface)(nil).GetBranch), varargs...) +} + +// GetBranches mocks base method. +func (m *MockClientInterface) GetBranches(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, params *api.GetBranchesParams, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetBranches", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBranches indicates an expected call of GetBranches. +func (mr *MockClientInterfaceMockRecorder) GetBranches(ctx, projectID, serviceID, params any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBranches", reflect.TypeOf((*MockClientInterface)(nil).GetBranches), varargs...) +} + // GetExporter mocks base method. func (m *MockClientInterface) GetExporter(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1042,6 +1142,26 @@ func (mr *MockClientInterfaceMockRecorder) GetExporters(ctx, projectID any, reqE return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExporters", reflect.TypeOf((*MockClientInterface)(nil).GetExporters), varargs...) } +// GetProjectBranches mocks base method. +func (m *MockClientInterface) GetProjectBranches(ctx context.Context, projectID api.ProjectID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetProjectBranches", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProjectBranches indicates an expected call of GetProjectBranches. +func (mr *MockClientInterfaceMockRecorder) GetProjectBranches(ctx, projectID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProjectBranches", reflect.TypeOf((*MockClientInterface)(nil).GetProjectBranches), varargs...) +} + // GetProjects mocks base method. func (m *MockClientInterface) GetProjects(ctx context.Context, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1382,6 +1502,46 @@ func (mr *MockClientInterfaceMockRecorder) LogoutWithBody(ctx, contentType, body return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogoutWithBody", reflect.TypeOf((*MockClientInterface)(nil).LogoutWithBody), varargs...) } +// RenameBranch mocks base method. +func (m *MockClientInterface) RenameBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.RenameBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RenameBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RenameBranch indicates an expected call of RenameBranch. +func (mr *MockClientInterfaceMockRecorder) RenameBranch(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameBranch", reflect.TypeOf((*MockClientInterface)(nil).RenameBranch), varargs...) +} + +// RenameBranchWithBody mocks base method. +func (m *MockClientInterface) RenameBranchWithBody(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RenameBranchWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RenameBranchWithBody indicates an expected call of RenameBranchWithBody. +func (mr *MockClientInterfaceMockRecorder) RenameBranchWithBody(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameBranchWithBody", reflect.TypeOf((*MockClientInterface)(nil).RenameBranchWithBody), varargs...) +} + // RenameService mocks base method. func (m *MockClientInterface) RenameService(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, body api.RenameServiceJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1462,6 +1622,46 @@ func (mr *MockClientInterfaceMockRecorder) RenameVPCWithBody(ctx, projectID, vpc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameVPCWithBody", reflect.TypeOf((*MockClientInterface)(nil).RenameVPCWithBody), varargs...) } +// ResizeBranch mocks base method. +func (m *MockClientInterface) ResizeBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.ResizeBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResizeBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResizeBranch indicates an expected call of ResizeBranch. +func (mr *MockClientInterfaceMockRecorder) ResizeBranch(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeBranch", reflect.TypeOf((*MockClientInterface)(nil).ResizeBranch), varargs...) +} + +// ResizeBranchWithBody mocks base method. +func (m *MockClientInterface) ResizeBranchWithBody(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResizeBranchWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResizeBranchWithBody indicates an expected call of ResizeBranchWithBody. +func (mr *MockClientInterfaceMockRecorder) ResizeBranchWithBody(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeBranchWithBody", reflect.TypeOf((*MockClientInterface)(nil).ResizeBranchWithBody), varargs...) +} + // ResizeReplicaSet mocks base method. func (m *MockClientInterface) ResizeReplicaSet(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, replicaSetID api.ReplicaSetID, body api.ResizeReplicaSetJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1542,6 +1742,26 @@ func (mr *MockClientInterfaceMockRecorder) ResizeServiceWithBody(ctx, projectID, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeServiceWithBody", reflect.TypeOf((*MockClientInterface)(nil).ResizeServiceWithBody), varargs...) } +// ResolveRef mocks base method. +func (m *MockClientInterface) ResolveRef(ctx context.Context, projectID api.ProjectID, params *api.ResolveRefParams, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResolveRef", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResolveRef indicates an expected call of ResolveRef. +func (mr *MockClientInterfaceMockRecorder) ResolveRef(ctx, projectID, params any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveRef", reflect.TypeOf((*MockClientInterface)(nil).ResolveRef), varargs...) +} + // SetBackupRetention mocks base method. func (m *MockClientInterface) SetBackupRetention(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, body api.SetBackupRetentionJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1702,6 +1922,26 @@ func (mr *MockClientInterfaceMockRecorder) SetReplicaEnvironmentWithBody(ctx, pr return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReplicaEnvironmentWithBody", reflect.TypeOf((*MockClientInterface)(nil).SetReplicaEnvironmentWithBody), varargs...) } +// StartBranch mocks base method. +func (m *MockClientInterface) StartBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StartBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StartBranch indicates an expected call of StartBranch. +func (mr *MockClientInterfaceMockRecorder) StartBranch(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartBranch", reflect.TypeOf((*MockClientInterface)(nil).StartBranch), varargs...) +} + // StartService mocks base method. func (m *MockClientInterface) StartService(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1722,6 +1962,26 @@ func (mr *MockClientInterfaceMockRecorder) StartService(ctx, projectID, serviceI return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartService", reflect.TypeOf((*MockClientInterface)(nil).StartService), varargs...) } +// StopBranch mocks base method. +func (m *MockClientInterface) StopBranch(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StopBranch", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StopBranch indicates an expected call of StopBranch. +func (mr *MockClientInterfaceMockRecorder) StopBranch(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StopBranch", reflect.TypeOf((*MockClientInterface)(nil).StopBranch), varargs...) +} + // StopService mocks base method. func (m *MockClientInterface) StopService(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1862,6 +2122,46 @@ func (mr *MockClientInterfaceMockRecorder) UpdateAllowListWithBody(ctx, projectI return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAllowListWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateAllowListWithBody), varargs...) } +// UpdateBranchPassword mocks base method. +func (m *MockClientInterface) UpdateBranchPassword(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.UpdateBranchPasswordJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateBranchPassword", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBranchPassword indicates an expected call of UpdateBranchPassword. +func (mr *MockClientInterfaceMockRecorder) UpdateBranchPassword(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBranchPassword", reflect.TypeOf((*MockClientInterface)(nil).UpdateBranchPassword), varargs...) +} + +// UpdateBranchPasswordWithBody mocks base method. +func (m *MockClientInterface) UpdateBranchPasswordWithBody(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateBranchPasswordWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBranchPasswordWithBody indicates an expected call of UpdateBranchPasswordWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateBranchPasswordWithBody(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBranchPasswordWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateBranchPasswordWithBody), varargs...) +} + // UpdateExporter mocks base method. func (m *MockClientInterface) UpdateExporter(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, body api.UpdateExporterJSONRequestBody, reqEditors ...api.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -2166,6 +2466,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateBackupRegionWithRe return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBackupRegionWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateBackupRegionWithResponse), varargs...) } +// CreateBranchWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateBranchWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.CreateBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateBranchWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*api.CreateBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateBranchWithBodyWithResponse indicates an expected call of CreateBranchWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateBranchWithBodyWithResponse(ctx, projectID, serviceID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBranchWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateBranchWithBodyWithResponse), varargs...) +} + +// CreateBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, body api.CreateBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*api.CreateBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.CreateBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateBranchWithResponse indicates an expected call of CreateBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateBranchWithResponse(ctx, projectID, serviceID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateBranchWithResponse), varargs...) +} + // CreateExporterWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) CreateExporterWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.CreateExporterResponse, error) { m.ctrl.T.Helper() @@ -2406,6 +2746,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) DeleteBackupRegionWithRe return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBackupRegionWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeleteBackupRegionWithResponse), varargs...) } +// DeleteBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeleteBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*api.DeleteBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.DeleteBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteBranchWithResponse indicates an expected call of DeleteBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeleteBranchWithResponse(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeleteBranchWithResponse), varargs...) +} + // DeleteExporterWithResponse mocks base method. func (m *MockClientWithResponsesInterface) DeleteExporterWithResponse(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, reqEditors ...api.RequestEditorFn) (*api.DeleteExporterResponse, error) { m.ctrl.T.Helper() @@ -2886,6 +3246,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetBackupsWithResponse(c return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetBackupsWithResponse), varargs...) } +// GetBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*api.GetBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.GetBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBranchWithResponse indicates an expected call of GetBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetBranchWithResponse(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetBranchWithResponse), varargs...) +} + +// GetBranchesWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetBranchesWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, params *api.GetBranchesParams, reqEditors ...api.RequestEditorFn) (*api.GetBranchesResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetBranchesWithResponse", varargs...) + ret0, _ := ret[0].(*api.GetBranchesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBranchesWithResponse indicates an expected call of GetBranchesWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetBranchesWithResponse(ctx, projectID, serviceID, params any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBranchesWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetBranchesWithResponse), varargs...) +} + // GetExporterWithResponse mocks base method. func (m *MockClientWithResponsesInterface) GetExporterWithResponse(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, reqEditors ...api.RequestEditorFn) (*api.GetExporterResponse, error) { m.ctrl.T.Helper() @@ -2926,6 +3326,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetExportersWithResponse return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExportersWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetExportersWithResponse), varargs...) } +// GetProjectBranchesWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetProjectBranchesWithResponse(ctx context.Context, projectID api.ProjectID, reqEditors ...api.RequestEditorFn) (*api.GetProjectBranchesResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetProjectBranchesWithResponse", varargs...) + ret0, _ := ret[0].(*api.GetProjectBranchesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProjectBranchesWithResponse indicates an expected call of GetProjectBranchesWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetProjectBranchesWithResponse(ctx, projectID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProjectBranchesWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetProjectBranchesWithResponse), varargs...) +} + // GetProjectsWithResponse mocks base method. func (m *MockClientWithResponsesInterface) GetProjectsWithResponse(ctx context.Context, reqEditors ...api.RequestEditorFn) (*api.GetProjectsResponse, error) { m.ctrl.T.Helper() @@ -3266,6 +3686,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) LogoutWithResponse(ctx, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogoutWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).LogoutWithResponse), varargs...) } +// RenameBranchWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) RenameBranchWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.RenameBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RenameBranchWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*api.RenameBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RenameBranchWithBodyWithResponse indicates an expected call of RenameBranchWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) RenameBranchWithBodyWithResponse(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameBranchWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).RenameBranchWithBodyWithResponse), varargs...) +} + +// RenameBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) RenameBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.RenameBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*api.RenameBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RenameBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.RenameBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RenameBranchWithResponse indicates an expected call of RenameBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) RenameBranchWithResponse(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).RenameBranchWithResponse), varargs...) +} + // RenameServiceWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) RenameServiceWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.RenameServiceResponse, error) { m.ctrl.T.Helper() @@ -3346,6 +3806,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) RenameVPCWithResponse(ct return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenameVPCWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).RenameVPCWithResponse), varargs...) } +// ResizeBranchWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ResizeBranchWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.ResizeBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResizeBranchWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*api.ResizeBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResizeBranchWithBodyWithResponse indicates an expected call of ResizeBranchWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ResizeBranchWithBodyWithResponse(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeBranchWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ResizeBranchWithBodyWithResponse), varargs...) +} + +// ResizeBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ResizeBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.ResizeBranchJSONRequestBody, reqEditors ...api.RequestEditorFn) (*api.ResizeBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResizeBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.ResizeBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResizeBranchWithResponse indicates an expected call of ResizeBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ResizeBranchWithResponse(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ResizeBranchWithResponse), varargs...) +} + // ResizeReplicaSetWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) ResizeReplicaSetWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, replicaSetID api.ReplicaSetID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.ResizeReplicaSetResponse, error) { m.ctrl.T.Helper() @@ -3426,6 +3926,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ResizeServiceWithRespons return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResizeServiceWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ResizeServiceWithResponse), varargs...) } +// ResolveRefWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ResolveRefWithResponse(ctx context.Context, projectID api.ProjectID, params *api.ResolveRefParams, reqEditors ...api.RequestEditorFn) (*api.ResolveRefResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ResolveRefWithResponse", varargs...) + ret0, _ := ret[0].(*api.ResolveRefResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ResolveRefWithResponse indicates an expected call of ResolveRefWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ResolveRefWithResponse(ctx, projectID, params any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveRefWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ResolveRefWithResponse), varargs...) +} + // SetBackupRetentionWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) SetBackupRetentionWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.SetBackupRetentionResponse, error) { m.ctrl.T.Helper() @@ -3586,6 +4106,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) SetReplicaEnvironmentWit return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReplicaEnvironmentWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SetReplicaEnvironmentWithResponse), varargs...) } +// StartBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) StartBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*api.StartBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StartBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.StartBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StartBranchWithResponse indicates an expected call of StartBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) StartBranchWithResponse(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).StartBranchWithResponse), varargs...) +} + // StartServiceWithResponse mocks base method. func (m *MockClientWithResponsesInterface) StartServiceWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, reqEditors ...api.RequestEditorFn) (*api.StartServiceResponse, error) { m.ctrl.T.Helper() @@ -3606,6 +4146,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) StartServiceWithResponse return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartServiceWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).StartServiceWithResponse), varargs...) } +// StopBranchWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) StopBranchWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, reqEditors ...api.RequestEditorFn) (*api.StopBranchResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "StopBranchWithResponse", varargs...) + ret0, _ := ret[0].(*api.StopBranchResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StopBranchWithResponse indicates an expected call of StopBranchWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) StopBranchWithResponse(ctx, projectID, serviceID, branchID any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StopBranchWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).StopBranchWithResponse), varargs...) +} + // StopServiceWithResponse mocks base method. func (m *MockClientWithResponsesInterface) StopServiceWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, reqEditors ...api.RequestEditorFn) (*api.StopServiceResponse, error) { m.ctrl.T.Helper() @@ -3746,6 +4306,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateAllowListWithRespo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAllowListWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateAllowListWithResponse), varargs...) } +// UpdateBranchPasswordWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateBranchPasswordWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.UpdateBranchPasswordResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateBranchPasswordWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*api.UpdateBranchPasswordResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBranchPasswordWithBodyWithResponse indicates an expected call of UpdateBranchPasswordWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateBranchPasswordWithBodyWithResponse(ctx, projectID, serviceID, branchID, contentType, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBranchPasswordWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateBranchPasswordWithBodyWithResponse), varargs...) +} + +// UpdateBranchPasswordWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateBranchPasswordWithResponse(ctx context.Context, projectID api.ProjectID, serviceID api.ServiceID, branchID api.BranchID, body api.UpdateBranchPasswordJSONRequestBody, reqEditors ...api.RequestEditorFn) (*api.UpdateBranchPasswordResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, projectID, serviceID, branchID, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateBranchPasswordWithResponse", varargs...) + ret0, _ := ret[0].(*api.UpdateBranchPasswordResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBranchPasswordWithResponse indicates an expected call of UpdateBranchPasswordWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateBranchPasswordWithResponse(ctx, projectID, serviceID, branchID, body any, reqEditors ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, projectID, serviceID, branchID, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBranchPasswordWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateBranchPasswordWithResponse), varargs...) +} + // UpdateExporterWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) UpdateExporterWithBodyWithResponse(ctx context.Context, projectID api.ProjectID, exporterID api.ExporterID, contentType string, body io.Reader, reqEditors ...api.RequestEditorFn) (*api.UpdateExporterResponse, error) { m.ctrl.T.Helper() diff --git a/internal/api/types.go b/internal/api/types.go index bbf11842..5e5a253f 100644 --- a/internal/api/types.go +++ b/internal/api/types.go @@ -633,6 +633,99 @@ func (e ReadReplicaSetStatus) Valid() bool { } } +// Defines values for ResolveType. +const ( + ResolveTypeBRANCH ResolveType = "BRANCH" + ResolveTypeREADREPLICASET ResolveType = "READ_REPLICA_SET" + ResolveTypeSERVICE ResolveType = "SERVICE" +) + +// Valid indicates whether the value is a known member of the ResolveType enum. +func (e ResolveType) Valid() bool { + switch e { + case ResolveTypeBRANCH: + return true + case ResolveTypeREADREPLICASET: + return true + case ResolveTypeSERVICE: + return true + default: + return false + } +} + +// Defines values for ResolvedBranchType. +const ( + ResolvedBranchTypeBRANCH ResolvedBranchType = "BRANCH" +) + +// Valid indicates whether the value is a known member of the ResolvedBranchType enum. +func (e ResolvedBranchType) Valid() bool { + switch e { + case ResolvedBranchTypeBRANCH: + return true + default: + return false + } +} + +// Defines values for ResolvedReadReplicaSetStatus. +const ( + ResolvedReadReplicaSetStatusActive ResolvedReadReplicaSetStatus = "active" + ResolvedReadReplicaSetStatusCreating ResolvedReadReplicaSetStatus = "creating" + ResolvedReadReplicaSetStatusDeleting ResolvedReadReplicaSetStatus = "deleting" + ResolvedReadReplicaSetStatusError ResolvedReadReplicaSetStatus = "error" + ResolvedReadReplicaSetStatusResizing ResolvedReadReplicaSetStatus = "resizing" +) + +// Valid indicates whether the value is a known member of the ResolvedReadReplicaSetStatus enum. +func (e ResolvedReadReplicaSetStatus) Valid() bool { + switch e { + case ResolvedReadReplicaSetStatusActive: + return true + case ResolvedReadReplicaSetStatusCreating: + return true + case ResolvedReadReplicaSetStatusDeleting: + return true + case ResolvedReadReplicaSetStatusError: + return true + case ResolvedReadReplicaSetStatusResizing: + return true + default: + return false + } +} + +// Defines values for ResolvedReadReplicaSetType. +const ( + ResolvedReadReplicaSetTypeREADREPLICASET ResolvedReadReplicaSetType = "READ_REPLICA_SET" +) + +// Valid indicates whether the value is a known member of the ResolvedReadReplicaSetType enum. +func (e ResolvedReadReplicaSetType) Valid() bool { + switch e { + case ResolvedReadReplicaSetTypeREADREPLICASET: + return true + default: + return false + } +} + +// Defines values for ResolvedServiceType. +const ( + ResolvedServiceTypeSERVICE ResolvedServiceType = "SERVICE" +) + +// Valid indicates whether the value is a known member of the ResolvedServiceType enum. +func (e ResolvedServiceType) Valid() bool { + switch e { + case ResolvedServiceTypeSERVICE: + return true + default: + return false + } +} + // Defines values for ServiceCreateAddons. const ( ServiceCreateAddonsAi ServiceCreateAddons = "ai" @@ -1203,6 +1296,109 @@ type BackupRetentionByTimeType string // - `UNKNOWN`: a type this version of the API does not name. type BackupType string +// Branch A branch of a Fluid Service. +type Branch struct { + // CPUMillis CPU allocation in milli-cores. + // + // Example: 500 + CPUMillis int `json:"cpu_millis"` + + // Created Creation timestamp. + // + // Example: 2026-09-01T09:30:00Z + Created time.Time `json:"created"` + + // Endpoint A network endpoint for connecting to a service. + Endpoint *Endpoint `json:"endpoint,omitempty"` + + // ID The unique identifier for the branch. + // + // Example: br4nch1d9x + ID string `json:"id"` + + // InitialPassword The initial password for the branch. + // + // Example: a-very-secure-initial-password + InitialPassword *string `json:"initial_password,omitempty"` + + // Iops Provisioned IOPS for the storage volume. + // + // Example: 3000 + Iops *int `json:"iops,omitempty"` + + // MemoryGbs Memory allocation in gigabytes. + // + // Example: 4 + MemoryGbs int `json:"memory_gbs"` + + // Name The name of the branch. + // + // Example: my-production-db-pr-412 + Name string `json:"name"` + + // ProjectID The project this branch belongs to. + // + // Example: rp1pz7uyae + ProjectID string `json:"project_id"` + + // ServiceID The service this branch was created from. + // + // Example: 4rwj1h3fd0 + ServiceID string `json:"service_id"` + + // Status Current status of the branch. + Status DeployStatus `json:"status"` +} + +// BranchCreate Parameters for creating a branch of the service identified by `service_id` in the path. +type BranchCreate struct { + // CPUMillis The initial CPU allocation in milli-cores. Defaults to 250 if not provided. + // + // Example: 250 + CPUMillis *int `json:"cpu_millis,omitempty"` + + // Iops Requested provisioned IOPS for the branch's storage. + // + // Example: 4000 + Iops *int `json:"iops,omitempty"` + + // MemoryGbs The initial memory allocation in gigabytes. Defaults to 2 if not provided. + // + // Example: 2 + MemoryGbs *int `json:"memory_gbs,omitempty"` + + // Name A human-readable name for the branch. If not provided, defaults to "branch-", with "-1", "-2", ... appended if that name is already in use in the project. + // + // Example: my-production-db-pr-412 + Name *string `json:"name,omitempty"` +} + +// BranchRename Parameters for renaming a branch. +type BranchRename struct { + // Name The new name for the branch. + // + // Example: my-production-db-pr-412 + Name string `json:"name"` +} + +// BranchResizeInput At least one of cpu_millis, memory_gbs, or iops must be provided. cpu_millis and memory_gbs must be provided together. +type BranchResizeInput struct { + // CPUMillis The new CPU allocation in milli-cores. + // + // Example: 1000 + CPUMillis *string `json:"cpu_millis,omitempty"` + + // Iops The new provisioned IOPS for the branch's storage. + // + // Example: 4000 + Iops *int `json:"iops,omitempty"` + + // MemoryGbs The new memory allocation in gigabytes. + // + // Example: 4 + MemoryGbs *string `json:"memory_gbs,omitempty"` +} + // CloudWatchLogsConfig Where a CloudWatch logs exporter writes, and how it authenticates. type CloudWatchLogsConfig struct { // AwsRegion The AWS region the log group is in. Independent of the exporter's own @@ -2375,6 +2571,11 @@ type ReadReplicaSet struct { // Example: 2 Nodes int `json:"nodes"` + // ServiceID The ID of the parent service this read replica set was created from. + // + // Example: d1k5vk7hf2 + ServiceID string `json:"service_id"` + // Status The current status of the read replica set: // - creating: the replica set is being provisioned // - active: the replica set is provisioned and serving traffic @@ -2451,6 +2652,249 @@ type ResizeInput struct { MemoryGbs *string `json:"memory_gbs,omitempty"` } +// ResolveResult A service, branch, or read replica set resolved by ref. `type` determines which. +type ResolveResult struct { + union json.RawMessage +} + +// ResolveType What kind of resource a resolved ref is, or should be restricted to. +type ResolveType string + +// ResolvedBranch A Branch resolved by ref. +type ResolvedBranch struct { + // CPUMillis CPU allocation in milli-cores. + // + // Example: 500 + CPUMillis int `json:"cpu_millis"` + + // Created Creation timestamp. + // + // Example: 2026-09-01T09:30:00Z + Created time.Time `json:"created"` + + // Endpoint A network endpoint for connecting to a service. + Endpoint *Endpoint `json:"endpoint,omitempty"` + + // ID The unique identifier for the branch. + // + // Example: br4nch1d9x + ID string `json:"id"` + + // InitialPassword The initial password for the branch. + // + // Example: a-very-secure-initial-password + InitialPassword *string `json:"initial_password,omitempty"` + + // Iops Provisioned IOPS for the storage volume. + // + // Example: 3000 + Iops *int `json:"iops,omitempty"` + + // MemoryGbs Memory allocation in gigabytes. + // + // Example: 4 + MemoryGbs int `json:"memory_gbs"` + + // Name The name of the branch. + // + // Example: my-production-db-pr-412 + Name string `json:"name"` + + // ProjectID The project this branch belongs to. + // + // Example: rp1pz7uyae + ProjectID string `json:"project_id"` + + // ServiceID The service this branch was created from. + // + // Example: 4rwj1h3fd0 + ServiceID string `json:"service_id"` + + // Status Current status of the branch. + Status DeployStatus `json:"status"` + + // Type Always "BRANCH" for a resolved Branch. + Type ResolvedBranchType `json:"type"` +} + +// ResolvedBranchType Always "BRANCH" for a resolved Branch. +type ResolvedBranchType string + +// ResolvedReadReplicaSet A ReadReplicaSet resolved by ref. +type ResolvedReadReplicaSet struct { + // ConnectionPooler Connection pooler configuration for a service. + ConnectionPooler *ConnectionPooler `json:"connection_pooler,omitempty"` + + // CPUMillis CPU allocation in milli-cores. + // + // Example: 250 + CPUMillis int `json:"cpu_millis"` + + // Endpoint A network endpoint for connecting to a service. + Endpoint *Endpoint `json:"endpoint,omitempty"` + + // ID The unique identifier for the read replica set. + // + // Example: alb8jicdpr + ID string `json:"id"` + + // Iops Provisioned IOPS for the storage volume. + // + // Example: 3000 + Iops *int `json:"iops,omitempty"` + + // MemoryGbs Memory allocation in gigabytes. + // + // Example: 1 + MemoryGbs int `json:"memory_gbs"` + + // Metadata Additional metadata for the read replica set. + Metadata *ReplicaSetMetadata `json:"metadata,omitempty"` + + // Name The name of the read replica set. + // + // Example: reporting-replica-1 + Name string `json:"name"` + + // Nodes Number of nodes in the replica set. + // + // Example: 2 + Nodes int `json:"nodes"` + + // ServiceID The ID of the parent service this read replica set was created from. + // + // Example: d1k5vk7hf2 + ServiceID string `json:"service_id"` + + // Status The current status of the read replica set: + // - creating: the replica set is being provisioned + // - active: the replica set is provisioned and serving traffic + // - resizing: the replica set is being resized + // - deleting: the replica set is being deleted + // - error: the replica set is in an error state + // + // + // Example: active + Status ResolvedReadReplicaSetStatus `json:"status"` + + // Type Always "READ_REPLICA_SET" for a resolved ReadReplicaSet. + Type ResolvedReadReplicaSetType `json:"type"` +} + +// ResolvedReadReplicaSetStatus The current status of the read replica set: +// - creating: the replica set is being provisioned +// - active: the replica set is provisioned and serving traffic +// - resizing: the replica set is being resized +// - deleting: the replica set is being deleted +// - error: the replica set is in an error state +// +// Example: active +type ResolvedReadReplicaSetStatus string + +// ResolvedReadReplicaSetType Always "READ_REPLICA_SET" for a resolved ReadReplicaSet. +type ResolvedReadReplicaSetType string + +// ResolvedService A Service resolved by ref. +type ResolvedService struct { + // ConnectionPooler Connection pooler configuration for a service. + ConnectionPooler *ConnectionPooler `json:"connection_pooler,omitempty"` + + // Created Creation timestamp. + // + // Example: 2025-01-15T09:30:00Z + Created time.Time `json:"created"` + + // DataTiering Data tiering configuration for a service. + DataTiering *DataTiering `json:"data_tiering,omitempty"` + + // Endpoint A network endpoint for connecting to a service. + Endpoint *Endpoint `json:"endpoint,omitempty"` + + // ForkedFrom The service this service was forked from. + ForkedFrom *ForkSpec `json:"forked_from,omitempty"` + + // HaReplicas High-availability replica configuration for a service. + HaReplicas *HAReplica `json:"ha_replicas,omitempty"` + + // InitialPassword The initial password for the service. + // + // Example: a-very-secure-initial-password + InitialPassword *string `json:"initial_password,omitempty"` + + // LogExporterID The exporter this service sends its logs to. Absent when the + // service is not attached to a log exporter. Change it with the + // attach and detach operations. + // + // A newly attached log exporter only starts carrying logs once the + // service has restarted. + // + // + // Example: 9b2e4d61-7a30-4c58-8f0d-6e1a3c9b4d27 + LogExporterID *openapi_types.UUID `json:"log_exporter_id,omitempty"` + + // Metadata Additional metadata for the service. + Metadata *ServiceMetadata `json:"metadata,omitempty"` + + // MetricExporterID The exporter this service sends its metrics to. Absent when the + // service is not attached to a metric exporter. Change it with the + // attach and detach operations. + // + // + // Example: 3f7c1c9a-0d2e-4d76-9a1b-5c8e0f2a7b31 + MetricExporterID *openapi_types.UUID `json:"metric_exporter_id,omitempty"` + + // Metrics Resource usage metrics for the service. + Metrics *ServiceMetrics `json:"metrics,omitempty"` + + // Name The name of the service. + // + // Example: my-production-db + Name string `json:"name"` + + // Platform The storage platform the service runs on. + Platform *ServicePlatform `json:"platform,omitempty"` + + // ProjectID The project this service belongs to. + // + // Example: rp1pz7uyae + ProjectID string `json:"project_id"` + + // ReadReplicaSets The read replica sets attached to the service. + ReadReplicaSets *[]ReadReplicaSet `json:"read_replica_sets,omitempty"` + + // RegionCode The cloud region where the service is hosted. + // + // Example: us-east-1 + RegionCode string `json:"region_code"` + + // Resources List of resources allocated to the service. + Resources []Resource `json:"resources"` + + // ServiceID The unique identifier for the service. + // + // Example: kd9w2xp4mz + ServiceID string `json:"service_id"` + + // ServiceType The type of the service. + ServiceType ServiceType `json:"service_type"` + + // Status Current status of the service. + Status DeployStatus `json:"status"` + + // Type Always "SERVICE" for a resolved Service. + Type ResolvedServiceType `json:"type"` + + // VpcEndpointDeprecated Deprecated. Use `vpc_endpoint` instead. + // Deprecated: Use `vpc_endpoint` instead. + VpcEndpointDeprecated *VPCEndpoint `json:"vpcEndpoint,omitempty"` + + // VpcEndpoint VPC endpoint configuration if available. + VpcEndpoint *VPCEndpoint `json:"vpc_endpoint,omitempty"` +} + +// ResolvedServiceType Always "SERVICE" for a resolved Service. +type ResolvedServiceType string + // Resource A resource allocated to the service. type Resource struct { // ID Resource identifier. @@ -2881,6 +3325,9 @@ type AllowListID = string // BackupRegionCode Example: eu-central-1 type BackupRegionCode = string +// BranchID Example: br4nch1d9x +type BranchID = string + // ExporterID Example: 3f7c1c9a-0d2e-4d76-9a1b-5c8e0f2a7b31 type ExporterID = openapi_types.UUID @@ -2959,6 +3406,16 @@ type SubmitFeedbackJSONBody struct { // SubmitFeedbackJSONBodySource defines parameters for SubmitFeedback. type SubmitFeedbackJSONBodySource string +// ResolveRefParams defines parameters for ResolveRef. +type ResolveRefParams struct { + // Ref The ID or name to resolve, exactly and case-sensitively. A ref + // matching more than one resource is an error. + Ref string `form:"ref" json:"ref"` + + // Type Only match resources of this kind. + Type *ResolveType `form:"type,omitempty" json:"type,omitempty"` +} + // GetServicesParams defines parameters for GetServices. type GetServicesParams struct { // Ref Returns only the service this reference matches: one whose ID @@ -2971,6 +3428,15 @@ type GetServicesParams struct { Ref *string `form:"ref,omitempty" json:"ref,omitempty"` } +// GetBranchesParams defines parameters for GetBranches. +type GetBranchesParams struct { + // Ref Returns only the branch this reference matches: one whose ID + // equals it, or whose name equals it, exactly and case-sensitively, + // with no precedence between the two. A reference matching nothing + // returns an empty list. + Ref *string `form:"ref,omitempty" json:"ref,omitempty"` +} + // GetServiceLogsParams defines parameters for GetServiceLogs. type GetServiceLogsParams struct { // Node Specific service node to fetch logs from (for multi-node services). @@ -3037,6 +3503,18 @@ type CreateBackupRegionJSONRequestBody = BackupRegionCreate // SetBackupRetentionJSONRequestBody defines body for SetBackupRetention for application/json ContentType. type SetBackupRetentionJSONRequestBody = BackupRetentionByTime +// CreateBranchJSONRequestBody defines body for CreateBranch for application/json ContentType. +type CreateBranchJSONRequestBody = BranchCreate + +// RenameBranchJSONRequestBody defines body for RenameBranch for application/json ContentType. +type RenameBranchJSONRequestBody = BranchRename + +// ResizeBranchJSONRequestBody defines body for ResizeBranch for application/json ContentType. +type ResizeBranchJSONRequestBody = BranchResizeInput + +// UpdateBranchPasswordJSONRequestBody defines body for UpdateBranchPassword for application/json ContentType. +type UpdateBranchPasswordJSONRequestBody = UpdatePasswordInput + // DetachServiceFromAllowListJSONRequestBody defines body for DetachServiceFromAllowList for application/json ContentType. type DetachServiceFromAllowListJSONRequestBody = ServiceAllowListInput @@ -3913,3 +4391,140 @@ func (t *ExporterUpdate) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } + +// AsResolvedService returns the union data inside the ResolveResult as a ResolvedService +func (t ResolveResult) AsResolvedService() (ResolvedService, error) { + var body ResolvedService + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResolvedService overwrites any union data inside the ResolveResult as the provided ResolvedService +func (t *ResolveResult) FromResolvedService(v ResolvedService) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"SERVICE"}`)) + t.union = b + return err +} + +// MergeResolvedService performs a merge with any union data inside the ResolveResult, using the provided ResolvedService +func (t *ResolveResult) MergeResolvedService(v ResolvedService) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"SERVICE"}`)) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsResolvedBranch returns the union data inside the ResolveResult as a ResolvedBranch +func (t ResolveResult) AsResolvedBranch() (ResolvedBranch, error) { + var body ResolvedBranch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResolvedBranch overwrites any union data inside the ResolveResult as the provided ResolvedBranch +func (t *ResolveResult) FromResolvedBranch(v ResolvedBranch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"BRANCH"}`)) + t.union = b + return err +} + +// MergeResolvedBranch performs a merge with any union data inside the ResolveResult, using the provided ResolvedBranch +func (t *ResolveResult) MergeResolvedBranch(v ResolvedBranch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"BRANCH"}`)) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsResolvedReadReplicaSet returns the union data inside the ResolveResult as a ResolvedReadReplicaSet +func (t ResolveResult) AsResolvedReadReplicaSet() (ResolvedReadReplicaSet, error) { + var body ResolvedReadReplicaSet + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResolvedReadReplicaSet overwrites any union data inside the ResolveResult as the provided ResolvedReadReplicaSet +func (t *ResolveResult) FromResolvedReadReplicaSet(v ResolvedReadReplicaSet) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"READ_REPLICA_SET"}`)) + t.union = b + return err +} + +// MergeResolvedReadReplicaSet performs a merge with any union data inside the ResolveResult, using the provided ResolvedReadReplicaSet +func (t *ResolveResult) MergeResolvedReadReplicaSet(v ResolvedReadReplicaSet) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"type":"READ_REPLICA_SET"}`)) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ResolveResult) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"type"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t ResolveResult) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "BRANCH": + return t.AsResolvedBranch() + case "READ_REPLICA_SET": + return t.AsResolvedReadReplicaSet() + case "SERVICE": + return t.AsResolvedService() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + +func (t ResolveResult) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ResolveResult) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} diff --git a/internal/cmd/auth_status.go b/internal/cmd/auth_status.go index 3e6414d8..009a2132 100644 --- a/internal/cmd/auth_status.go +++ b/internal/cmd/auth_status.go @@ -72,11 +72,11 @@ func outputAuthInfo(cmd *cobra.Command, authInfo api.AuthInfo, format string) er case "yaml": return util.SerializeToYAML(outputWriter, authInfo) default: // table format (default) - return outputAuthInfoTable(authInfo, outputWriter) + return outputAuthInfoTable(outputWriter, authInfo) } } -func outputAuthInfoTable(authInfo api.AuthInfo, output io.Writer) error { +func outputAuthInfoTable(output io.Writer, authInfo api.AuthInfo) error { table := tablewriter.NewWriter(output) table.Header("PROPERTY", "VALUE") table.Append("Status", "Logged in") diff --git a/internal/cmd/db.go b/internal/cmd/db.go index f3602629..523a2929 100644 --- a/internal/cmd/db.go +++ b/internal/cmd/db.go @@ -36,13 +36,13 @@ func buildDbCmd(app *common.App) *cobra.Command { func handleDatabaseError(err error, target *common.ConnectionTarget) error { switch { case errors.Is(err, common.ErrPaused): - return fmt.Errorf("%w — start it with 'tiger service start %s'", common.ErrPaused, target.ConnectionService.ServiceID) + return fmt.Errorf("%w — start it with 'tiger service start %s'", common.ErrPaused, target.ID) case errors.Is(err, common.ErrNotReady): - return fmt.Errorf("%w — check its status with 'tiger service get %s' and try again", common.ErrNotReady, target.ConnectionService.ServiceID) + return fmt.Errorf("%w — check its status with 'tiger service get %s' and try again", common.ErrNotReady, target.ID) case isPostgresAuthenticationError(err): // A read replica shares its primary's credentials, so the password - // belongs to the credential service rather than the one connected to. - serviceID := target.CredentialService.ServiceID + // belongs to the primary rather than the replica connected to. + serviceID := target.Credentials.ID return fmt.Errorf("%w\n\nThe stored password is missing or invalid. Save the current one with 'tiger db save-password %s', or reset it with 'tiger service update-password %s'", err, serviceID, serviceID) } diff --git a/internal/cmd/db_create_role.go b/internal/cmd/db_create_role.go index 132a4836..81264a8c 100644 --- a/internal/cmd/db_create_role.go +++ b/internal/cmd/db_create_role.go @@ -118,7 +118,7 @@ PostgreSQL Configuration Parameters That May Be Set: } // Build connection string - details, err := common.GetConnectionDetails(cfg, *service, common.ConnectionDetailsOptions{ + details, err := common.GetConnectionDetails(cfg, common.NewServiceConnectionTarget(*service), common.ConnectionDetailsOptions{ Pooled: false, Role: "tsdbadmin", // Use admin role to create new roles WithPassword: true, @@ -143,7 +143,7 @@ PostgreSQL Configuration Parameters That May Be Set: } // Save password to storage with the new role name - result, err := common.SavePasswordWithResult(cfg, *service, rolePassword, name) + result, err := common.SavePasswordWithResult(cfg, common.ServicePasswordTarget(*service), rolePassword, name) if err != nil { cmd.PrintErrf("Warning: %s\n", result.Message) } else if !result.Success { diff --git a/internal/cmd/db_create_role_test.go b/internal/cmd/db_create_role_test.go index f0921cf7..e8046ccc 100644 --- a/internal/cmd/db_create_role_test.go +++ b/internal/cmd/db_create_role_test.go @@ -124,6 +124,17 @@ func TestDbCreateRoleCmd(t *testing.T) { }, wantErr: "'rep-67890' is a read replica; create the role on its primary service 'svc-12345' instead", }, + { + // With no --password or TIGER_NEW_PASSWORD, the password is + // generated before connecting. + name: "password generation fails", + args: []string{"db", "create", "role", "svc-12345", "--name", "ai_analyst"}, + opts: []runOption{withGenerateSecurePassword(32, "", errors.New("entropy unavailable"))}, + mock: func(m *mocks.MockClientWithResponsesInterface) { + expectResolveRef(m, "svc-12345", sampleService()) + }, + wantErr: "failed to determine password: entropy unavailable", + }, { name: "endpoint not available", args: []string{"db", "create", "role", "svc-12345", "--name", "ai_analyst"}, diff --git a/internal/cmd/db_extensions_list_test.go b/internal/cmd/db_extensions_list_test.go index 7dec07fb..f95f726e 100644 --- a/internal/cmd/db_extensions_list_test.go +++ b/internal/cmd/db_extensions_list_test.go @@ -50,9 +50,12 @@ func TestDbExtensionsListCmd(t *testing.T) { {Name: "vector", Version: "0.8.0", Schema: "public"}, } primary := sampleService() - primaryTarget := &common.ConnectionTarget{ConnectionService: primary, CredentialService: primary} + primaryTarget := common.NewServiceConnectionTarget(primary) replica := sampleReplica() - replicaTarget := &common.ConnectionTarget{ConnectionService: replica, CredentialService: primary, IsReplica: true} + // A replica connects to its own endpoint with its primary's credentials. + replicaTarget := common.NewServiceConnectionTarget(replica) + replicaTarget.Kind = common.TargetReadReplica + replicaTarget.Credentials = common.ServiceCredentials(primary) setupGetReplica := func(m *mocks.MockClientWithResponsesInterface) { expectResolveRef(m, "rep-67890", replica) expectGetService(m, "svc-12345", primary) diff --git a/internal/cmd/db_psql.go b/internal/cmd/db_psql.go index 34ca6967..0c34dbe7 100644 --- a/internal/cmd/db_psql.go +++ b/internal/cmd/db_psql.go @@ -130,9 +130,7 @@ skipping the prompt. Read replicas share the primary's credentials.`, return nil } - // Read replicas share the primary's credentials, so password storage - // and recovery always operate on the credential service. - return connectWithPasswordMenu(cmd.Context(), cmd, app, target.CredentialService, details, psqlPath, psqlFlags) + return connectWithPasswordMenu(cmd.Context(), cmd, app, target, details, psqlPath, psqlFlags) }, } @@ -186,14 +184,13 @@ func selectConnection( chosen := target // Offer the replica menu only for a primary on an interactive terminal. - if !target.IsReplica && !noReplicaPrompt && util.IsTerminal(cmd.InOrStdin()) && util.IsTerminal(cmd.ErrOrStderr()) { - primary := target.ConnectionService - replicas, err := fetchReplicaSets(ctx, client, projectID, primary.ServiceID) + if target.Kind == common.TargetService && !noReplicaPrompt && util.IsTerminal(cmd.InOrStdin()) && util.IsTerminal(cmd.ErrOrStderr()) { + replicas, err := fetchReplicaSets(ctx, client, projectID, target.ID) if err != nil { // Don't block the connection if we can't list replicas. cmd.PrintErrf("Warning: could not list read replicas: %v\n", err) } else if connectable := connectableReplicas(replicas); len(connectable) > 0 { - choice, err := selectConnectTargetOption(cmd, primary, connectable) + choice, err := selectConnectTargetOption(cmd, target.ID, connectable) if err != nil { return nil, err } @@ -201,14 +198,14 @@ func selectConnection( case targetCancel: return nil, nil case targetReplica: - chosen = common.NewReplicaConnectionTarget(primary, *choice.replica) + chosen = common.NewReplicaConnectionTarget(*choice.replica, target.Credentials) } } } // The target is settled now, so read-only mode can have its say. --read-only // is already in opts and only adds to the restriction. - opts.ReadOnly = opts.ReadOnly || common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(chosen.ConnectionService)) != nil + opts.ReadOnly = opts.ReadOnly || common.CheckReadOnly(cfg, chosen.Environment) != nil warnReplicaPooler(cmd, chosen, opts.Pooled) @@ -217,8 +214,8 @@ func selectConnection( return nil, err } - if chosen.IsReplica { - cmd.PrintErrf("Connecting to read replica %s...\n", serviceLabel(chosen.ConnectionService)) + if chosen.Kind == common.TargetReadReplica { + cmd.PrintErrf("Connecting to read replica '%s' (%s)...\n", chosen.Name, chosen.ID) } return details, nil } @@ -275,10 +272,10 @@ type connectTargetModel struct { chosen connectTargetChoice } -func newConnectTargetModel(primary api.Service, replicas []api.ReadReplicaSet) connectTargetModel { +func newConnectTargetModel(primaryID string, replicas []api.ReadReplicaSet) connectTargetModel { choices := []connectTargetChoice{{ kind: targetPrimary, - label: fmt.Sprintf("Connect to primary service (%s)", primary.ServiceID), + label: fmt.Sprintf("Connect to primary service (%s)", primaryID), }} for i := range replicas { @@ -352,8 +349,8 @@ func (m connectTargetModel) View() tea.View { // selectConnectTargetOption shows the interactive menu for choosing a // connection target. -func selectConnectTargetOption(cmd *cobra.Command, primary api.Service, replicas []api.ReadReplicaSet) (connectTargetChoice, error) { - model := newConnectTargetModel(primary, replicas) +func selectConnectTargetOption(cmd *cobra.Command, primaryID string, replicas []api.ReadReplicaSet) (connectTargetChoice, error) { + model := newConnectTargetModel(primaryID, replicas) program := tea.NewProgram(model, tea.WithInput(cmd.InOrStdin()), @@ -374,7 +371,7 @@ func connectWithPasswordMenu( ctx context.Context, cmd *cobra.Command, app *common.App, - service api.Service, + target *common.ConnectionTarget, details *common.ConnectionDetails, psqlPath string, psqlFlags []string, @@ -384,9 +381,13 @@ func connectWithPasswordMenu( return err } + // Read replicas share the primary's credentials, so password storage and + // recovery always operate on the credential owner. + credentials := target.Credentials + // Interactive mode: Get stored password (if any) storage := common.GetPasswordStorage(cfg) - storedPassword, err := storage.Get(service, details.Role) + storedPassword, err := storage.Get(credentials.PasswordTarget, details.Role) if err != nil { cmd.PrintErrf("Warning: could not retrieve stored password: %v\n", err) } @@ -395,7 +396,7 @@ func connectWithPasswordMenu( err = testConnectionWithPassword(ctx, details, storedPassword) if err == nil { // Password works, launch psql - return launchPsql(cfg, details, psqlPath, psqlFlags, service, cmd) + return launchPsql(cfg, details, psqlPath, psqlFlags, credentials.PasswordTarget, cmd) } // Check if it's an auth error @@ -415,7 +416,7 @@ func connectWithPasswordMenu( // control-plane write, so read-only mode hides the option rather than // offering what it would refuse. canResetPassword := details.Role == "tsdbadmin" && - common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(service)) == nil + common.CheckReadOnly(cfg, credentials.Environment) == nil // Interactive recovery loop for { @@ -440,7 +441,7 @@ func connectWithPasswordMenu( // Test, save, and launch details.Password = password - if err = testSaveAndLaunchPsqlWithPassword(ctx, cmd, cfg, details, psqlPath, psqlFlags, service); err != nil { + if err = testSaveAndLaunchPsqlWithPassword(ctx, cmd, cfg, details, psqlPath, psqlFlags, credentials.PasswordTarget); err != nil { if isPostgresAuthenticationError(err) { cmd.PrintErrf("Password incorrect.\n\n") continue @@ -451,7 +452,7 @@ func connectWithPasswordMenu( case optionResetPassword: // Prompt and reset - password, err := promptAndResetPassword(ctx, cmd, cfg, client, service, details.Role) + password, err := promptAndResetPassword(ctx, cmd, cfg, client, credentials, details.Role) if err != nil { if errors.Is(err, context.Canceled) { return nil // user cancelled @@ -462,7 +463,7 @@ func connectWithPasswordMenu( cmd.PrintErrf("Password updated for %s\n", details.Role) // Launch psql (password is now in storage) details.Password = password - return launchPsql(cfg, details, psqlPath, psqlFlags, service, cmd) + return launchPsql(cfg, details, psqlPath, psqlFlags, credentials.PasswordTarget, cmd) case optionExit: return nil @@ -607,7 +608,7 @@ func testSaveAndLaunchPsqlWithPassword( details *common.ConnectionDetails, psqlPath string, psqlFlags []string, - service api.Service, + credentials common.PasswordTarget, ) error { // Test the password if err := testConnectionWithPassword(ctx, details, details.Password); err != nil { @@ -615,7 +616,7 @@ func testSaveAndLaunchPsqlWithPassword( } // Password works! Save it - result, saveErr := common.SavePasswordWithResult(cfg, service, details.Password, details.Role) + result, saveErr := common.SavePasswordWithResult(cfg, credentials, details.Password, details.Role) if saveErr != nil { cmd.PrintErrf("Warning: could not save password: %v\n", saveErr) } else if result.Success { @@ -623,13 +624,13 @@ func testSaveAndLaunchPsqlWithPassword( } // Launch psql - return launchPsql(cfg, details, psqlPath, psqlFlags, service, cmd) + return launchPsql(cfg, details, psqlPath, psqlFlags, credentials, cmd) } // launchPsql launches psql using the connection string and additional flags. // It retrieves the password from storage and sets PGPASSWORD environment variable. -func launchPsql(cfg *config.Config, details *common.ConnectionDetails, psqlPath string, additionalFlags []string, service api.Service, cmd *cobra.Command) error { - psqlCmd := buildPsqlCommand(cfg, details, psqlPath, additionalFlags, service, cmd) +func launchPsql(cfg *config.Config, details *common.ConnectionDetails, psqlPath string, additionalFlags []string, credentials common.PasswordTarget, cmd *cobra.Command) error { + psqlCmd := buildPsqlCommand(cfg, details, psqlPath, additionalFlags, credentials, cmd) err := psqlCmd.Run() // Propagate psql's own exit code; a signal death (ExitCode() == -1) // falls through to the generic exit code 1. @@ -641,7 +642,7 @@ func launchPsql(cfg *config.Config, details *common.ConnectionDetails, psqlPath } // buildPsqlCommand creates the psql command with proper environment setup -func buildPsqlCommand(cfg *config.Config, details *common.ConnectionDetails, psqlPath string, additionalFlags []string, service api.Service, cmd *cobra.Command) *exec.Cmd { +func buildPsqlCommand(cfg *config.Config, details *common.ConnectionDetails, psqlPath string, additionalFlags []string, credentials common.PasswordTarget, cmd *cobra.Command) *exec.Cmd { password := details.Password // Ensure we don't include password in the connection string to make it not show up in process lists // Passwords are passed via PGPASSWORD environment variable (see below) @@ -667,7 +668,7 @@ func buildPsqlCommand(cfg *config.Config, details *common.ConnectionDetails, psq // Only set PGPASSWORD for keyring storage method // pgpass storage relies on psql automatically reading ~/.pgpass file if _, isKeyring := storage.(*common.KeyringStorage); isKeyring { - if storedPassword, err := storage.Get(service, details.Role); err == nil && storedPassword != "" { + if storedPassword, err := storage.Get(credentials, details.Role); err == nil && storedPassword != "" { // Set PGPASSWORD environment variable for psql when using keyring psqlCmd.Env = append(os.Environ(), "PGPASSWORD="+storedPassword) } diff --git a/internal/cmd/db_psql_test.go b/internal/cmd/db_psql_test.go index a0747d7c..69925a17 100644 --- a/internal/cmd/db_psql_test.go +++ b/internal/cmd/db_psql_test.go @@ -279,13 +279,13 @@ func TestConnectTargetModel(t *testing.T) { t.Run("choices", func(t *testing.T) { // No replicas: primary, cancel. - m := newConnectTargetModel(primary, nil) + m := newConnectTargetModel(primary.ServiceID, nil) if len(m.choices) != 2 || m.choices[0].kind != targetPrimary || m.choices[1].kind != targetCancel { t.Errorf("expected [primary, cancel] with no replicas, got %+v", m.choices) } // Two replicas: primary, replica-a, replica-b, cancel. - m = newConnectTargetModel(primary, replicas) + m = newConnectTargetModel(primary.ServiceID, replicas) if len(m.choices) != 4 { t.Fatalf("expected 4 choices with two replicas, got %d: %+v", len(m.choices), m.choices) } @@ -322,7 +322,7 @@ func TestConnectTargetModel(t *testing.T) { for _, tt := range keyTests { t.Run(tt.name, func(t *testing.T) { - m := newConnectTargetModel(primary, replicas) + m := newConnectTargetModel(primary.ServiceID, replicas) updated, _ := m.Update(tt.key) choice := updated.(connectTargetModel).chosen if choice.kind != tt.wantKind { @@ -354,7 +354,7 @@ func TestBuildPsqlCommand(t *testing.T) { d := details() d.Password = "explicit-pw" flags := []string{"--single-transaction", "-c", "SELECT 1;"} - psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "keyring"}, d, psqlPath, flags, api.Service{}, discardCmd()) + psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "keyring"}, d, psqlPath, flags, common.PasswordTarget{}, discardCmd()) wantArgs := []string{psqlPath, connString, "--single-transaction", "-c", "SELECT 1;"} if !slices.Equal(psqlCmd.Args, wantArgs) { @@ -368,11 +368,11 @@ func TestBuildPsqlCommand(t *testing.T) { t.Run("keyring password becomes PGPASSWORD", func(t *testing.T) { keyring.MockInit() service := api.Service{ServiceID: "svc-psql", ProjectID: "proj-psql"} - if err := (&common.KeyringStorage{}).Save(service, "keyring-pw", "testuser"); err != nil { + if err := (&common.KeyringStorage{}).Save(common.ServicePasswordTarget(service), "keyring-pw", "testuser"); err != nil { t.Fatalf("failed to save test password: %v", err) } - psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "keyring"}, details(), psqlPath, nil, service, discardCmd()) + psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "keyring"}, details(), psqlPath, nil, common.ServicePasswordTarget(service), discardCmd()) if !slices.Contains(psqlCmd.Env, "PGPASSWORD=keyring-pw") { t.Errorf("expected PGPASSWORD=keyring-pw in env, got %v", psqlCmd.Env) } @@ -380,7 +380,7 @@ func TestBuildPsqlCommand(t *testing.T) { t.Run("pgpass storage sets no PGPASSWORD", func(t *testing.T) { // psql reads ~/.pgpass itself, so the env var must stay unset. - psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "pgpass"}, details(), psqlPath, nil, api.Service{}, discardCmd()) + psqlCmd := buildPsqlCommand(&config.Config{PasswordStorage: "pgpass"}, details(), psqlPath, nil, common.PasswordTarget{}, discardCmd()) for _, env := range psqlCmd.Env { if strings.HasPrefix(env, "PGPASSWORD=") { t.Errorf("expected no PGPASSWORD for pgpass storage, got %s", env) @@ -403,7 +403,7 @@ func TestLaunchPsql(t *testing.T) { Database: "testdb", Role: "testuser", } - err := launchPsql(&config.Config{PasswordStorage: "none"}, details, "/nonexistent/psql", []string{"--quiet"}, api.Service{}, cmd) + err := launchPsql(&config.Config{PasswordStorage: "none"}, details, "/nonexistent/psql", []string{"--quiet"}, common.PasswordTarget{}, cmd) if err == nil { t.Error("expected error for nonexistent psql path") } diff --git a/internal/cmd/db_query.go b/internal/cmd/db_query.go index ff3c9487..8ffcdb3c 100644 --- a/internal/cmd/db_query.go +++ b/internal/cmd/db_query.go @@ -125,7 +125,7 @@ read-only while leaving DEV services writable.`, Pooled: pooled, // --read-only only adds to whatever read-only mode already // imposes, which under prod mode depends on the target's tag. - ReadOnly: readOnly || common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(target.ConnectionService)) != nil, + ReadOnly: readOnly || common.CheckReadOnly(cfg, target.Environment) != nil, }) if err != nil { return handleDatabaseError(err, target) diff --git a/internal/cmd/db_save_password.go b/internal/cmd/db_save_password.go index 5c3e09e7..82d34525 100644 --- a/internal/cmd/db_save_password.go +++ b/internal/cmd/db_save_password.go @@ -61,14 +61,17 @@ The password will be saved according to your --password-storage setting return err } - // Resolve the target so a read replica id stores the password against + // Resolve the target so a read replica stores the password against // its parent primary: replicas share the primary's credentials, and // psql/ping look the password up against the primary. target, err := common.NewConnectionTarget(cmd.Context(), client, projectID, *resolved) if err != nil { return err } - service := target.CredentialService + // Read replicas share the primary's credentials, so this is the + // primary's for one. + credentials := target.Credentials + label := fmt.Sprintf("'%s' (%s)", credentials.Name, credentials.ID) // Determine password based on precedence: // 1. --password flag with value @@ -104,16 +107,14 @@ The password will be saved according to your --password-storage setting // Save password using configured storage storage := common.GetPasswordStorage(cfg) - if err := storage.Save(service, passwordToSave, role); err != nil { + if err := storage.Save(credentials.PasswordTarget, passwordToSave, role); err != nil { return fmt.Errorf("failed to save password: %w", err) } - if target.IsReplica { - cmd.PrintErrf("Read replicas share the primary's credentials; saving against primary %s.\n", - serviceLabel(service)) + if target.Kind == common.TargetReadReplica { + cmd.PrintErrf("Read replicas share the primary's credentials; saving against primary %s.\n", label) } - cmd.PrintErrf("Password saved for service %s, role %s\n", - serviceLabel(service), role) + cmd.PrintErrf("Password saved for service %s, role %s\n", label, role) return nil }, } diff --git a/internal/cmd/db_save_password_test.go b/internal/cmd/db_save_password_test.go index 1cf5ab43..206420c6 100644 --- a/internal/cmd/db_save_password_test.go +++ b/internal/cmd/db_save_password_test.go @@ -21,7 +21,7 @@ func TestDbSavePasswordCmd(t *testing.T) { checkKeyringPassword := func(role, want string) checkFunc { return func(t *testing.T, result cmdResult) { t.Helper() - got, err := (&common.KeyringStorage{}).Get(sampleService(), role) + got, err := (&common.KeyringStorage{}).Get(common.ServicePasswordTarget(sampleService()), role) if err != nil { t.Fatalf("failed to read saved password: %v", err) } @@ -148,7 +148,7 @@ func TestDbSavePasswordCmd(t *testing.T) { mock: setupGetService, wantStderr: "Password saved for service 'test-service' (svc-12345), role readonly\n", checks: []checkFunc{checkKeyringPassword("readonly", "readonly-pw"), func(t *testing.T, result cmdResult) { - if pw, err := (&common.KeyringStorage{}).Get(sampleService(), "tsdbadmin"); err == nil { + if pw, err := (&common.KeyringStorage{}).Get(common.ServicePasswordTarget(sampleService()), "tsdbadmin"); err == nil { t.Errorf("expected no password stored for tsdbadmin, got %q", pw) } }}, @@ -194,7 +194,7 @@ func TestDbSavePasswordCmd(t *testing.T) { mock: setupGetService, wantStderr: "Password saved for service 'test-service' (svc-12345), role tsdbadmin\n", checks: []checkFunc{func(t *testing.T, result cmdResult) { - if pw, err := (&common.KeyringStorage{}).Get(sampleService(), "tsdbadmin"); err == nil { + if pw, err := (&common.KeyringStorage{}).Get(common.ServicePasswordTarget(sampleService()), "tsdbadmin"); err == nil { t.Errorf("expected no stored password, got %q", pw) } }}, @@ -210,7 +210,7 @@ func TestDbSavePasswordCmd(t *testing.T) { checks: []checkFunc{func(t *testing.T, result cmdResult) { // Stored against the parent primary, matching the connect read path. checkKeyringPassword("tsdbadmin", "replica-pw")(t, result) - if pw, err := (&common.KeyringStorage{}).Get(sampleReplica(), "tsdbadmin"); err == nil { + if pw, err := (&common.KeyringStorage{}).Get(common.ServicePasswordTarget(sampleReplica()), "tsdbadmin"); err == nil { t.Errorf("expected no password stored under the replica ID, got %q", pw) } }}, diff --git a/internal/cmd/db_uri.go b/internal/cmd/db_uri.go index 4d85f814..d7e22e8d 100644 --- a/internal/cmd/db_uri.go +++ b/internal/cmd/db_uri.go @@ -83,7 +83,7 @@ services writable.`, Pooled: pooled, Role: role, WithPassword: withPassword, - ReadOnly: readOnly || common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(target.ConnectionService)) != nil, + ReadOnly: readOnly || common.CheckReadOnly(cfg, target.Environment) != nil, }) if err != nil { return err diff --git a/internal/cmd/db_uri_test.go b/internal/cmd/db_uri_test.go index 1e0114cf..a74f7889 100644 --- a/internal/cmd/db_uri_test.go +++ b/internal/cmd/db_uri_test.go @@ -216,25 +216,15 @@ func TestDbURICmd(t *testing.T) { name: "with-password includes stored password", args: []string{"db", "uri", "svc-12345", "--with-password"}, mock: setupGet, - opts: []runOption{withStoredPassword(sampleService(), "secret-pw")}, + opts: []runOption{withStoredPassword(common.ServicePasswordTarget(sampleService()), "secret-pw")}, wantStdout: "postgresql://tsdbadmin:secret-pw@svc-12345.project.tsdb.cloud.timescale.com:5432/tsdb?sslmode=require\n", }, { name: "replica uses primary credentials", args: []string{"db", "uri", "rep-67890", "--with-password"}, mock: setupGetReplica, - opts: []runOption{withStoredPassword(sampleService(), "primary-pw")}, + opts: []runOption{withStoredPassword(common.ServicePasswordTarget(sampleService()), "primary-pw")}, wantStdout: "postgresql://tsdbadmin:primary-pw@rep-67890.project.tsdb.cloud.timescale.com:5432/tsdb?sslmode=require\n", }, }) } - -// withStoredPassword seeds a password for svc in the mock keyring before the -// command runs. -func withStoredPassword(svc api.Service, password string) runOption { - return withSetup(func(t *testing.T) { - if err := (&common.KeyringStorage{}).Save(svc, password, "tsdbadmin"); err != nil { - t.Fatalf("failed to seed password: %v", err) - } - }) -} diff --git a/internal/cmd/main_test.go b/internal/cmd/main_test.go index 11e27ac4..c087d48d 100644 --- a/internal/cmd/main_test.go +++ b/internal/cmd/main_test.go @@ -424,6 +424,23 @@ func withIsTerminal(isTerminal bool) runOption { }) } +// withGenerateSecurePassword stubs common.GenerateSecurePassword, asserting the +// requested length and returning password and err in place of a random +// password, so a case can expect the exact update request and stored password. +func withGenerateSecurePassword(wantLength int, password string, err error) runOption { + return withSetup(func(t *testing.T) { + original := common.GenerateSecurePassword + common.GenerateSecurePassword = func(length int) (string, error) { + t.Helper() + if length != wantLength { + t.Errorf("GenerateSecurePassword length = %d, want %d", length, wantLength) + } + return password, err + } + t.Cleanup(func() { common.GenerateSecurePassword = original }) + }) +} + // withReadPassword makes util.ReadPassword return the given password. The real // implementation needs stdin to be an *os.File, so password prompts can't be // driven with withStdin. @@ -526,6 +543,32 @@ func checkDefaultService(want string) checkFunc { } } +// withStoredPassword seeds a password for target in the mock keyring before +// the command runs. +func withStoredPassword(target common.PasswordTarget, password string) runOption { + return withSetup(func(t *testing.T) { + if err := (&common.KeyringStorage{}).Save(target, password, "tsdbadmin"); err != nil { + t.Fatalf("failed to seed password: %v", err) + } + }) +} + +// checkStoredPassword returns a check asserting the password stored in the +// (mock) keyring for the given service. +func checkStoredPassword(serviceID, want string) checkFunc { + return func(t *testing.T, result cmdResult) { + t.Helper() + target := common.PasswordTarget{ID: serviceID, ProjectID: testProjectID} + got, err := (&common.KeyringStorage{}).Get(target, "tsdbadmin") + if err != nil { + t.Fatalf("failed to read stored password: %v", err) + } + if got != want { + t.Errorf("stored password = %q, want %q", got, want) + } + } +} + // writeConfigFile writes exactly the given keys to the config file in // configDir, creating the directory if needed. Only these keys are written, so // unspecified ones still resolve from the environment or their defaults — diff --git a/internal/cmd/password_helper.go b/internal/cmd/password_helper.go index 7a606e00..171512f4 100644 --- a/internal/cmd/password_helper.go +++ b/internal/cmd/password_helper.go @@ -3,6 +3,7 @@ package cmd import ( "context" "fmt" + "net/http" "github.com/spf13/cobra" @@ -12,41 +13,48 @@ import ( "github.com/timescale/tiger-cli/internal/util" ) -// updateAndSaveServicePassword updates a service password via API and saves it locally. -// It handles the API call and password storage. -func updateAndSaveServicePassword( +// updateAndSavePassword sets the password of credentials' owner through the +// API, and saves it locally. +func updateAndSavePassword( ctx context.Context, cmd *cobra.Command, cfg *config.Config, client api.ClientWithResponsesInterface, - service api.Service, + credentials common.CredentialOwner, newPassword string, role string, ) error { - // Call API to update password - updateReq := api.UpdatePasswordInput{Password: newPassword} - resp, err := client.UpdatePasswordWithResponse(ctx, service.ProjectID, service.ServiceID, updateReq) - if err != nil { - return fmt.Errorf("failed to update password: %w", err) - } - - if resp.StatusCode() != 200 && resp.StatusCode() != 204 { - return common.ExitWithErrorFromStatusCode(resp.StatusCode(), resp.JSON4XX) + if err := updatePassword(ctx, client, credentials, newPassword); err != nil { + return err } // Save password locally - if result, err := common.SavePasswordWithResult(cfg, service, newPassword, role); err != nil { + if result, err := common.SavePasswordWithResult(cfg, credentials.PasswordTarget, newPassword, role); err != nil { cmd.PrintErrf("Warning: could not save password: %v\n", err) } else if result.Success { cmd.PrintErrf("%s\n", result.Message) - cmd.PrintErrf("View it with: tiger service get %s --with-password\n", service.ServiceID) + cmd.PrintErrf("View it with: tiger service get %s --with-password\n", credentials.ID) } return nil } -// resetServicePassword resets the password via API. If newPassword is empty, generates one. -func resetServicePassword(ctx context.Context, cmd *cobra.Command, cfg *config.Config, client api.ClientWithResponsesInterface, service api.Service, role string, newPassword string) (string, error) { +// updatePassword sets the password of credentials' owner through the API. +func updatePassword(ctx context.Context, client api.ClientWithResponsesInterface, credentials common.CredentialOwner, newPassword string) error { + input := api.UpdatePasswordInput{Password: newPassword} + resp, err := client.UpdatePasswordWithResponse(ctx, credentials.ProjectID, credentials.ID, input) + if err != nil { + return fmt.Errorf("failed to update password: %w", err) + } + if resp.StatusCode() != http.StatusNoContent { + return common.ExitWithErrorFromStatusCode(resp.StatusCode(), resp.JSON4XX) + } + return nil +} + +// resetPassword resets the password of credentials' owner via the API. If +// newPassword is empty, it generates one. +func resetPassword(ctx context.Context, cmd *cobra.Command, cfg *config.Config, client api.ClientWithResponsesInterface, credentials common.CredentialOwner, role string, newPassword string) (string, error) { // Generate password if not provided if newPassword == "" { var err error @@ -55,8 +63,7 @@ func resetServicePassword(ctx context.Context, cmd *cobra.Command, cfg *config.C } } - // Update and save password - if err := updateAndSaveServicePassword(ctx, cmd, cfg, client, service, newPassword, role); err != nil { + if err := updateAndSavePassword(ctx, cmd, cfg, client, credentials, newPassword, role); err != nil { return "", err } return newPassword, nil @@ -70,7 +77,7 @@ func promptAndResetPassword( cmd *cobra.Command, cfg *config.Config, client api.ClientWithResponsesInterface, - service api.Service, + credentials common.CredentialOwner, role string, ) (string, error) { cmd.PrintErr("Enter new password (leave empty to generate): ") @@ -80,5 +87,49 @@ func promptAndResetPassword( return "", fmt.Errorf("error reading password: %w", err) } - return resetServicePassword(ctx, cmd, cfg, client, service, role, newPassword) + return resetPassword(ctx, cmd, cfg, client, credentials, role, newPassword) +} + +// printPasswordStorageResult reports the outcome of saving a password and +// returns whether it was saved. +func printPasswordStorageResult(cmd *cobra.Command, result common.PasswordStorageResult) bool { + if result.Method == "none" && result.Message == "No password provided" { + // Don't output anything for empty password + return false + } + + // Only a real storage failure is a warning; the "none" method is informational. + if result.Success { + cmd.PrintErrf("%s\n", result.Message) + return true + } else if result.Method == "none" { + cmd.PrintErrf("%s\n", result.Message) + } else { + cmd.PrintErrf("Warning: %s\n", result.Message) + } + return false +} + +// handlePasswordSaving handles saving password using the configured storage +// method and displaying appropriate messages. Returns true if the password was +// successfully saved, or false if not. +func handlePasswordSaving(cmd *cobra.Command, cfg *config.Config, target common.PasswordTarget, initialPassword string) bool { + // Note: We don't fail the service creation if password saving fails + // The error is handled by displaying the appropriate message below + result, _ := common.SavePasswordWithResult(cfg, target, initialPassword, "tsdbadmin") + return printPasswordStorageResult(cmd, result) +} + +// printConnectMessage tells the user how to connect to a new service. +func printConnectMessage(cmd *cobra.Command, passwordSaved, noSetDefault bool, serviceID string) { + if !passwordSaved { + // We can't connect if no password was saved, so don't show message + return + } else if noSetDefault { + // If the service wasn't set as the default, include the serviceID in the command + cmd.PrintErrf("Connect with: tiger db psql %s\n", serviceID) + } else { + // If the service was set as the default, no need to include the serviceID in the command + cmd.PrintErrf("Connect with: tiger db psql\n") + } } diff --git a/internal/cmd/project_list.go b/internal/cmd/project_list.go index 665f742e..3976af77 100644 --- a/internal/cmd/project_list.go +++ b/internal/cmd/project_list.go @@ -82,7 +82,7 @@ func outputProjects(cmd *cobra.Command, projects []api.Project, currentProjectID // but TIGER_OUTPUT and the config file aren't validated on load. return fmt.Errorf("environment variable output is not supported for multiple projects") default: // table format (default) - return outputProjectsTable(outputProjects, outputWriter) + return outputProjectsTable(outputWriter, outputProjects) } } @@ -99,7 +99,7 @@ func prepareProjectsForOutput(projects []api.Project, currentProjectID string) [ } // outputProjectsTable outputs projects in a formatted table using tablewriter -func outputProjectsTable(projects []OutputProject, output io.Writer) error { +func outputProjectsTable(output io.Writer, projects []OutputProject) error { table := tablewriter.NewWriter(output) table.Header("PROJECT ID", "NAME", "CURRENT") diff --git a/internal/cmd/service.go b/internal/cmd/service.go index 4a5edbd7..44615007 100644 --- a/internal/cmd/service.go +++ b/internal/cmd/service.go @@ -83,16 +83,26 @@ type OutputService struct { ConsoleURL string `json:"console_url,omitempty"` } -// outputService formats and outputs a single service based on the specified format -func outputService(cmd *cobra.Command, cfg *config.Config, service api.Service, experimental bool, format string, withPassword bool, strict bool) error { - // Prepare the output service with computed fields - outputSvc := prepareServiceForOutput(cmd, cfg, service, experimental, withPassword) - if strict && withPassword && outputSvc.Password == "" { +// serviceOutputOptions controls what the service output functions include. +// The zero value leaves out every optional field. +type serviceOutputOptions struct { + // Experimental includes preview fields (the platform). + Experimental bool + // WithPassword includes the tsdbadmin password, if one is available. + WithPassword bool + // RequirePassword fails the output when WithPassword finds no password. + RequirePassword bool +} + +// outputService outputs a single service in the configured output format. +func outputService(cmd *cobra.Command, cfg *config.Config, service api.Service, opts serviceOutputOptions) error { + outputSvc := prepareServiceForOutput(cmd, cfg, service, opts) + if opts.RequirePassword && opts.WithPassword && outputSvc.Password == "" { return fmt.Errorf("password requested but not available for service %s", outputSvc.ServiceID) } outputWriter := cmd.OutOrStdout() - switch strings.ToLower(format) { + switch strings.ToLower(cfg.Output) { case "json": return util.SerializeToJSON(outputWriter, outputSvc) case "yaml": @@ -100,7 +110,7 @@ func outputService(cmd *cobra.Command, cfg *config.Config, service api.Service, case "env": return outputServiceEnv(cmd, outputSvc) default: // table format (default) - return outputServiceTable(outputSvc, outputWriter) + return outputServiceTable(outputWriter, outputSvc) } } @@ -117,7 +127,7 @@ func outputServiceEnv(cmd *cobra.Command, service OutputService) error { } // outputServiceTable outputs detailed service information in a formatted table -func outputServiceTable(service OutputService, output io.Writer) error { +func outputServiceTable(output io.Writer, service OutputService) error { table := tablewriter.NewWriter(output) table.Header("PROPERTY", "VALUE") @@ -168,24 +178,14 @@ func outputServiceTable(service OutputService, output io.Writer) error { } // Endpoint information - if service.Endpoint != nil { - if service.Endpoint.Host != nil { - port := "5432" - if service.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.Endpoint.Port) - } - table.Append("Direct Endpoint", fmt.Sprintf("%s:%s", *service.Endpoint.Host, port)) - } + if service.Endpoint != nil && service.Endpoint.Host != nil && service.Endpoint.Port != nil { + table.Append("Direct Endpoint", fmt.Sprintf("%s:%d", *service.Endpoint.Host, *service.Endpoint.Port)) } // Connection pooler information if service.ConnectionPooler != nil && service.ConnectionPooler.Endpoint != nil { - if service.ConnectionPooler.Endpoint.Host != nil { - port := "6432" - if service.ConnectionPooler.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.ConnectionPooler.Endpoint.Port) - } - table.Append("Pooler Endpoint", fmt.Sprintf("%s:%s", *service.ConnectionPooler.Endpoint.Host, port)) + if pooler := service.ConnectionPooler.Endpoint; pooler.Host != nil && pooler.Port != nil { + table.Append("Pooler Endpoint", fmt.Sprintf("%s:%d", *pooler.Host, *pooler.Port)) } } @@ -211,25 +211,25 @@ func outputServiceTable(service OutputService, output io.Writer) error { // prepareServiceForOutput builds the output view of a service. cmd may be nil, // in which case the connection-details warning is dropped rather than printed. // The platform and IOPS fields are preview fields, so they are dropped unless -// experimental is set. -func prepareServiceForOutput(cmd *cobra.Command, cfg *config.Config, service api.Service, experimental bool, withPassword bool) OutputService { +// opts.Experimental is set. +func prepareServiceForOutput(cmd *cobra.Command, cfg *config.Config, service api.Service, opts serviceOutputOptions) OutputService { outputSvc := OutputService{ Service: service, } outputSvc.Service.InitialPassword = nil - if !experimental { + if !opts.Experimental { outputSvc.Service.Platform = nil outputSvc.Service.Resources = resourcesWithoutIOPS(service.Resources) } - opts := common.ConnectionDetailsOptions{ + detailsOpts := common.ConnectionDetailsOptions{ Role: "tsdbadmin", - WithPassword: withPassword, + WithPassword: opts.WithPassword, InitialPassword: util.Deref(service.InitialPassword), ReadOnly: common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(service)) != nil, } - if connectionDetails, err := common.GetConnectionDetails(cfg, service, opts); err != nil { + if connectionDetails, err := common.GetConnectionDetails(cfg, common.NewServiceConnectionTarget(service), detailsOpts); err != nil { if cmd != nil { cmd.PrintErrf("Warning: Failed to get connection details: %v\n", err) } @@ -262,31 +262,6 @@ func resourcesWithoutIOPS(resources []api.Resource) []api.Resource { return stripped } -// handlePasswordSaving handles saving password using the configured storage -// method and displaying appropriate messages. Returns true if the password was -// successfully saved, or false if not. -func handlePasswordSaving(cmd *cobra.Command, cfg *config.Config, service api.Service, initialPassword string) bool { - // Note: We don't fail the service creation if password saving fails - // The error is handled by displaying the appropriate message below - result, _ := common.SavePasswordWithResult(cfg, service, initialPassword, "tsdbadmin") - - if result.Method == "none" && result.Message == "No password provided" { - // Don't output anything for empty password - return false - } - - // Only a real storage failure is a warning; the "none" method is informational. - if result.Success { - cmd.PrintErrf("%s\n", result.Message) - return true - } else if result.Method == "none" { - cmd.PrintErrf("%s\n", result.Message) - } else { - cmd.PrintErrf("Warning: %s\n", result.Message) - } - return false -} - // setDefaultService sets the given service as the default service in the configuration func setDefaultService(cmd *cobra.Command, cfg *config.Config, serviceID string) error { if _, err := cfg.Set("service_id", serviceID); err != nil { @@ -296,16 +271,3 @@ func setDefaultService(cmd *cobra.Command, cfg *config.Config, serviceID string) cmd.PrintErrf("Default service set to %s.\n", serviceID) return nil } - -func printConnectMessage(cmd *cobra.Command, passwordSaved, noSetDefault bool, serviceID string) { - if !passwordSaved { - // We can't connect if no password was saved, so don't show message - return - } else if noSetDefault { - // If the service wasn't set as the default, include the serviceID in the command - cmd.PrintErrf("Connect with: tiger db psql %s\n", serviceID) - } else { - // If the service was set as the default, no need to include the serviceID in the command - cmd.PrintErrf("Connect with: tiger db psql\n") - } -} diff --git a/internal/cmd/service_backup_list.go b/internal/cmd/service_backup_list.go index 2aa3099f..59730d96 100644 --- a/internal/cmd/service_backup_list.go +++ b/internal/cmd/service_backup_list.go @@ -78,11 +78,6 @@ service from your configuration.`, backups = *resp.JSON200 } - if len(backups) == 0 { - cmd.PrintErrln("No backups found.") - return nil - } - return outputBackups(cmd, backups, cfg.Output) }, } @@ -104,13 +99,17 @@ func outputBackups(cmd *cobra.Command, backups []api.Backup, format string) erro case "env": return fmt.Errorf("environment variable output is not supported for backups") default: - return outputBackupsTable(backups, out) + if len(backups) == 0 { + cmd.PrintErrln("No backups found.") + return nil + } + return outputBackupsTable(out, backups) } } // outputBackupsTable omits the label: it repeats STARTED and TYPE, and no command // takes it as input. It stays in the json and yaml output. -func outputBackupsTable(backups []api.Backup, output io.Writer) error { +func outputBackupsTable(output io.Writer, backups []api.Backup) error { table := tablewriter.NewWriter(output) table.Header("STARTED", "TYPE", "DURATION", "SIZE", "REGIONS") diff --git a/internal/cmd/service_backup_list_test.go b/internal/cmd/service_backup_list_test.go index 8bc641e1..7cb15a3f 100644 --- a/internal/cmd/service_backup_list_test.go +++ b/internal/cmd/service_backup_list_test.go @@ -159,6 +159,22 @@ func TestServiceBackupListCmd(t *testing.T) { mock: setupList([]api.Backup{}), wantStderr: "No backups found.\n", }, + { + // Structured output is always structured, so an empty list is + // still a list rather than a message. + name: "empty list json", + args: []string{"service", "backup", "list", "svc-12345", "-o", "json"}, + opts: []runOption{experimental}, + mock: setupList([]api.Backup{}), + wantStdout: "[]\n", + }, + { + name: "empty list yaml", + args: []string{"service", "backup", "list", "svc-12345", "-o", "yaml"}, + opts: []runOption{experimental}, + mock: setupList([]api.Backup{}), + wantStdout: "[]\n", + }, { // The label is omitted from the table: it repeats STARTED and TYPE, // and no command takes it as input. diff --git a/internal/cmd/service_backup_region_list.go b/internal/cmd/service_backup_region_list.go index 62a09d98..dbdb33d7 100644 --- a/internal/cmd/service_backup_region_list.go +++ b/internal/cmd/service_backup_region_list.go @@ -94,16 +94,15 @@ func outputBackupRegions(cmd *cobra.Command, regions []api.BackupRegion, format case "env": return fmt.Errorf("environment variable output is not supported for backup regions") default: - return outputBackupRegionsTable(regions, out) + if len(regions) == 0 { + cmd.PrintErrln("No backup regions configured for this service.") + return nil + } + return outputBackupRegionsTable(out, regions) } } -func outputBackupRegionsTable(regions []api.BackupRegion, output io.Writer) error { - if len(regions) == 0 { - _, err := fmt.Fprintln(output, "No backup regions configured for this service.") - return err - } - +func outputBackupRegionsTable(output io.Writer, regions []api.BackupRegion) error { table := tablewriter.NewWriter(output) table.Header("REGION", "ADDED") diff --git a/internal/cmd/service_backup_region_list_test.go b/internal/cmd/service_backup_region_list_test.go index fa4acb74..ba08ee59 100644 --- a/internal/cmd/service_backup_region_list_test.go +++ b/internal/cmd/service_backup_region_list_test.go @@ -109,7 +109,7 @@ func TestServiceBackupRegionListCmd(t *testing.T) { args: []string{"service", "backup", "region", "list", "svc-12345"}, opts: []runOption{experimental}, mock: setupList([]api.BackupRegion{}), - wantStdout: "No backup regions configured for this service.\n", + wantStderr: "No backup regions configured for this service.\n", }, { // An empty list still serializes as a valid array in structured diff --git a/internal/cmd/service_create.go b/internal/cmd/service_create.go index 9d8fd13d..f0c5e44e 100644 --- a/internal/cmd/service_create.go +++ b/internal/cmd/service_create.go @@ -191,7 +191,7 @@ other will be automatically configured).` + iopsSectionHelp, // Save password immediately after service creation, before any waiting // This ensures users have access even if they interrupt the wait or it fails - passwordSaved := handlePasswordSaving(cmd, cfg, service, util.Deref(service.InitialPassword)) + passwordSaved := handlePasswordSaving(cmd, cfg, common.ServicePasswordTarget(service), util.Deref(service.InitialPassword)) // Set as default service unless --no-set-default is specified if !noSetDefault { @@ -226,7 +226,10 @@ other will be automatically configured).` + iopsSectionHelp, } } - if err := outputService(cmd, cfg, service, app.Experimental, cfg.Output, withPassword, false); err != nil { + if err := outputService(cmd, cfg, service, serviceOutputOptions{ + Experimental: app.Experimental, + WithPassword: withPassword, + }); err != nil { cmd.PrintErrf("Warning: Failed to output service details: %v\n", err) } diff --git a/internal/cmd/service_fork.go b/internal/cmd/service_fork.go index 03815b52..0905511e 100644 --- a/internal/cmd/service_fork.go +++ b/internal/cmd/service_fork.go @@ -190,7 +190,7 @@ default service from your configuration.`, cmd.PrintErrf("Service ID: %s\n", forkedServiceID) // Save password immediately after service fork - passwordSaved := handlePasswordSaving(cmd, cfg, forkedService, util.Deref(forkedService.InitialPassword)) + passwordSaved := handlePasswordSaving(cmd, cfg, common.ServicePasswordTarget(forkedService), util.Deref(forkedService.InitialPassword)) // Set as default service unless --no-set-default is used if !noSetDefault { @@ -225,7 +225,10 @@ default service from your configuration.`, } } - if err := outputService(cmd, cfg, forkedService, app.Experimental, cfg.Output, withPassword, false); err != nil { + if err := outputService(cmd, cfg, forkedService, serviceOutputOptions{ + Experimental: app.Experimental, + WithPassword: withPassword, + }); err != nil { cmd.PrintErrf("Warning: Failed to output service details: %v\n", err) } diff --git a/internal/cmd/service_get.go b/internal/cmd/service_get.go index 87af176d..dd705ad3 100644 --- a/internal/cmd/service_get.go +++ b/internal/cmd/service_get.go @@ -54,7 +54,11 @@ resource usage.`, service := *resolved // Output service in requested format - return outputService(cmd, cfg, service, app.Experimental, cfg.Output, withPassword, true) + return outputService(cmd, cfg, service, serviceOutputOptions{ + Experimental: app.Experimental, + WithPassword: withPassword, + RequirePassword: true, + }) }, } diff --git a/internal/cmd/service_get_test.go b/internal/cmd/service_get_test.go index e65f4341..a6beb46d 100644 --- a/internal/cmd/service_get_test.go +++ b/internal/cmd/service_get_test.go @@ -455,6 +455,33 @@ status: READY `, wantStderr: "Warning: Failed to get connection details: service endpoint not available\n", }, + { + // No port is guessed, for the direct endpoint or the pooler, so + // an endpoint without one isn't shown or connected to. + name: "endpoints without a port", + args: []string{"service", "get", "svc-12345"}, + mock: setupGet(sampleService(func(s *api.Service) { + s.Endpoint.Port = nil + s.ConnectionPooler = &api.ConnectionPooler{ + Endpoint: &api.Endpoint{Host: new("svc-12345.project.pooler.tsdb.cloud.timescale.com")}, + } + })), + wantStdout: `┌─────────────┬──────────────────────────────────────────────────────────────────┐ +│ PROPERTY │ VALUE │ +├─────────────┼──────────────────────────────────────────────────────────────────┤ +│ Service ID │ svc-12345 │ +│ Name │ test-service │ +│ Status │ READY │ +│ Type │ TIMESCALEDB │ +│ Region │ us-east-1 │ +│ CPU │ 1 cores (1000m) │ +│ Memory │ 4 GB │ +│ Created │ 2025-01-15 10:30:00 UTC │ +│ Console URL │ https://console.cloud.tigerdata.com/dashboard/services/svc-12345 │ +└─────────────┴──────────────────────────────────────────────────────────────────┘ +`, + wantStderr: "Warning: Failed to get connection details: endpoint port not available\n", + }, { // The ref reaches the API as typed: no client-side classification // stands between a name and the service it names. diff --git a/internal/cmd/service_list.go b/internal/cmd/service_list.go index e08cc31d..d177bc9c 100644 --- a/internal/cmd/service_list.go +++ b/internal/cmd/service_list.go @@ -44,16 +44,7 @@ func buildServiceListCmd(app *common.App) *cobra.Command { if resp.JSON200 == nil { return fmt.Errorf("empty response from API") } - services := *resp.JSON200 - - if len(services) == 0 { - cmd.PrintErrln("No services found.") - cmd.PrintErrln("Create your first service with: tiger service create") - return nil - } - - // Output services in requested format - return outputServices(cmd, cfg, services, app.Experimental, cfg.Output) + return outputServices(cmd, cfg, *resp.JSON200, serviceOutputOptions{Experimental: app.Experimental}) }, } @@ -63,13 +54,13 @@ func buildServiceListCmd(app *common.App) *cobra.Command { return cmd } -// outputServices formats and outputs the services list based on the specified format -func outputServices(cmd *cobra.Command, cfg *config.Config, services []api.Service, experimental bool, format string) error { - outputServices := prepareServicesForOutput(cmd, cfg, services, experimental) +// outputServices outputs the services list in the configured output format. +func outputServices(cmd *cobra.Command, cfg *config.Config, services []api.Service, opts serviceOutputOptions) error { + outputServices := prepareServicesForOutput(cmd, cfg, services, opts) outputWriter := cmd.OutOrStdout() - switch strings.ToLower(format) { + switch strings.ToLower(cfg.Output) { case "json": return util.SerializeToJSON(outputWriter, outputServices) case "yaml": @@ -77,21 +68,26 @@ func outputServices(cmd *cobra.Command, cfg *config.Config, services []api.Servi case "env": return fmt.Errorf("environment variable output is not supported for multiple services") default: // table format (default) - return outputServicesTable(outputServices, outputWriter) + if len(outputServices) == 0 { + cmd.PrintErrln("No services found.") + cmd.PrintErrln("Create your first service with: tiger service create") + return nil + } + return outputServicesTable(outputWriter, outputServices) } } // prepareServicesForOutput creates copies of services with sensitive fields removed -func prepareServicesForOutput(cmd *cobra.Command, cfg *config.Config, services []api.Service, experimental bool) []OutputService { +func prepareServicesForOutput(cmd *cobra.Command, cfg *config.Config, services []api.Service, opts serviceOutputOptions) []OutputService { prepared := make([]OutputService, len(services)) for i, service := range services { - prepared[i] = prepareServiceForOutput(cmd, cfg, service, experimental, false) + prepared[i] = prepareServiceForOutput(cmd, cfg, service, opts) } return prepared } // outputServicesTable outputs services in a formatted table using tablewriter -func outputServicesTable(services []OutputService, output io.Writer) error { +func outputServicesTable(output io.Writer, services []OutputService) error { table := tablewriter.NewWriter(output) table.Header("SERVICE ID", "NAME", "STATUS", "TYPE", "REGION", "CREATED") diff --git a/internal/cmd/service_list_test.go b/internal/cmd/service_list_test.go index f0b79009..90da403f 100644 --- a/internal/cmd/service_list_test.go +++ b/internal/cmd/service_list_test.go @@ -91,6 +91,20 @@ func TestServiceListCmd(t *testing.T) { mock: setupList(nil), wantStderr: noServicesStderr, }, + { + // Structured output is always structured, so an empty list is + // still a list rather than a message. + name: "empty list json", + args: []string{"service", "list", "-o", "json"}, + mock: setupList(nil), + wantStdout: "[]\n", + }, + { + name: "empty list yaml", + args: []string{"service", "list", "-o", "yaml"}, + mock: setupList(nil), + wantStdout: "[]\n", + }, { name: "table output", args: []string{"service", "list"}, diff --git a/internal/cmd/service_metrics_details.go b/internal/cmd/service_metrics_details.go index 1071a54f..6fe568e7 100644 --- a/internal/cmd/service_metrics_details.go +++ b/internal/cmd/service_metrics_details.go @@ -92,13 +92,13 @@ func outputMetricDetails(output io.Writer, format string, details api.MetricDeta case "yaml": return util.SerializeToYAML(output, details) default: - return outputMetricDetailsTable(details, output) + return outputMetricDetailsTable(output, details) } } // outputMetricDetailsTable renders metric metadata as a PROPERTY/VALUE table, // plus a LABEL/DESCRIPTION table when the metric has labels. -func outputMetricDetailsTable(details api.MetricDetails, output io.Writer) error { +func outputMetricDetailsTable(output io.Writer, details api.MetricDetails) error { table := tablewriter.NewWriter(output) table.Header("PROPERTY", "VALUE") diff --git a/internal/cmd/service_metrics_series.go b/internal/cmd/service_metrics_series.go index eacbe454..f41494b9 100644 --- a/internal/cmd/service_metrics_series.go +++ b/internal/cmd/service_metrics_series.go @@ -238,7 +238,7 @@ func renderMetricSeries(cmd *cobra.Command, output string, series []api.MetricSe return util.SerializeToYAML(out, series) default: if len(series) == 0 { - cmd.Println("No metric data returned for the requested window.") + cmd.PrintErrln("No metric data returned for the requested window.") return nil } table := tablewriter.NewWriter(out) diff --git a/internal/cmd/service_metrics_series_test.go b/internal/cmd/service_metrics_series_test.go index 8a79d712..2c3f235b 100644 --- a/internal/cmd/service_metrics_series_test.go +++ b/internal/cmd/service_metrics_series_test.go @@ -49,7 +49,7 @@ func TestServiceMetricsSeriesCmd(t *testing.T) { name: "key=value filter builds an EQUAL request", args: args("ordinal=0"), mock: expectSeries([]api.MetricLabelFilter{{Key: "ordinal", Value: "0"}}), - wantStdout: noDataMsg, + wantStderr: noDataMsg, }, { name: "key!=value filter builds a NOT_EQUAL request", @@ -57,7 +57,7 @@ func TestServiceMetricsSeriesCmd(t *testing.T) { mock: expectSeries([]api.MetricLabelFilter{ {Key: "role", Value: "replica", MatchType: new(api.MetricMatchTypeNOTEQUAL)}, }), - wantStdout: noDataMsg, + wantStderr: noDataMsg, }, { name: "malformed filter", @@ -102,7 +102,7 @@ func TestServiceMetricsSeriesCmd(t *testing.T) { JSON200: &empty, }, nil) }, - wantStdout: noDataMsg, + wantStderr: noDataMsg, }, { // synctest's bubble clock always starts at 2000-01-01 UTC, so the @@ -124,7 +124,7 @@ func TestServiceMetricsSeriesCmd(t *testing.T) { JSON200: &empty, }, nil) }, - wantStdout: noDataMsg, + wantStderr: noDataMsg, }, { // Defaulting only applies when both --from and --to are omitted — @@ -153,7 +153,7 @@ func TestServiceMetricsSeriesCmd(t *testing.T) { JSON200: &empty, }, nil) }, - wantStdout: noDataMsg, + wantStderr: noDataMsg, }, }) } diff --git a/internal/cmd/service_test.go b/internal/cmd/service_test.go index 8f4764bd..7c5f7571 100644 --- a/internal/cmd/service_test.go +++ b/internal/cmd/service_test.go @@ -7,7 +7,6 @@ import ( "github.com/timescale/tiger-cli/internal/api" "github.com/timescale/tiger-cli/internal/api/mocks" - "github.com/timescale/tiger-cli/internal/common" ) func TestServiceCommandAliases(t *testing.T) { @@ -89,22 +88,6 @@ func matchHelp(want string, absent ...string) matcher { }) } -// checkStoredPassword returns a check asserting the password stored in the -// (mock) keyring for the given service. -func checkStoredPassword(serviceID, want string) checkFunc { - return func(t *testing.T, result cmdResult) { - t.Helper() - svc := api.Service{ServiceID: serviceID, ProjectID: testProjectID} - got, err := (&common.KeyringStorage{}).Get(svc, "tsdbadmin") - if err != nil { - t.Fatalf("failed to read stored password: %v", err) - } - if got != want { - t.Errorf("stored password = %q, want %q", got, want) - } - } -} - // envTag returns a sampleService override setting the service's environment // tag, which is what the prod read-only gate reads off the resolved service. func envTag(tag string) func(*api.Service) { diff --git a/internal/cmd/service_update_password.go b/internal/cmd/service_update_password.go index 555a3d8c..84238edb 100644 --- a/internal/cmd/service_update_password.go +++ b/internal/cmd/service_update_password.go @@ -89,7 +89,7 @@ so update the password on the primary instead.`, if autoGenerate { // Auto-generate password using existing function - if _, err := resetServicePassword(ctx, cmd, cfg, client, service, "tsdbadmin", ""); err != nil { + if _, err := resetPassword(ctx, cmd, cfg, client, common.ServiceCredentials(service), "tsdbadmin", ""); err != nil { return err } } else if password == "" { @@ -97,12 +97,12 @@ so update the password on the primary instead.`, if !util.IsTerminal(cmd.InOrStdin()) || !util.IsTerminal(cmd.ErrOrStderr()) { return fmt.Errorf("TTY not detected - use --new-password flag, --auto-generate flag, or TIGER_NEW_PASSWORD environment variable") } - _, err := promptAndResetPassword(ctx, cmd, cfg, client, service, "tsdbadmin") + _, err := promptAndResetPassword(ctx, cmd, cfg, client, common.ServiceCredentials(service), "tsdbadmin") if err != nil { return err } } else { - if _, err := resetServicePassword(ctx, cmd, cfg, client, service, "tsdbadmin", password); err != nil { + if _, err := resetPassword(ctx, cmd, cfg, client, common.ServiceCredentials(service), "tsdbadmin", password); err != nil { return err } } diff --git a/internal/cmd/service_update_password_test.go b/internal/cmd/service_update_password_test.go index 50c6fcfb..2d09cb81 100644 --- a/internal/cmd/service_update_password_test.go +++ b/internal/cmd/service_update_password_test.go @@ -5,8 +5,6 @@ import ( "net/http" "testing" - "go.uber.org/mock/gomock" - "github.com/timescale/tiger-cli/internal/api" "github.com/timescale/tiger-cli/internal/api/mocks" "github.com/timescale/tiger-cli/internal/common" @@ -22,27 +20,19 @@ func TestServiceUpdatePasswordCmd(t *testing.T) { return func(m *mocks.MockClientWithResponsesInterface) { m.EXPECT().UpdatePasswordWithResponse(validCtx, testProjectID, "svc-12345", api.UpdatePasswordInput{Password: password}). Return(&api.UpdatePasswordResponse{ - HTTPResponse: httpResponse(http.StatusOK), + HTTPResponse: httpResponse(http.StatusNoContent), }, nil) } } - // setupUpdateAny is for the paths that generate a random password. - setupUpdateAny := func(m *mocks.MockClientWithResponsesInterface) { - m.EXPECT().UpdatePasswordWithResponse(validCtx, testProjectID, "svc-12345", gomock.Any()). - Return(&api.UpdatePasswordResponse{ - HTTPResponse: httpResponse(http.StatusOK), - }, nil) - } - // storedPassword reads the password the command saved for the sample // service in the per-test mock keyring ("" if none is stored). The shared - // checkStoredPassword helper can't express "nothing stored" or "random, - // but 32 characters", so those cases read the keyring through this. + // checkStoredPassword helper can't express "nothing stored", so that case + // reads the keyring through this. storedPassword := func(t *testing.T) string { t.Helper() storage := &common.KeyringStorage{} - password, err := storage.Get(api.Service{ProjectID: testProjectID, ServiceID: "svc-12345"}, "tsdbadmin") + password, err := storage.Get(common.PasswordTarget{ProjectID: testProjectID, ID: "svc-12345"}, "tsdbadmin") if err != nil { return "" } @@ -179,6 +169,17 @@ func TestServiceUpdatePasswordCmd(t *testing.T) { wantErr: "permission denied", checks: []checkFunc{checkExitCode(common.ExitPermissionDenied)}, }, + { + // The endpoint answers success with a 204 and nothing else. + name: "unexpected 200 is an error", + args: []string{"service", "update-password", "svc-12345", "--new-password", "newpass123"}, + mock: func(m *mocks.MockClientWithResponsesInterface) { + setupGet(m) + m.EXPECT().UpdatePasswordWithResponse(validCtx, testProjectID, "svc-12345", api.UpdatePasswordInput{Password: "newpass123"}). + Return(&api.UpdatePasswordResponse{HTTPResponse: httpResponse(http.StatusOK)}, nil) + }, + wantErr: "unknown error", + }, { name: "new-password flag", args: []string{"service", "update-password", "svc-12345", "--new-password", "newpass123"}, @@ -203,16 +204,20 @@ func TestServiceUpdatePasswordCmd(t *testing.T) { { name: "auto-generate", args: []string{"service", "update-password", "svc-12345", "--auto-generate"}, + opts: []runOption{withGenerateSecurePassword(32, "generated-pw", nil)}, mock: func(m *mocks.MockClientWithResponsesInterface) { setupGet(m) - setupUpdateAny(m) + setupUpdate("generated-pw")(m) }, wantStderr: savedStderr, - checks: []checkFunc{func(t *testing.T, result cmdResult) { - if got := storedPassword(t); len(got) != 32 { - t.Errorf("stored password length = %d, want 32", len(got)) - } - }}, + checks: []checkFunc{checkStoredPassword("svc-12345", "generated-pw")}, + }, + { + name: "password generation fails", + args: []string{"service", "update-password", "svc-12345", "--auto-generate"}, + opts: []runOption{withGenerateSecurePassword(32, "", errors.New("entropy unavailable"))}, + mock: setupGet, + wantErr: "failed to generate new password: entropy unavailable", }, { name: "interactive prompt", @@ -228,18 +233,14 @@ func TestServiceUpdatePasswordCmd(t *testing.T) { { name: "interactive prompt empty generates", args: []string{"service", "update-password", "svc-12345"}, - opts: []runOption{withIsTerminal(true), withReadPassword("")}, + opts: []runOption{withIsTerminal(true), withReadPassword(""), withGenerateSecurePassword(32, "generated-pw", nil)}, mock: func(m *mocks.MockClientWithResponsesInterface) { setupGet(m) - setupUpdateAny(m) + setupUpdate("generated-pw")(m) }, wantStderr: "Enter new password (leave empty to generate): \n" + savedStderr, - checks: []checkFunc{func(t *testing.T, result cmdResult) { - if got := storedPassword(t); len(got) != 32 { - t.Errorf("stored password length = %d, want 32", len(got)) - } - }}, + checks: []checkFunc{checkStoredPassword("svc-12345", "generated-pw")}, }, { name: "password storage none", diff --git a/internal/common/connection.go b/internal/common/connection.go index 59d96932..d50380c7 100644 --- a/internal/common/connection.go +++ b/internal/common/connection.go @@ -18,12 +18,12 @@ func hasPooler(pooler *api.ConnectionPooler) bool { // ReplicaPoolerWarning returns the warning to show when pooling was requested // for a read replica with no pooler (the connection falls back to direct), or "" -// otherwise — including for a non-replica target, so callers need no IsReplica guard. +// otherwise — including for a non-replica target, so callers need no kind check. func ReplicaPoolerWarning(target *ConnectionTarget, pooled bool) string { - if !target.IsReplica || !pooled || hasPooler(target.ConnectionService.ConnectionPooler) { + if target.Kind != TargetReadReplica || !pooled || hasPooler(target.Pooler) { return "" } - return fmt.Sprintf("read replica %q has no connection pooler; connecting directly instead", target.ConnectionService.Name) + return fmt.Sprintf("read replica %q has no connection pooler; connecting directly instead", target.Name) } // ConnectionDetailsOptions configures how the connection string is built @@ -63,27 +63,19 @@ type ConnectionDetails struct { // activates Tiger Cloud's immutable read-only connection mode. const readOnlyConnectionOption = "options=-c%20tsdb_admin.read_only_connection%3Dtrue" -// GetConnectionDetails builds the connection details for a service: it selects +// GetConnectionDetails builds the connection details for a target: it selects // the endpoint (the pooler when requested and available, otherwise the direct -// one) and looks up the password when one is wanted. -func GetConnectionDetails(cfg *config.Config, service api.Service, opts ConnectionDetailsOptions) (*ConnectionDetails, error) { - return getConnectionDetails(cfg, service, service, opts) -} - -// getConnectionDetails is GetConnectionDetails with the endpoint and the -// credentials taken from different services: connService supplies the endpoint -// and pooler, credService the password. Only a read replica needs them to -// differ — it connects to its own endpoint with the parent primary's -// credentials — so ConnectionTarget.Details is the only caller. -func getConnectionDetails(cfg *config.Config, connService, credService api.Service, opts ConnectionDetailsOptions) (*ConnectionDetails, error) { - if connService.Endpoint == nil { +// one) and looks up the password, from the target's credentials, when one is +// wanted. ConnectionTarget.Details adds the pooler check connecting needs. +func GetConnectionDetails(cfg *config.Config, target *ConnectionTarget, opts ConnectionDetailsOptions) (*ConnectionDetails, error) { + if target.Endpoint == nil { return nil, fmt.Errorf("service endpoint not available") } - endpoint := connService.Endpoint + endpoint := target.Endpoint isPooler := false - if opts.Pooled && hasPooler(connService.ConnectionPooler) { - endpoint = connService.ConnectionPooler.Endpoint + if opts.Pooled && hasPooler(target.Pooler) { + endpoint = target.Pooler.Endpoint isPooler = true } @@ -108,7 +100,7 @@ func getConnectionDetails(cfg *config.Config, connService, credService api.Servi if opts.WithPassword { if opts.InitialPassword != "" { details.Password = opts.InitialPassword - } else if password, err := GetPassword(cfg, credService, opts.Role); err == nil { + } else if password, err := GetPassword(cfg, target.Credentials.PasswordTarget, opts.Role); err == nil { details.Password = password } } @@ -132,12 +124,12 @@ func (d *ConnectionDetails) String() string { return fmt.Sprintf("postgresql://%s@%s:%d/%s?%s", userinfo, d.Host, d.Port, d.Database, query) } -// GetPassword fetches the password for the specified service from the -// configured password storage mechanism. It returns an error if it fails to -// find the password. -func GetPassword(cfg *config.Config, service api.Service, role string) (string, error) { +// GetPassword fetches the password stored for the target from the configured +// password storage mechanism. It returns an error if it fails to find the +// password. +func GetPassword(cfg *config.Config, target PasswordTarget, role string) (string, error) { storage := GetPasswordStorage(cfg) - password, err := storage.Get(service, role) + password, err := storage.Get(target, role) if err != nil { // Provide specific error messages based on storage type switch storage.(type) { @@ -161,7 +153,7 @@ func GetPassword(cfg *config.Config, service api.Service, role string) (string, // connectReadOnly opens a read-only connection to the target once it is ready. // The caller must close it. func connectReadOnly(ctx context.Context, cfg *config.Config, target *ConnectionTarget, role string, pooled bool) (*pgx.Conn, error) { - if err := CheckServiceReady(target.ConnectionService); err != nil { + if err := target.CheckReady(); err != nil { return nil, err } diff --git a/internal/common/connection_target.go b/internal/common/connection_target.go new file mode 100644 index 00000000..0d03fd01 --- /dev/null +++ b/internal/common/connection_target.go @@ -0,0 +1,175 @@ +package common + +import ( + "context" + "fmt" + "strings" + + "github.com/timescale/tiger-cli/internal/api" + "github.com/timescale/tiger-cli/internal/config" + "github.com/timescale/tiger-cli/internal/util" +) + +// ConnectionTarget is what a database connection goes to: a service or one of +// its read replica sets, reduced to what connecting to it and reporting on it +// need. +type ConnectionTarget struct { + Kind TargetKind + ID string + Name string + + // Status decides whether the target accepts connections (see CheckReady). + Status api.DeployStatus + + // Environment alone decides a session's read-only verdict, so a replica is + // judged on its own tag rather than its primary's. + Environment api.EnvironmentTag + + Endpoint *api.Endpoint + Pooler *api.ConnectionPooler + + // Credentials is whose passwords the connection uses: the target itself + // for a service, the primary for a read replica, which shares them. + Credentials CredentialOwner +} + +// CredentialOwner is the service whose passwords a connection uses. +type CredentialOwner struct { + PasswordTarget + + // Name names the owner in messages. + Name string + + // Environment is the owner's own tag, which decides whether read-only mode + // lets its passwords be changed. + Environment api.EnvironmentTag +} + +// TargetKind is the kind of resource a ConnectionTarget is. +type TargetKind int + +const ( + TargetService TargetKind = iota + TargetReadReplica +) + +// NewServiceConnectionTarget returns the ConnectionTarget of a service, +// connecting to its own endpoint with its own credentials. +func NewServiceConnectionTarget(service api.Service) *ConnectionTarget { + return &ConnectionTarget{ + Kind: TargetService, + ID: service.ServiceID, + Name: service.Name, + Status: service.Status, + Environment: ServiceEnvironmentTag(service), + Endpoint: service.Endpoint, + Pooler: service.ConnectionPooler, + Credentials: ServiceCredentials(service), + } +} + +// ServiceCredentials returns a service as the owner of the credentials its +// connections use, which its read replica sets share. +func ServiceCredentials(service api.Service) CredentialOwner { + return CredentialOwner{ + PasswordTarget: ServicePasswordTarget(service), + Name: service.Name, + Environment: ServiceEnvironmentTag(service), + } +} + +// NewReplicaConnectionTarget returns the ConnectionTarget of a read replica +// set. The replica supplies the endpoint, and credentials is its primary's +// (see ServiceCredentials), since a replica shares its primary's passwords. +func NewReplicaConnectionTarget(replica api.ReadReplicaSet, credentials CredentialOwner) *ConnectionTarget { + // Replica sets carry their own status enum. Map only "active" onto READY so + // a readiness check on this target (CheckReady) treats every other state — + // creating, resizing, error — as not ready. + status := api.DeployStatus("") + if replica.Status == api.ReadReplicaSetStatusActive { + status = api.DeployStatusREADY + } + + var environment *string + if replica.Metadata != nil { + environment = replica.Metadata.Environment + } + + return &ConnectionTarget{ + Kind: TargetReadReplica, + ID: replica.ID, + Name: replica.Name, + Status: status, + Environment: environmentTag(environment), + Endpoint: replica.Endpoint, + Pooler: replica.ConnectionPooler, + Credentials: credentials, + } +} + +// CheckReady returns nil only when the target accepts connections, and +// ErrPaused or ErrNotReady otherwise (see the CheckReady function). +func (t *ConnectionTarget) CheckReady() error { + return CheckReady(t.Status) +} + +// Details builds the target's connection details. A requested-but-unavailable +// pooler is a hard error for a service but silently falls back to direct for a +// replica (see ReplicaPoolerWarning). +func (t *ConnectionTarget) Details(cfg *config.Config, opts ConnectionDetailsOptions) (*ConnectionDetails, error) { + details, err := GetConnectionDetails(cfg, t, opts) + if err != nil { + return nil, fmt.Errorf("failed to build connection string: %w", err) + } + if opts.Pooled && !details.IsPooler && t.Kind != TargetReadReplica { + return nil, fmt.Errorf("connection pooler not available for this service") + } + return details, nil +} + +// ResolveConnectionTargetByID fetches the service named by id — which may be a +// primary service ID or a read replica set ID, both of which GetService +// resolves — and works out whose credentials it uses. Callers that already +// hold the service use NewConnectionTarget instead. +func ResolveConnectionTargetByID(ctx context.Context, client api.ClientWithResponsesInterface, projectID, id string) (*ConnectionTarget, error) { + service, err := GetService(ctx, client, projectID, id) + if err != nil { + return nil, err + } + return NewConnectionTarget(ctx, client, projectID, *service) +} + +// NewConnectionTarget returns the ConnectionTarget of an already-fetched +// service. A standby read replica connects to its own endpoint but shares the +// parent primary's credentials, so the parent is fetched here. +func NewConnectionTarget(ctx context.Context, client api.ClientWithResponsesInterface, projectID string, service api.Service) (*ConnectionTarget, error) { + target := NewServiceConnectionTarget(service) + if !IsReadReplica(service) { + return target, nil + } + target.Kind = TargetReadReplica + + // A replica with no parent recorded has nowhere else to look, so it stands + // in as its own credential owner. + parentID := util.DerefStr(service.ForkedFrom.ServiceID) + if parentID == "" { + return target, nil + } + + parent, err := GetService(ctx, client, projectID, parentID) + if err != nil { + return nil, fmt.Errorf("failed to fetch parent service %q for read replica: %w", parentID, err) + } + target.Credentials = ServiceCredentials(*parent) + return target, nil +} + +// environmentTag reads an optional environment tag. Anything but PROD reads +// as DEV, since the tag is optional and treating unknowns as protected would +// have read_only=prod block untagged services. +func environmentTag(environment *string) api.EnvironmentTag { + if strings.EqualFold(util.DerefStr(environment), string(api.EnvironmentTagPROD)) { + return api.EnvironmentTagPROD + } + return api.EnvironmentTagDEV +} diff --git a/internal/common/replica_test.go b/internal/common/connection_target_test.go similarity index 80% rename from internal/common/replica_test.go rename to internal/common/connection_target_test.go index bca4e5cb..a3f57205 100644 --- a/internal/common/replica_test.go +++ b/internal/common/connection_target_test.go @@ -53,6 +53,21 @@ func primaryService() api.Service { } } +// replicaSet returns an active read replica set of primaryService. +func replicaSet() api.ReadReplicaSet { + host := "replica.example.com" + port := 5432 + return api.ReadReplicaSet{ + ID: "rep1234567", + ServiceID: "svcprimary", + Name: "reporting-replica", + Status: api.ReadReplicaSetStatusActive, + Endpoint: &api.Endpoint{Host: &host, Port: &port}, + } +} + +// replicaService returns a standby read replica of primaryService, shaped +// the way GetService returns it when given a read replica set ID. func replicaService() api.Service { host := "replica.example.com" port := 5432 @@ -79,8 +94,8 @@ func TestResolveConnectionTargetByID(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - if target.IsReplica { - t.Error("expected primary target for a primary ID") + if target.Kind != TargetService || target.ID != "svcprimary" || target.Credentials.ID != "svcprimary" { + t.Errorf("expected primary target for a primary ID, got %+v", target) } // Replica ID → replica target with parent credentials. @@ -88,7 +103,7 @@ func TestResolveConnectionTargetByID(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - if !target.IsReplica || target.CredentialService.ServiceID != "svcprimary" { + if target.Kind != TargetReadReplica || target.ID != "rep1234567" || target.Credentials.ID != "svcprimary" { t.Errorf("expected replica target with parent credentials, got %+v", target) } @@ -108,15 +123,15 @@ func TestNewReplicaConnectionTarget(t *testing.T) { Endpoint: &api.Endpoint{Host: &host, Port: &port}, } - target := NewReplicaConnectionTarget(primary, replica) - if !target.IsReplica { + target := NewReplicaConnectionTarget(replica, ServiceCredentials(primary)) + if target.Kind != TargetReadReplica { t.Error("expected a replica target") } - if target.ConnectionService.ServiceID != "rep7654321" || util.DerefStr(target.ConnectionService.Endpoint.Host) != host { - t.Errorf("expected connect to carry the replica endpoint, got %+v", target.ConnectionService) + if target.ID != "rep7654321" || util.DerefStr(target.Endpoint.Host) != host { + t.Errorf("expected connect to carry the replica endpoint, got %+v", target) } - if target.CredentialService.ServiceID != "svcprimary" { - t.Errorf("expected credential to be the primary, got %q", target.CredentialService.ServiceID) + if target.Credentials.ID != "svcprimary" || target.Credentials.Name != "my-db" { + t.Errorf("expected credential to be the primary, got %+v", target.Credentials) } } @@ -154,9 +169,9 @@ func TestConnectionTargetReadOnlyVerdict(t *testing.T) { replica.Metadata = &api.ReplicaSetMetadata{Environment: new(tt.replicaTag)} } - target := NewReplicaConnectionTarget(primary, replica) + target := NewReplicaConnectionTarget(replica, ServiceCredentials(primary)) cfg := &config.Config{ReadOnly: tt.mode} - got := CheckReadOnly(cfg, ServiceEnvironmentTag(target.ConnectionService)) != nil + got := CheckReadOnly(cfg, target.Environment) != nil if got != tt.wantSession { t.Errorf("CheckReadOnly(read_only=%q, primary=%q, replica=%q) != nil = %t, want %t", tt.mode, tt.primaryTag, tt.replicaTag, got, tt.wantSession) @@ -178,12 +193,12 @@ func TestConnectionTargetDetails(t *testing.T) { // The replica supplies the endpoint, the primary the credentials — which // aren't exercised here, since WithPassword is off. - replicaTarget := func(overrides ...func(*api.Service)) *ConnectionTarget { - svc := replicaService() + replicaTarget := func(overrides ...func(*api.ReadReplicaSet)) *ConnectionTarget { + replica := replicaSet() for _, override := range overrides { - override(&svc) + override(&replica) } - return &ConnectionTarget{ConnectionService: svc, CredentialService: primaryService(), IsReplica: true} + return NewReplicaConnectionTarget(replica, ServiceCredentials(primaryService())) } cases := []struct { @@ -205,8 +220,8 @@ func TestConnectionTargetDetails(t *testing.T) { }, { name: "replica uses its pooler when one is available", - target: replicaTarget(func(s *api.Service) { - s.ConnectionPooler = pooler + target: replicaTarget(func(r *api.ReadReplicaSet) { + r.ConnectionPooler = pooler }), pooled: true, want: &ConnectionDetails{ @@ -233,14 +248,14 @@ func TestConnectionTargetDetails(t *testing.T) { { // For a primary the same request is a hard error instead. name: "primary refuses when its pooler is missing", - target: &ConnectionTarget{ConnectionService: primaryService(), CredentialService: primaryService()}, + target: NewServiceConnectionTarget(primaryService()), pooled: true, wantErr: "connection pooler not available for this service", }, { name: "missing endpoint is reported", - target: replicaTarget(func(s *api.Service) { - s.Endpoint = nil + target: replicaTarget(func(r *api.ReadReplicaSet) { + r.Endpoint = nil }), wantErr: "failed to build connection string: service endpoint not available", }, @@ -276,14 +291,14 @@ func TestConnectionTargetDetails(t *testing.T) { func TestReplicaPoolerWarning(t *testing.T) { host := "h" port := 6432 - withPooler := api.Service{ + withPooler := api.ReadReplicaSet{ Name: "rep-a", ConnectionPooler: &api.ConnectionPooler{Endpoint: &api.Endpoint{Host: &host, Port: &port}}, } - noPooler := api.Service{Name: "rep-b"} + noPooler := api.ReadReplicaSet{Name: "rep-b"} - replica := func(svc api.Service) *ConnectionTarget { - return &ConnectionTarget{ConnectionService: svc, CredentialService: primaryService(), IsReplica: true} + replica := func(replica api.ReadReplicaSet) *ConnectionTarget { + return NewReplicaConnectionTarget(replica, ServiceCredentials(primaryService())) } cases := []struct { @@ -292,7 +307,7 @@ func TestReplicaPoolerWarning(t *testing.T) { pooled bool wantWarning bool }{ - {"primary is never warned", &ConnectionTarget{ConnectionService: noPooler, CredentialService: noPooler}, true, false}, + {"primary is never warned", NewServiceConnectionTarget(primaryService()), true, false}, {"replica not pooled, no pooler", replica(noPooler), false, false}, {"replica not pooled, has pooler", replica(withPooler), false, false}, {"replica pooled, has pooler", replica(withPooler), true, false}, @@ -319,7 +334,7 @@ func TestResolveConnectionTargetByID_ReplicaParentFetchFails(t *testing.T) { func TestResolveConnectionTargetByID_ReplicaWithoutParentID(t *testing.T) { // A standby with no parent recorded has nowhere else to look for - // credentials, so it stands in as its own credential service. + // credentials, so it stands in as its own credential owner. replica := replicaService() replica.ForkedFrom.ServiceID = nil client := serviceTestClient(t, map[string]api.Service{"rep1234567": replica}) @@ -328,10 +343,10 @@ func TestResolveConnectionTargetByID_ReplicaWithoutParentID(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - if !target.IsReplica { + if target.Kind != TargetReadReplica { t.Error("expected a replica target") } - if target.CredentialService.ServiceID != "rep1234567" { - t.Errorf("expected the replica as its own credential service, got %q", target.CredentialService.ServiceID) + if target.Credentials.ID != "rep1234567" { + t.Errorf("expected the replica as its own credential owner, got %q", target.Credentials.ID) } } diff --git a/internal/common/connection_test.go b/internal/common/connection_test.go index 1e7e8669..ae127e50 100644 --- a/internal/common/connection_test.go +++ b/internal/common/connection_test.go @@ -181,7 +181,7 @@ func TestBuildConnectionString_Basic(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - result, err := GetConnectionDetails(testConfig(""), tc.service, tc.opts) + result, err := GetConnectionDetails(testConfig(""), NewServiceConnectionTarget(tc.service), tc.opts) if tc.expectError { if err == nil { @@ -230,13 +230,13 @@ func TestBuildConnectionString_WithPassword_KeyringStorage(t *testing.T) { testPassword := "test-password-keyring-123" role := "tsdbadmin" storage := GetPasswordStorage(cfg) - err := storage.Save(service, testPassword, role) + err := storage.Save(ServicePasswordTarget(service), testPassword, role) if err != nil { t.Fatalf("Failed to save test password: %v", err) } - defer storage.Remove(service, role) // Clean up after test + defer storage.Remove(ServicePasswordTarget(service), role) // Clean up after test - details, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + details, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: true, }) @@ -279,13 +279,13 @@ func TestBuildConnectionString_WithPassword_PgpassStorage(t *testing.T) { testPassword := "test-password-pgpass-456" role := "tsdbadmin" storage := GetPasswordStorage(cfg) - err := storage.Save(service, testPassword, role) + err := storage.Save(ServicePasswordTarget(service), testPassword, role) if err != nil { t.Fatalf("Failed to save test password: %v", err) } - defer storage.Remove(service, role) // Clean up after test + defer storage.Remove(ServicePasswordTarget(service), role) // Clean up after test - details, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + details, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: true, }) @@ -348,7 +348,7 @@ func TestBuildConnectionString_WithPassword_NoStorage(t *testing.T) { }, } - result, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + result, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: true, }) @@ -386,7 +386,7 @@ func TestBuildConnectionString_WithPassword_NoPasswordAvailable(t *testing.T) { }, } - result, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + result, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: true, }) @@ -425,12 +425,12 @@ func TestBuildConnectionString_ReadOnly_WithPassword(t *testing.T) { testPassword := "test-password-readonly-789" role := "tsdbadmin" storage := GetPasswordStorage(cfg) - if err := storage.Save(service, testPassword, role); err != nil { + if err := storage.Save(ServicePasswordTarget(service), testPassword, role); err != nil { t.Fatalf("Failed to save test password: %v", err) } - defer storage.Remove(service, role) + defer storage.Remove(ServicePasswordTarget(service), role) - details, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + details, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: role, WithPassword: true, ReadOnly: true, @@ -463,7 +463,7 @@ func TestBuildConnectionString_WithPassword_InvalidServiceEndpoint(t *testing.T) Endpoint: nil, // Invalid - no endpoint } - _, err := GetConnectionDetails(cfg, service, ConnectionDetailsOptions{ + _, err := GetConnectionDetails(cfg, NewServiceConnectionTarget(service), ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: true, }) diff --git a/internal/common/password_storage.go b/internal/common/password_storage.go index 3349233b..649b5492 100644 --- a/internal/common/password_storage.go +++ b/internal/common/password_storage.go @@ -13,19 +13,37 @@ import ( "github.com/timescale/tiger-cli/internal/config" ) -// buildPasswordKeyringUsername creates a unique keyring username for service passwords -func buildPasswordKeyringUsername(service api.Service, role string) (string, error) { - if service.ServiceID == "" { +// PasswordTarget is what a stored password belongs to. The keyring keys a +// password by project and ID, and ~/.pgpass by the endpoint's host and port. +type PasswordTarget struct { + ProjectID string + ID string + Endpoint *api.Endpoint +} + +// ServicePasswordTarget returns the PasswordTarget of a service's own +// passwords. +func ServicePasswordTarget(service api.Service) PasswordTarget { + return PasswordTarget{ + ProjectID: service.ProjectID, + ID: service.ServiceID, + Endpoint: service.Endpoint, + } +} + +// buildPasswordKeyringUsername creates a unique keyring username for a password +func buildPasswordKeyringUsername(target PasswordTarget, role string) (string, error) { + if target.ID == "" { return "", fmt.Errorf("service ID is required") } - if service.ProjectID == "" { + if target.ProjectID == "" { return "", fmt.Errorf("project ID is required") } if role == "" { return "", fmt.Errorf("role is required") } - return fmt.Sprintf("password-%s-%s-%s", service.ProjectID, service.ServiceID, role), nil + return fmt.Sprintf("password-%s-%s-%s", target.ProjectID, target.ID, role), nil } // sanitizeErrorMessage removes sensitive information from error messages @@ -50,17 +68,17 @@ type PasswordStorageResult struct { // PasswordStorage defines the interface for password storage implementations type PasswordStorage interface { - Save(service api.Service, password string, role string) error - Get(service api.Service, role string) (string, error) - Remove(service api.Service, role string) error + Save(target PasswordTarget, password string, role string) error + Get(target PasswordTarget, role string) (string, error) + Remove(target PasswordTarget, role string) error GetStorageResult(err error, password string) PasswordStorageResult } // KeyringStorage implements password storage using system keyring type KeyringStorage struct{} -func (k *KeyringStorage) Save(service api.Service, password string, role string) error { - username, err := buildPasswordKeyringUsername(service, role) +func (k *KeyringStorage) Save(target PasswordTarget, password string, role string) error { + username, err := buildPasswordKeyringUsername(target, role) if err != nil { return err } @@ -68,8 +86,8 @@ func (k *KeyringStorage) Save(service api.Service, password string, role string) return keyring.Set(config.KeyringServiceName, username, password) } -func (k *KeyringStorage) Get(service api.Service, role string) (string, error) { - username, err := buildPasswordKeyringUsername(service, role) +func (k *KeyringStorage) Get(target PasswordTarget, role string) (string, error) { + username, err := buildPasswordKeyringUsername(target, role) if err != nil { return "", err } @@ -77,8 +95,8 @@ func (k *KeyringStorage) Get(service api.Service, role string) (string, error) { return keyring.Get(config.KeyringServiceName, username) } -func (k *KeyringStorage) Remove(service api.Service, role string) error { - username, err := buildPasswordKeyringUsername(service, role) +func (k *KeyringStorage) Remove(target PasswordTarget, role string) error { + username, err := buildPasswordKeyringUsername(target, role) if err != nil { return err } @@ -105,8 +123,8 @@ func (k *KeyringStorage) GetStorageResult(err error, password string) PasswordSt // PgpassStorage implements password storage using ~/.pgpass file type PgpassStorage struct{} -func (p *PgpassStorage) Save(service api.Service, password string, role string) error { - if service.Endpoint == nil || service.Endpoint.Host == nil { +func (p *PgpassStorage) Save(target PasswordTarget, password string, role string) error { + if target.Endpoint == nil || target.Endpoint.Host == nil || target.Endpoint.Port == nil { return fmt.Errorf("service endpoint not available") } if role == "" { @@ -119,11 +137,8 @@ func (p *PgpassStorage) Save(service api.Service, password string, role string) } pgpassPath := filepath.Join(homeDir, ".pgpass") - host := *service.Endpoint.Host - port := "5432" // default PostgreSQL port - if service.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.Endpoint.Port) - } + host := *target.Endpoint.Host + port := fmt.Sprintf("%d", *target.Endpoint.Port) database := "tsdb" // TimescaleDB database name username := role // Use the provided role as username @@ -149,8 +164,8 @@ func (p *PgpassStorage) Save(service api.Service, password string, role string) return nil } -func (p *PgpassStorage) Get(service api.Service, role string) (string, error) { - if service.Endpoint == nil || service.Endpoint.Host == nil { +func (p *PgpassStorage) Get(target PasswordTarget, role string) (string, error) { + if target.Endpoint == nil || target.Endpoint.Host == nil || target.Endpoint.Port == nil { return "", fmt.Errorf("service endpoint not available") } if role == "" { @@ -169,11 +184,8 @@ func (p *PgpassStorage) Get(service api.Service, role string) (string, error) { return "", fmt.Errorf("no .pgpass file found") } - host := *service.Endpoint.Host - port := "5432" - if service.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.Endpoint.Port) - } + host := *target.Endpoint.Host + port := fmt.Sprintf("%d", *target.Endpoint.Port) username := role // Read and parse .pgpass file @@ -203,8 +215,8 @@ func (p *PgpassStorage) Get(service api.Service, role string) (string, error) { return "", fmt.Errorf("no matching entry found in .pgpass file") } -func (p *PgpassStorage) Remove(service api.Service, role string) error { - if service.Endpoint == nil || service.Endpoint.Host == nil { +func (p *PgpassStorage) Remove(target PasswordTarget, role string) error { + if target.Endpoint == nil || target.Endpoint.Host == nil || target.Endpoint.Port == nil { return fmt.Errorf("service endpoint not available") } if role == "" { @@ -217,11 +229,8 @@ func (p *PgpassStorage) Remove(service api.Service, role string) error { } pgpassPath := filepath.Join(homeDir, ".pgpass") - host := *service.Endpoint.Host - port := "5432" - if service.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.Endpoint.Port) - } + host := *target.Endpoint.Host + port := fmt.Sprintf("%d", *target.Endpoint.Port) username := role return p.removeEntry(pgpassPath, host, port, username) @@ -304,15 +313,15 @@ func (p *PgpassStorage) GetStorageResult(err error, password string) PasswordSto // NoStorage implements no password storage (passwords are not saved) type NoStorage struct{} -func (n *NoStorage) Save(service api.Service, password string, role string) error { +func (n *NoStorage) Save(target PasswordTarget, password string, role string) error { return nil // Do nothing } -func (n *NoStorage) Get(service api.Service, role string) (string, error) { +func (n *NoStorage) Get(target PasswordTarget, role string) (string, error) { return "", fmt.Errorf("password storage disabled") } -func (n *NoStorage) Remove(service api.Service, role string) error { +func (n *NoStorage) Remove(target PasswordTarget, role string) error { return nil // Do nothing } @@ -339,7 +348,7 @@ func GetPasswordStorage(cfg *config.Config) PasswordStorage { } // SavePasswordWithResult handles saving a password and returns both error and result info -func SavePasswordWithResult(cfg *config.Config, service api.Service, password string, role string) (PasswordStorageResult, error) { +func SavePasswordWithResult(cfg *config.Config, target PasswordTarget, password string, role string) (PasswordStorageResult, error) { if password == "" { return PasswordStorageResult{ Success: false, @@ -356,7 +365,7 @@ func SavePasswordWithResult(cfg *config.Config, service api.Service, password st } storage := GetPasswordStorage(cfg) - err := storage.Save(service, password, role) + err := storage.Save(target, password, role) result := storage.GetStorageResult(err, password) return result, err diff --git a/internal/common/password_storage_test.go b/internal/common/password_storage_test.go index 9ffc68e3..7c2b88ca 100644 --- a/internal/common/password_storage_test.go +++ b/internal/common/password_storage_test.go @@ -30,7 +30,7 @@ func TestNoStorage_Save(t *testing.T) { storage := &NoStorage{} service := createTestService("test-service-123") - err := storage.Save(service, "test-password", "tsdbadmin") + err := storage.Save(ServicePasswordTarget(service), "test-password", "tsdbadmin") if err != nil { t.Errorf("NoStorage.Save() should never return an error, got: %v", err) } @@ -40,7 +40,7 @@ func TestNoStorage_Get(t *testing.T) { storage := &NoStorage{} service := createTestService("test-service-123") - password, err := storage.Get(service, "tsdbadmin") + password, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("NoStorage.Get() should return an error") } @@ -56,7 +56,7 @@ func TestNoStorage_Remove(t *testing.T) { storage := &NoStorage{} service := createTestService("test-service-123") - err := storage.Remove(service, "tsdbadmin") + err := storage.Remove(ServicePasswordTarget(service), "tsdbadmin") if err != nil { t.Errorf("NoStorage.Remove() should never return an error, got: %v", err) } @@ -66,7 +66,7 @@ func TestKeyringStorage_Save_NoServiceId(t *testing.T) { storage := &KeyringStorage{} service := api.Service{} // No ServiceID - err := storage.Save(service, "test-password", "tsdbadmin") + err := storage.Save(ServicePasswordTarget(service), "test-password", "tsdbadmin") if err == nil { t.Error("KeyringStorage.Save() should return error when ServiceID is nil") } @@ -83,7 +83,7 @@ func TestKeyringStorage_Save_NoProjectId(t *testing.T) { // No ProjectID } - err := storage.Save(service, "test-password", "tsdbadmin") + err := storage.Save(ServicePasswordTarget(service), "test-password", "tsdbadmin") if err == nil { t.Error("KeyringStorage.Save() should return error when ProjectID is nil") } @@ -96,7 +96,7 @@ func TestKeyringStorage_Save_NoRole(t *testing.T) { storage := &KeyringStorage{} service := createTestService("test-service-123") - err := storage.Save(service, "test-password", "") + err := storage.Save(ServicePasswordTarget(service), "test-password", "") if err == nil { t.Error("KeyringStorage.Save() should return error when role is empty") } @@ -109,7 +109,7 @@ func TestKeyringStorage_Get_NoServiceId(t *testing.T) { storage := &KeyringStorage{} service := api.Service{} // No ServiceID - password, err := storage.Get(service, "tsdbadmin") + password, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("KeyringStorage.Get() should return error when ServiceID is nil") } @@ -129,7 +129,7 @@ func TestKeyringStorage_Get_NoProjectId(t *testing.T) { // No ProjectID } - password, err := storage.Get(service, "tsdbadmin") + password, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("KeyringStorage.Get() should return error when ProjectID is nil") } @@ -145,7 +145,7 @@ func TestKeyringStorage_Get_NoRole(t *testing.T) { storage := &KeyringStorage{} service := createTestService("test-service-123") - password, err := storage.Get(service, "") + password, err := storage.Get(ServicePasswordTarget(service), "") if err == nil { t.Error("KeyringStorage.Get() should return error when role is empty") } @@ -161,7 +161,7 @@ func TestKeyringStorage_Remove_NoServiceId(t *testing.T) { storage := &KeyringStorage{} service := api.Service{} // No ServiceID - err := storage.Remove(service, "tsdbadmin") + err := storage.Remove(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("KeyringStorage.Remove() should return error when ServiceID is nil") } @@ -178,7 +178,7 @@ func TestKeyringStorage_Remove_NoProjectId(t *testing.T) { // No ProjectID } - err := storage.Remove(service, "tsdbadmin") + err := storage.Remove(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("KeyringStorage.Remove() should return error when ProjectID is nil") } @@ -191,7 +191,7 @@ func TestKeyringStorage_Remove_NoRole(t *testing.T) { storage := &KeyringStorage{} service := createTestService("test-service-123") - err := storage.Remove(service, "") + err := storage.Remove(ServicePasswordTarget(service), "") if err == nil { t.Error("KeyringStorage.Remove() should return error when role is empty") } @@ -207,7 +207,7 @@ func TestPgpassStorage_Remove_NoEndpoint(t *testing.T) { // No Endpoint } - err := storage.Remove(service, "tsdbadmin") + err := storage.Remove(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("PgpassStorage.Remove() should return error when endpoint is nil") } @@ -216,11 +216,29 @@ func TestPgpassStorage_Remove_NoEndpoint(t *testing.T) { } } +// An entry is keyed by host and port, and no port is guessed, so an endpoint +// without one can't be saved, looked up, or removed. +func TestPgpassStorage_NoPort(t *testing.T) { + storage := &PgpassStorage{} + service := createTestService("test-service-123") + service.Endpoint.Port = nil + + if err := storage.Save(ServicePasswordTarget(service), "secret", "tsdbadmin"); err == nil || err.Error() != "service endpoint not available" { + t.Errorf("PgpassStorage.Save() error = %v, want service endpoint not available", err) + } + if _, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin"); err == nil || err.Error() != "service endpoint not available" { + t.Errorf("PgpassStorage.Get() error = %v, want service endpoint not available", err) + } + if err := storage.Remove(ServicePasswordTarget(service), "tsdbadmin"); err == nil || err.Error() != "service endpoint not available" { + t.Errorf("PgpassStorage.Remove() error = %v, want service endpoint not available", err) + } +} + func TestPgpassStorage_Remove_NoRole(t *testing.T) { storage := &PgpassStorage{} service := createTestService("test-service-123") - err := storage.Remove(service, "") + err := storage.Remove(ServicePasswordTarget(service), "") if err == nil { t.Error("PgpassStorage.Remove() should return error when role is empty") } @@ -236,7 +254,7 @@ func TestPgpassStorage_Get_NoEndpoint(t *testing.T) { // No Endpoint } - password, err := storage.Get(service, "tsdbadmin") + password, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("PgpassStorage.Get() should return error when endpoint is nil") } @@ -252,7 +270,7 @@ func TestPgpassStorage_Get_NoRole(t *testing.T) { storage := &PgpassStorage{} service := createTestService("test-service-123") - password, err := storage.Get(service, "") + password, err := storage.Get(ServicePasswordTarget(service), "") if err == nil { t.Error("PgpassStorage.Get() should return error when role is empty") } @@ -274,7 +292,7 @@ func TestPgpassStorage_Get_NoFile(t *testing.T) { storage := &PgpassStorage{} service := createTestService("test-service-123") - password, err := storage.Get(service, "tsdbadmin") + password, err := storage.Get(ServicePasswordTarget(service), "tsdbadmin") if err == nil { t.Error("PgpassStorage.Get() should return error when .pgpass file doesn't exist") } @@ -334,7 +352,7 @@ func TestPasswordStorage_DifferentRoles(t *testing.T) { cleanup: func(t *testing.T, service api.Service, roles []string) { storage := &KeyringStorage{} for _, role := range roles { - storage.Remove(service, role) + storage.Remove(ServicePasswordTarget(service), role) } }, }, @@ -380,7 +398,7 @@ func TestPasswordStorage_DifferentRoles(t *testing.T) { // Save passwords for all roles for _, r := range roles { - err := tt.storage.Save(service, r.password, r.role) + err := tt.storage.Save(ServicePasswordTarget(service), r.password, r.role) if _, ok := tt.storage.(*NoStorage); ok { continue } @@ -391,7 +409,7 @@ func TestPasswordStorage_DifferentRoles(t *testing.T) { // Verify each role has its own password stored separately for _, r := range roles { - retrieved, err := tt.storage.Get(service, r.role) + retrieved, err := tt.storage.Get(ServicePasswordTarget(service), r.role) if _, ok := tt.storage.(*NoStorage); ok { if err == nil { t.Error("NoStorage.Get() should always return error") @@ -408,20 +426,20 @@ func TestPasswordStorage_DifferentRoles(t *testing.T) { // Verify removing one role doesn't affect others if _, ok := tt.storage.(*NoStorage); !ok { - err := tt.storage.Remove(service, roles[0].role) + err := tt.storage.Remove(ServicePasswordTarget(service), roles[0].role) if err != nil { t.Fatalf("Remove(%s) failed: %v", roles[0].role, err) } // First role should be gone - _, err = tt.storage.Get(service, roles[0].role) + _, err = tt.storage.Get(ServicePasswordTarget(service), roles[0].role) if err == nil { t.Errorf("Get(%s) should fail after removal", roles[0].role) } // Other roles should still exist for _, r := range roles[1:] { - retrieved, err := tt.storage.Get(service, r.role) + retrieved, err := tt.storage.Get(ServicePasswordTarget(service), r.role) if err != nil { t.Errorf("Get(%s) should still work after removing %s: %v", r.role, roles[0].role, err) } @@ -450,7 +468,7 @@ func TestPgpassStorage_Integration(t *testing.T) { role := "tsdbadmin" // Test Save - err := storage.Save(service, password, role) + err := storage.Save(ServicePasswordTarget(service), password, role) if err != nil { t.Fatalf("PgpassStorage.Save() failed: %v", err) } @@ -473,7 +491,7 @@ func TestPgpassStorage_Integration(t *testing.T) { } // Test Get - retrievedPassword, err := storage.Get(service, role) + retrievedPassword, err := storage.Get(ServicePasswordTarget(service), role) if err != nil { t.Fatalf("PgpassStorage.Get() failed: %v", err) } @@ -482,7 +500,7 @@ func TestPgpassStorage_Integration(t *testing.T) { } // Test Remove - err = storage.Remove(service, role) + err = storage.Remove(ServicePasswordTarget(service), role) if err != nil { t.Fatalf("PgpassStorage.Remove() failed: %v", err) } @@ -620,7 +638,7 @@ func TestPgpassStorage_GetStorageResult_Error(t *testing.T) { func TestSavePasswordWithResult_EmptyPassword(t *testing.T) { service := createTestService("test-service-123") - result, err := SavePasswordWithResult(testConfig(""), service, "", "tsdbadmin") + result, err := SavePasswordWithResult(testConfig(""), ServicePasswordTarget(service), "", "tsdbadmin") if err != nil { t.Errorf("SavePasswordWithResult() with empty password should not return error, got: %v", err) } @@ -639,7 +657,7 @@ func TestSavePasswordWithResult_WithPassword(t *testing.T) { service := createTestService("test-service-123") // Use NoStorage for predictable behavior - result, err := SavePasswordWithResult(testConfig("none"), service, "test-password", "tsdbadmin") + result, err := SavePasswordWithResult(testConfig("none"), ServicePasswordTarget(service), "test-password", "tsdbadmin") if err != nil { t.Errorf("SavePasswordWithResult() should not return error with NoStorage, got: %v", err) } @@ -769,7 +787,7 @@ func TestBuildPasswordKeyringUsername(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - result, err := buildPasswordKeyringUsername(tt.service, tt.role) + result, err := buildPasswordKeyringUsername(ServicePasswordTarget(tt.service), tt.role) if tt.expectError && err == nil { t.Errorf("buildPasswordKeyringUsername() expected error but got none") @@ -801,7 +819,7 @@ func TestPasswordStorage_OverwritePreviousValue(t *testing.T) { }, cleanup: func(t *testing.T, service api.Service) { storage := &KeyringStorage{} - storage.Remove(service, "tsdbadmin") // Ignore errors in cleanup + storage.Remove(ServicePasswordTarget(service), "tsdbadmin") // Ignore errors in cleanup }, }, { @@ -839,10 +857,10 @@ func TestPasswordStorage_OverwritePreviousValue(t *testing.T) { role := "tsdbadmin" // Save original password - err1 := tt.storage.Save(service, originalPassword, role) + err1 := tt.storage.Save(ServicePasswordTarget(service), originalPassword, role) // Save new password (should overwrite) - err2 := tt.storage.Save(service, newPassword, role) + err2 := tt.storage.Save(ServicePasswordTarget(service), newPassword, role) // Handle NoStorage specially (always succeeds but doesn't store) if _, ok := tt.storage.(*NoStorage); ok { @@ -850,7 +868,7 @@ func TestPasswordStorage_OverwritePreviousValue(t *testing.T) { t.Errorf("NoStorage.Save() should not return error, got first: %v, second: %v", err1, err2) } // NoStorage.Get() always returns error, so we can't test retrieval - _, err := tt.storage.Get(service, role) + _, err := tt.storage.Get(ServicePasswordTarget(service), role) if err == nil { t.Error("NoStorage.Get() should always return error") } @@ -870,7 +888,7 @@ func TestPasswordStorage_OverwritePreviousValue(t *testing.T) { } // Get the stored password - should be the new one - retrieved, err := tt.storage.Get(service, role) + retrieved, err := tt.storage.Get(ServicePasswordTarget(service), role) if err != nil { t.Fatalf("Get() failed: %v", err) } diff --git a/internal/common/query.go b/internal/common/query.go index f746a64c..b99f5a28 100644 --- a/internal/common/query.go +++ b/internal/common/query.go @@ -69,7 +69,7 @@ type ExecuteQueryArgs struct { var ExecuteQuery = func(ctx context.Context, cfg *config.Config, target *ConnectionTarget, args ExecuteQueryArgs) (*QueryResult, error) { // Fail with "service is paused"/"service is not ready" rather than an // opaque connection error. - if err := CheckServiceReady(target.ConnectionService); err != nil { + if err := target.CheckReady(); err != nil { return nil, err } diff --git a/internal/common/ready.go b/internal/common/ready.go index fdf9f534..f9b132b4 100644 --- a/internal/common/ready.go +++ b/internal/common/ready.go @@ -15,10 +15,10 @@ var ( ErrNotReady = errors.New("service is not ready") ) -// CheckServiceReady returns nil only when the service is READY, ErrPaused for +// CheckReady returns nil only for a READY status, ErrPaused for // PAUSED/PAUSING, and ErrNotReady for every other (or unknown) status. -func CheckServiceReady(service api.Service) error { - switch service.Status { +func CheckReady(status api.DeployStatus) error { + switch status { case api.DeployStatusREADY: return nil case api.DeployStatusPAUSED, api.DeployStatusPAUSING: diff --git a/internal/common/ready_test.go b/internal/common/ready_test.go index e743c37c..ff0f942e 100644 --- a/internal/common/ready_test.go +++ b/internal/common/ready_test.go @@ -7,7 +7,7 @@ import ( "github.com/timescale/tiger-cli/internal/api" ) -func TestCheckServiceReady(t *testing.T) { +func TestCheckReady(t *testing.T) { tests := []struct { name string status api.DeployStatus @@ -30,9 +30,9 @@ func TestCheckServiceReady(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err := CheckServiceReady(api.Service{Status: tt.status}) + err := CheckReady(tt.status) if !errors.Is(err, tt.wantErr) { - t.Errorf("CheckServiceReady() = %v, want %v", err, tt.wantErr) + t.Errorf("CheckReady() = %v, want %v", err, tt.wantErr) } }) } diff --git a/internal/common/replica.go b/internal/common/replica.go index 10cccb1e..b3f24501 100644 --- a/internal/common/replica.go +++ b/internal/common/replica.go @@ -1,108 +1,12 @@ package common import ( - "context" - "fmt" - "github.com/timescale/tiger-cli/internal/api" - "github.com/timescale/tiger-cli/internal/config" "github.com/timescale/tiger-cli/internal/util" ) -// ConnectionTarget is the service to connect to plus the service whose -// credentials to use. They're the same for a primary; for a read replica the -// CredentialService is the parent primary, whose credentials it shares. -type ConnectionTarget struct { - // ConnectionService alone decides a session's read-only verdict, so a replica - // is judged on its own environment tag rather than its primary's. - ConnectionService api.Service - CredentialService api.Service - IsReplica bool -} - -// Details builds the target's connection details. A requested-but-unavailable -// pooler is a hard error for a primary but silently falls back to direct for a -// replica (see ReplicaPoolerWarning). -func (t *ConnectionTarget) Details(cfg *config.Config, opts ConnectionDetailsOptions) (*ConnectionDetails, error) { - details, err := getConnectionDetails(cfg, t.ConnectionService, t.CredentialService, opts) - if err != nil { - return nil, fmt.Errorf("failed to build connection string: %w", err) - } - if opts.Pooled && !details.IsPooler && !t.IsReplica { - return nil, fmt.Errorf("connection pooler not available for this service") - } - return details, nil -} - // IsReadReplica reports whether the service is a standby read replica (which // shares its parent primary's credentials). func IsReadReplica(service api.Service) bool { return service.ForkedFrom != nil && util.Deref(service.ForkedFrom.IsStandby) } - -// ResolveConnectionTargetByID fetches the service named by id — which may be a -// primary service ID or a read replica set ID, both of which GetService -// resolves — and works out which service holds its credentials. Callers that -// already hold the service use NewConnectionTarget instead. -func ResolveConnectionTargetByID(ctx context.Context, client api.ClientWithResponsesInterface, projectID, id string) (*ConnectionTarget, error) { - service, err := GetService(ctx, client, projectID, id) - if err != nil { - return nil, err - } - return NewConnectionTarget(ctx, client, projectID, *service) -} - -// NewConnectionTarget works out which service holds the credentials for an -// already-fetched service. A standby read replica connects to its own endpoint -// but shares the parent primary's password, so the parent is fetched here. -func NewConnectionTarget(ctx context.Context, client api.ClientWithResponsesInterface, projectID string, service api.Service) (*ConnectionTarget, error) { - if !IsReadReplica(service) { - return &ConnectionTarget{ConnectionService: service, CredentialService: service}, nil - } - - // A replica with no parent recorded has nowhere else to look, so it stands - // in as its own credential service. - parentID := util.DerefStr(service.ForkedFrom.ServiceID) - if parentID == "" { - return &ConnectionTarget{ConnectionService: service, CredentialService: service, IsReplica: true}, nil - } - - parent, err := GetService(ctx, client, projectID, parentID) - if err != nil { - return nil, fmt.Errorf("failed to fetch parent service %q for read replica: %w", parentID, err) - } - return &ConnectionTarget{ConnectionService: service, CredentialService: *parent, IsReplica: true}, nil -} - -// NewReplicaConnectionTarget builds a ConnectionTarget for connecting to one of -// a service's read replica sets (as listed via the /replicaSets endpoint). The -// replica supplies the endpoint; the primary supplies the credentials. -func NewReplicaConnectionTarget(primary api.Service, replica api.ReadReplicaSet) *ConnectionTarget { - // Carry the replica's own tag over. ReplicaSetMetadata and ServiceMetadata are - // separate types holding the same field, so it's copied rather than assigned. - var metadata *api.ServiceMetadata - if replica.Metadata != nil { - metadata = &api.ServiceMetadata{Environment: replica.Metadata.Environment} - } - - // Replica sets carry their own status enum. Map only "active" onto READY so - // a readiness check on this target (CheckServiceReady) treats every other - // state — creating, resizing, error — as not ready. - status := api.DeployStatus("") - if replica.Status == api.ReadReplicaSetStatusActive { - status = api.DeployStatusREADY - } - - return &ConnectionTarget{ - ConnectionService: api.Service{ - ServiceID: replica.ID, - Name: replica.Name, - Status: status, - Endpoint: replica.Endpoint, - ConnectionPooler: replica.ConnectionPooler, - Metadata: metadata, - }, - CredentialService: primary, - IsReplica: true, - } -} diff --git a/internal/common/schema.go b/internal/common/schema.go index f4a4b4f6..b0add6e1 100644 --- a/internal/common/schema.go +++ b/internal/common/schema.go @@ -1125,8 +1125,8 @@ var FetchServiceSchema = func(ctx context.Context, cfg *config.Config, target *C defer conn.Close(context.Background()) ident := SchemaIdent{ - ID: target.ConnectionService.ServiceID, - Name: target.ConnectionService.Name, + ID: target.ID, + Name: target.Name, } return fetchSchemaFromConn(ctx, conn, ident, args) } diff --git a/internal/common/service.go b/internal/common/service.go index e71ed503..bca3e2cc 100644 --- a/internal/common/service.go +++ b/internal/common/service.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/timescale/tiger-cli/internal/api" - "github.com/timescale/tiger-cli/internal/util" ) // GenerateServiceName matches the front-end logic for generating a random @@ -26,11 +25,7 @@ func ServiceEnvironmentTag(service api.Service) api.EnvironmentTag { if service.Metadata == nil { return api.EnvironmentTagDEV } - - if strings.EqualFold(util.DerefStr(service.Metadata.Environment), string(api.EnvironmentTagPROD)) { - return api.EnvironmentTagPROD - } - return api.EnvironmentTagDEV + return environmentTag(service.Metadata.Environment) } // GetService fetches a single service by ID. The API resolves both primary diff --git a/internal/mcp/db_extensions_list_test.go b/internal/mcp/db_extensions_list_test.go index c6b1b4c1..65faca76 100644 --- a/internal/mcp/db_extensions_list_test.go +++ b/internal/mcp/db_extensions_list_test.go @@ -52,9 +52,12 @@ func TestDBExtensionsListTool(t *testing.T) { } primary := sampleService() - primaryTarget := &common.ConnectionTarget{ConnectionService: primary, CredentialService: primary} + primaryTarget := common.NewServiceConnectionTarget(primary) replica := sampleReplica(func(s *api.Service) { s.Status = api.DeployStatusREADY }) - replicaTarget := &common.ConnectionTarget{ConnectionService: replica, CredentialService: primary, IsReplica: true} + // A replica connects to its own endpoint with its primary's credentials. + replicaTarget := common.NewServiceConnectionTarget(replica) + replicaTarget.Kind = common.TargetReadReplica + replicaTarget.Credentials = common.ServiceCredentials(primary) runToolTests(t, []toolTest{ { diff --git a/internal/mcp/db_query.go b/internal/mcp/db_query.go index 160ec3bd..dcddd87e 100644 --- a/internal/mcp/db_query.go +++ b/internal/mcp/db_query.go @@ -169,7 +169,7 @@ func (s *Server) handleDBQuery(ctx context.Context, req *mcp.CallToolRequest, in } // Under prod mode the resolved target's tag decides. - readOnlySession := common.CheckReadOnly(cfg, common.ServiceEnvironmentTag(target.ConnectionService)) != nil + readOnlySession := common.CheckReadOnly(cfg, target.Environment) != nil // A replica without a pooler connects directly; surface that as a warning. poolerWarning := common.ReplicaPoolerWarning(target, input.Pooled) diff --git a/internal/mcp/service_create.go b/internal/mcp/service_create.go index aa658631..cf477edf 100644 --- a/internal/mcp/service_create.go +++ b/internal/mcp/service_create.go @@ -222,7 +222,7 @@ func (s *Server) handleServiceCreate(ctx context.Context, req *mcp.CallToolReque // This ensures the password is stored even if the wait fails or is interrupted var passwordStorage *common.PasswordStorageResult if service.InitialPassword != nil { - result, err := common.SavePasswordWithResult(cfg, api.Service(service), *service.InitialPassword, "tsdbadmin") + result, err := common.SavePasswordWithResult(cfg, common.ServicePasswordTarget(service), *service.InitialPassword, "tsdbadmin") passwordStorage = &result if err != nil { s.logger.Warn("MCP: Password storage failed", slog.Any("error", err)) diff --git a/internal/mcp/service_fork.go b/internal/mcp/service_fork.go index e7031b34..35102d2d 100644 --- a/internal/mcp/service_fork.go +++ b/internal/mcp/service_fork.go @@ -209,7 +209,7 @@ func (s *Server) handleServiceFork(ctx context.Context, req *mcp.CallToolRequest // This ensures the password is stored even if the wait fails or is interrupted var passwordStorage *common.PasswordStorageResult if service.InitialPassword != nil { - result, err := common.SavePasswordWithResult(cfg, api.Service(service), *service.InitialPassword, "tsdbadmin") + result, err := common.SavePasswordWithResult(cfg, common.ServicePasswordTarget(service), *service.InitialPassword, "tsdbadmin") passwordStorage = &result if err != nil { s.logger.Warn("MCP: Password storage failed", slog.Any("error", err)) diff --git a/internal/mcp/service_get_test.go b/internal/mcp/service_get_test.go index 28919f5b..27aa70f1 100644 --- a/internal/mcp/service_get_test.go +++ b/internal/mcp/service_get_test.go @@ -142,6 +142,33 @@ func TestServiceGetTool(t *testing.T) { mock: setupGet(fullService), wantOutput: full, }, + { + // No port is guessed, for the direct endpoint or the pooler, so + // an endpoint without one isn't returned or connected to. + name: "endpoints without a port", + tool: toolServiceGet, + args: args, + mock: setupGet(sampleService(func(s *api.Service) { + s.Created = created + s.Endpoint = &api.Endpoint{Host: new("e6ue9697jf.project.tsdb.cloud.timescale.com")} + s.ConnectionPooler = &api.ConnectionPooler{ + Endpoint: &api.Endpoint{Host: new("e6ue9697jf.project.pooler.tsdb.cloud.timescale.com")}, + } + })), + wantOutput: map[string]any{ + "service": map[string]any{ + "id": "e6ue9697jf", + "name": "test-service", + "status": "READY", + "type": "TIMESCALEDB", + "region": "us-east-1", + "created": "2025-01-15T09:30:00Z", + "environment": "DEV", + "replicas": float64(0), + "connection_string": "", + }, + }, + }, { // The platform and IOPS are preview fields: the case above carries // them and drops them, while this one returns them. diff --git a/internal/mcp/service_update_password.go b/internal/mcp/service_update_password.go index a8ef3c49..14b0c0ec 100644 --- a/internal/mcp/service_update_password.go +++ b/internal/mcp/service_update_password.go @@ -147,11 +147,11 @@ func (s *Server) handleServiceUpdatePassword(ctx context.Context, req *mcp.CallT if err != nil { return nil, ServiceUpdatePasswordOutput{}, fmt.Errorf("failed to update service password: %w", err) } - if resp.StatusCode() != http.StatusOK && resp.StatusCode() != http.StatusNoContent { + if resp.StatusCode() != http.StatusNoContent { return nil, ServiceUpdatePasswordOutput{}, common.ExitWithErrorFromStatusCode(resp.StatusCode(), resp.JSON4XX) } - storage, err := common.SavePasswordWithResult(cfg, *service, password, "tsdbadmin") + storage, err := common.SavePasswordWithResult(cfg, common.ServicePasswordTarget(*service), password, "tsdbadmin") if err != nil { s.logger.Warn("MCP: Password storage failed", slog.Any("error", err)) } else { diff --git a/internal/mcp/service_update_password_test.go b/internal/mcp/service_update_password_test.go index aa1cfb42..55cfad22 100644 --- a/internal/mcp/service_update_password_test.go +++ b/internal/mcp/service_update_password_test.go @@ -50,7 +50,7 @@ func TestServiceUpdatePasswordTool(t *testing.T) { expectTaggedServiceAndUpdate := func(tag string, calls int) func(*mocks.MockClientWithResponsesInterface) { return func(m *mocks.MockClientWithResponsesInterface) { expectTaggedService(tag, calls)(m) - expectUpdate(http.StatusOK)(m) + expectUpdate(http.StatusNoContent)(m) } } @@ -201,7 +201,7 @@ func TestServiceUpdatePasswordTool(t *testing.T) { opts: []runOption{generated}, mock: expectGetServiceAndUpdate(sampleService(func(s *api.Service) { s.ForkedFrom = &api.ForkSpec{ServiceID: new("u8me885b93")} - }), http.StatusOK), + }), http.StatusNoContent), wantOutput: updated, }, { @@ -303,19 +303,20 @@ func TestServiceUpdatePasswordTool(t *testing.T) { wantErr: "unknown error", }, { - name: "updates password on a 204", - tool: toolServiceUpdatePassword, - args: args, - opts: []runOption{generated}, - mock: expectGetServiceAndUpdate(sampleService(), http.StatusNoContent), - wantOutput: updated, + // The endpoint answers success with a 204 and nothing else. + name: "unexpected 200 is an error", + tool: toolServiceUpdatePassword, + args: args, + opts: []runOption{generated}, + mock: expectGetServiceAndUpdate(sampleService(), http.StatusOK), + wantErr: "unknown error", }, { name: "with_password includes the generated password", tool: toolServiceUpdatePassword, args: withPasswordArgs, opts: []runOption{generated}, - mock: expectGetServiceAndUpdate(sampleService(), http.StatusOK), + mock: expectGetServiceAndUpdate(sampleService(), http.StatusNoContent), wantOutput: map[string]any{ "updated": true, "message": "Password updated for tsdbadmin.", @@ -328,7 +329,7 @@ func TestServiceUpdatePasswordTool(t *testing.T) { tool: toolServiceUpdatePassword, args: withPasswordArgs, opts: []runOption{withConfig(map[string]any{"password_storage": "none"}), generated}, - mock: expectGetServiceAndUpdate(sampleService(), http.StatusOK), + mock: expectGetServiceAndUpdate(sampleService(), http.StatusNoContent), wantOutput: map[string]any{ "updated": true, "message": "Password updated for tsdbadmin.", @@ -347,7 +348,7 @@ func TestServiceUpdatePasswordTool(t *testing.T) { tool: toolServiceUpdatePassword, args: args, opts: []runOption{withConfig(map[string]any{"password_storage": "none"}), generated}, - mock: expectGetServiceAndUpdate(sampleService(), http.StatusOK), + mock: expectGetServiceAndUpdate(sampleService(), http.StatusNoContent), wantOutput: map[string]any{ "updated": true, "message": "Password updated for tsdbadmin. Warning: the new password was not saved, and was not returned because with_password was false.", @@ -366,7 +367,7 @@ func TestServiceUpdatePasswordTool(t *testing.T) { tool: toolServiceUpdatePassword, args: args, opts: []runOption{withConfig(map[string]any{"password_storage": "pgpass"}), generated}, - mock: expectGetServiceAndUpdate(sampleService(), http.StatusOK), + mock: expectGetServiceAndUpdate(sampleService(), http.StatusNoContent), wantOutput: map[string]any{ "updated": true, "message": "Password updated for tsdbadmin. Warning: the new password was not saved, and was not returned because with_password was false.", diff --git a/internal/mcp/utils.go b/internal/mcp/utils.go index 79fd2a41..0848a48e 100644 --- a/internal/mcp/utils.go +++ b/internal/mcp/utils.go @@ -237,21 +237,15 @@ func (s *Server) convertToServiceDetail(cfg *config.Config, service api.Service, } // Add endpoint information - if service.Endpoint != nil && service.Endpoint.Host != nil { - port := "5432" - if service.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.Endpoint.Port) - } - detail.DirectEndpoint = fmt.Sprintf("%s:%s", *service.Endpoint.Host, port) + if service.Endpoint != nil && service.Endpoint.Host != nil && service.Endpoint.Port != nil { + detail.DirectEndpoint = fmt.Sprintf("%s:%d", *service.Endpoint.Host, *service.Endpoint.Port) } // Add connection pooler endpoint - if service.ConnectionPooler != nil && service.ConnectionPooler.Endpoint != nil && service.ConnectionPooler.Endpoint.Host != nil { - port := "6432" - if service.ConnectionPooler.Endpoint.Port != nil { - port = fmt.Sprintf("%d", *service.ConnectionPooler.Endpoint.Port) + if service.ConnectionPooler != nil && service.ConnectionPooler.Endpoint != nil { + if pooler := service.ConnectionPooler.Endpoint; pooler.Host != nil && pooler.Port != nil { + detail.PoolerEndpoint = fmt.Sprintf("%s:%d", *pooler.Host, *pooler.Port) } - detail.PoolerEndpoint = fmt.Sprintf("%s:%s", *service.ConnectionPooler.Endpoint.Host, port) } // Include password in ServiceDetail if requested. Setting it here ensures @@ -263,7 +257,7 @@ func (s *Server) convertToServiceDetail(cfg *config.Config, service api.Service, // Always include connection string in ServiceDetail // Password is embedded in connection string only if with_password=true - if details, err := common.GetConnectionDetails(cfg, service, common.ConnectionDetailsOptions{ + if details, err := common.GetConnectionDetails(cfg, common.NewServiceConnectionTarget(service), common.ConnectionDetailsOptions{ Role: "tsdbadmin", WithPassword: withPassword, InitialPassword: util.Deref(service.InitialPassword), diff --git a/openapi.yaml b/openapi.yaml index c7332936..c60bfd99 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -36,6 +36,8 @@ tags: description: Manage services and their associated actions. - name: Read Replica Sets description: Manage read replica sets and their associated actions. + - name: Branches + description: Manage branches of a Fluid Service and their associated actions. - name: Backups description: View the backups taken for a service. - name: Exporters @@ -1467,6 +1469,334 @@ paths: '4XX': $ref: '#/components/responses/ClientError' + /projects/{project_id}/branches: + get: + operationId: getProjectBranches + x-tigerdata-owner: platform + x-tigerdata-preview: true + x-tigerdata-internal: true + tags: + - Branches + summary: List All Branches in a Project + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Retrieves a list of all branches within a specific project, regardless + of parent service. + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: A list of branches. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches: + get: + operationId: getBranches + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: List All Branches + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Retrieves a list of all branches created from a service within a project. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - name: ref + in: query + required: false + description: | + Returns only the branch this reference matches: one whose ID + equals it, or whose name equals it, exactly and case-sensitively, + with no precedence between the two. A reference matching nothing + returns an empty list. + schema: + type: string + minLength: 1 + example: "my-production-db-pr-412" + responses: + '200': + description: A list of branches. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + post: + operationId: createBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Create a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Creates a new branch from the service identified by `service_id`. A + branch shares its parent's data at the moment of creation and gets + its own, independently-sized compute. This is an asynchronous + operation. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchCreate' + responses: + '202': + description: Branch creation request has been accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}: + get: + operationId: getBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Get a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Retrieves the details of a specific branch by its ID. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + responses: + '200': + description: Branch details. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + delete: + operationId: deleteBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Delete a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Deletes a specific branch. This is an asynchronous operation. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + responses: + '202': + description: Deletion request has been accepted. + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}/start: + post: + operationId: startBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Start a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Starts a stopped branch. This is an asynchronous operation. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + responses: + '202': + description: Branch start request has been accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}/stop: + post: + operationId: stopBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Stop a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Stops a running branch. This is an asynchronous operation. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + responses: + '202': + description: Branch stop request has been accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}/resize: + post: + operationId: resizeBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Resize a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Changes the compute allocation for a specific branch. + Storage size is shared with the parent and is not resized through + this operation. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchResizeInput' + responses: + '202': + description: Resize request has been accepted and is in progress. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}/updatePassword: + post: + operationId: updateBranchPassword + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Update Branch Password + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Sets a new master password for the branch. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePasswordInput' + responses: + '204': + description: Password updated successfully. No content returned. + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/services/{service_id}/branches/{branch_id}/rename: + post: + operationId: renameBranch + x-tigerdata-owner: platform + x-tigerdata-preview: true + tags: + - Branches + summary: Rename a Branch + description: | + **Preview - this endpoint is experimental and may change without notice.** + + Updates the name of a specific branch. + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ServiceId' + - $ref: '#/components/parameters/BranchId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchRename' + responses: + '200': + description: Branch renamed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Branch' + '4XX': + $ref: '#/components/responses/ClientError' + + /projects/{project_id}/resolve: + get: + operationId: resolveRef + x-tigerdata-owner: platform + x-tigerdata-internal: true + tags: + - Services + summary: Resolve a Service, Branch, or Read Replica Set + description: Resolves `ref` to the service, branch, or read replica set it names. + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: ref + in: query + required: true + description: | + The ID or name to resolve, exactly and case-sensitively. A ref + matching more than one resource is an error. + schema: + type: string + minLength: 1 + example: "my-production-db" + - name: type + in: query + required: false + description: Only match resources of this kind. + schema: + $ref: '#/components/schemas/ResolveType' + responses: + '200': + description: The resolved service, branch, or read replica set. + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveResult' + '4XX': + $ref: '#/components/responses/ClientError' + /projects/{project_id}/exporters: get: operationId: getExporters @@ -1778,6 +2108,14 @@ components: type: string minLength: 3 example: "alb8jicdpr" + BranchId: + name: branch_id + in: path + required: true + description: The unique identifier of the branch. + schema: + type: string + example: "br4nch1d9x" BackupRegionCode: name: region_code in: path @@ -2415,6 +2753,7 @@ components: description: A set of read replicas for a service. required: - id + - service_id - name - status - nodes @@ -2425,6 +2764,10 @@ components: type: string description: The unique identifier for the read replica set. example: "alb8jicdpr" + service_id: + type: string + description: The ID of the parent service this read replica set was created from. + example: "d1k5vk7hf2" name: type: string description: The name of the read replica set. @@ -2471,6 +2814,182 @@ components: type: string description: Environment tag for the read replica set. example: "PROD" + Branch: + x-tigerdata-preview: true + type: object + description: A branch of a Fluid Service. + required: + - id + - project_id + - service_id + - name + - created + - status + - cpu_millis + - memory_gbs + properties: + id: + type: string + description: The unique identifier for the branch. + example: "br4nch1d9x" + project_id: + type: string + description: The project this branch belongs to. + example: "rp1pz7uyae" + service_id: + type: string + description: The service this branch was created from. + example: "4rwj1h3fd0" + name: + type: string + description: The name of the branch. + example: "my-production-db-pr-412" + created: + type: string + format: date-time + description: Creation timestamp. + example: "2026-09-01T09:30:00Z" + initial_password: + type: string + description: The initial password for the branch. + format: password + example: "a-very-secure-initial-password" + status: + allOf: + - $ref: '#/components/schemas/DeployStatus' + description: Current status of the branch. + cpu_millis: + type: integer + description: CPU allocation in milli-cores. + example: 500 + memory_gbs: + type: integer + description: Memory allocation in gigabytes. + example: 4 + iops: + x-tigerdata-preview: true + type: integer + description: Provisioned IOPS for the storage volume. + example: 3000 + endpoint: + $ref: '#/components/schemas/Endpoint' + ResolveType: + x-tigerdata-internal: true + type: string + description: What kind of resource a resolved ref is, or should be restricted to. + enum: [SERVICE, BRANCH, READ_REPLICA_SET] + ResolveResult: + x-tigerdata-internal: true + description: A service, branch, or read replica set resolved by ref. `type` determines which. + oneOf: + - $ref: '#/components/schemas/ResolvedService' + - $ref: '#/components/schemas/ResolvedBranch' + - $ref: '#/components/schemas/ResolvedReadReplicaSet' + discriminator: + propertyName: type + mapping: + SERVICE: '#/components/schemas/ResolvedService' + BRANCH: '#/components/schemas/ResolvedBranch' + READ_REPLICA_SET: '#/components/schemas/ResolvedReadReplicaSet' + ResolvedService: + x-tigerdata-internal: true + description: A Service resolved by ref. + allOf: + - $ref: '#/components/schemas/Service' + - type: object + required: + - type + properties: + type: + type: string + description: Always "SERVICE" for a resolved Service. + enum: [SERVICE] + ResolvedBranch: + x-tigerdata-internal: true + description: A Branch resolved by ref. + allOf: + - $ref: '#/components/schemas/Branch' + - type: object + required: + - type + properties: + type: + type: string + description: Always "BRANCH" for a resolved Branch. + enum: [BRANCH] + ResolvedReadReplicaSet: + x-tigerdata-internal: true + description: A ReadReplicaSet resolved by ref. + allOf: + - $ref: '#/components/schemas/ReadReplicaSet' + - type: object + required: + - type + properties: + type: + type: string + description: Always "READ_REPLICA_SET" for a resolved ReadReplicaSet. + enum: [READ_REPLICA_SET] + BranchCreate: + x-tigerdata-preview: true + type: object + description: Parameters for creating a branch of the service identified by `service_id` in the path. + properties: + name: + type: string + minLength: 1 + maxLength: 128 + description: A human-readable name for the branch. If not provided, defaults to "branch-", with "-1", "-2", ... appended if that name is already in use in the project. + example: "my-production-db-pr-412" + cpu_millis: + type: integer + minimum: 1 + description: The initial CPU allocation in milli-cores. Defaults to 250 if not provided. + example: 250 + memory_gbs: + type: integer + minimum: 1 + description: The initial memory allocation in gigabytes. Defaults to 2 if not provided. + example: 2 + iops: + x-tigerdata-preview: true + type: integer + minimum: 0 + description: Requested provisioned IOPS for the branch's storage. + example: 4000 + BranchRename: + type: object + description: Parameters for renaming a branch. + required: + - name + properties: + name: + type: string + description: The new name for the branch. + example: "my-production-db-pr-412" + BranchResizeInput: + type: object + minProperties: 1 + properties: + cpu_millis: + type: string + pattern: "^[0-9]+$" + description: The new CPU allocation in milli-cores. + example: "1000" + memory_gbs: + type: string + pattern: "^[0-9]+$" + description: The new memory allocation in gigabytes. + example: "4" + iops: + x-tigerdata-preview: true + type: integer + minimum: 0 + description: The new provisioned IOPS for the branch's storage. + example: 4000 + description: >- + At least one of cpu_millis, memory_gbs, or iops must be provided. + cpu_millis and memory_gbs must be provided together. ServiceCreate: type: object description: Parameters for creating a service.