From fb893b7b3f626e6f78f9949d22b3e93b0f2664cd Mon Sep 17 00:00:00 2001 From: Aditya Choudhari Date: Tue, 31 Mar 2026 15:27:09 -0700 Subject: [PATCH 1/6] feat: workflow list and trigger commands --- cmd/ctrlc/root/root.go | 2 + cmd/ctrlc/root/workflow/list.go | 53 +++++++ cmd/ctrlc/root/workflow/trigger.go | 60 ++++++++ cmd/ctrlc/root/workflow/workflow.go | 21 +++ internal/api/client.gen.go | 215 ++++++++++++++-------------- 5 files changed, 245 insertions(+), 106 deletions(-) create mode 100644 cmd/ctrlc/root/workflow/list.go create mode 100644 cmd/ctrlc/root/workflow/trigger.go create mode 100644 cmd/ctrlc/root/workflow/workflow.go diff --git a/cmd/ctrlc/root/root.go b/cmd/ctrlc/root/root.go index cc9a904..7997ebf 100644 --- a/cmd/ctrlc/root/root.go +++ b/cmd/ctrlc/root/root.go @@ -12,6 +12,7 @@ import ( "github.com/ctrlplanedev/cli/cmd/ctrlc/root/sync" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/ui" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/version" + "github.com/ctrlplanedev/cli/cmd/ctrlc/root/workflow" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -59,6 +60,7 @@ func NewRootCmd() *cobra.Command { cmd.AddCommand(run.NewRunCmd()) cmd.AddCommand(ui.NewUICmd()) cmd.AddCommand(version.NewVersionCmd()) + cmd.AddCommand(workflow.NewWorkflowCmd()) return cmd } diff --git a/cmd/ctrlc/root/workflow/list.go b/cmd/ctrlc/root/workflow/list.go new file mode 100644 index 0000000..ff8b2a4 --- /dev/null +++ b/cmd/ctrlc/root/workflow/list.go @@ -0,0 +1,53 @@ +package workflow + +import ( + "fmt" + + "github.com/ctrlplanedev/cli/internal/api" + "github.com/ctrlplanedev/cli/internal/cliutil" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +func NewListCmd() *cobra.Command { + var limit int + var offset int + + cmd := &cobra.Command{ + Use: "list", + Short: "List workflows", + Long: `List all workflows in the workspace.`, + RunE: func(cmd *cobra.Command, args []string) error { + apiURL := viper.GetString("url") + apiKey := viper.GetString("api-key") + workspace := viper.GetString("workspace") + + client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) + if err != nil { + return fmt.Errorf("failed to create API client: %w", err) + } + + workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + + params := &api.ListWorkflowsParams{} + if limit > 0 { + params.Limit = &limit + } + if offset > 0 { + params.Offset = &offset + } + + resp, err := client.ListWorkflows(cmd.Context(), workspaceID.String(), params) + if err != nil { + return fmt.Errorf("failed to list workflows: %w", err) + } + + return cliutil.HandleResponseOutput(cmd, resp) + }, + } + + cmd.Flags().IntVarP(&limit, "limit", "l", 50, "Limit the number of results") + cmd.Flags().IntVarP(&offset, "offset", "o", 0, "Offset the results") + + return cmd +} diff --git a/cmd/ctrlc/root/workflow/trigger.go b/cmd/ctrlc/root/workflow/trigger.go new file mode 100644 index 0000000..f49601e --- /dev/null +++ b/cmd/ctrlc/root/workflow/trigger.go @@ -0,0 +1,60 @@ +package workflow + +import ( + "fmt" + "strings" + + "github.com/ctrlplanedev/cli/internal/api" + "github.com/ctrlplanedev/cli/internal/cliutil" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +func NewTriggerCmd() *cobra.Command { + var inputFlags []string + + cmd := &cobra.Command{ + Use: "trigger ", + Short: "Trigger a workflow run", + Long: `Trigger a workflow run with the given inputs.`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + workflowID := args[0] + + apiURL := viper.GetString("url") + apiKey := viper.GetString("api-key") + workspace := viper.GetString("workspace") + + client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) + if err != nil { + return fmt.Errorf("failed to create API client: %w", err) + } + + workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + + inputs := make(map[string]interface{}) + for _, input := range inputFlags { + key, value, found := strings.Cut(input, "=") + if !found { + return fmt.Errorf("invalid input format %q, expected key=value", input) + } + inputs[key] = value + } + + body := api.CreateWorkflowRunJSONRequestBody{ + Inputs: inputs, + } + + resp, err := client.CreateWorkflowRun(cmd.Context(), workspaceID.String(), workflowID, body) + if err != nil { + return fmt.Errorf("failed to trigger workflow: %w", err) + } + + return cliutil.HandleResponseOutput(cmd, resp) + }, + } + + cmd.Flags().StringArrayVarP(&inputFlags, "input", "i", nil, "Input key=value pair (can be specified multiple times)") + + return cmd +} diff --git a/cmd/ctrlc/root/workflow/workflow.go b/cmd/ctrlc/root/workflow/workflow.go new file mode 100644 index 0000000..c768127 --- /dev/null +++ b/cmd/ctrlc/root/workflow/workflow.go @@ -0,0 +1,21 @@ +package workflow + +import ( + "github.com/spf13/cobra" +) + +func NewWorkflowCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "workflow ", + Short: "Manage workflows", + Long: `Commands for listing and triggering workflows.`, + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, + } + + cmd.AddCommand(NewListCmd()) + cmd.AddCommand(NewTriggerCmd()) + + return cmd +} diff --git a/internal/api/client.gen.go b/internal/api/client.gen.go index 1d0752a..387e885 100644 --- a/internal/api/client.gen.go +++ b/internal/api/client.gen.go @@ -118,6 +118,13 @@ const ( Prometheus PrometheusMetricProviderType = "prometheus" ) +// Defines values for ReleaseTargetStateResponseLatestJobVerificationsStatus. +const ( + ReleaseTargetStateResponseLatestJobVerificationsStatusFailed ReleaseTargetStateResponseLatestJobVerificationsStatus = "failed" + ReleaseTargetStateResponseLatestJobVerificationsStatusPassed ReleaseTargetStateResponseLatestJobVerificationsStatus = "passed" + ReleaseTargetStateResponseLatestJobVerificationsStatusRunning ReleaseTargetStateResponseLatestJobVerificationsStatus = "running" +) + // Defines values for RetryRuleBackoffStrategy. const ( RetryRuleBackoffStrategyExponential RetryRuleBackoffStrategy = "exponential" @@ -134,6 +141,13 @@ const ( TerraformCloudRun TerraformCloudRunMetricProviderType = "terraformCloudRun" ) +// Defines values for VerificationMeasurementStatus. +const ( + VerificationMeasurementStatusFailed VerificationMeasurementStatus = "failed" + VerificationMeasurementStatusInconclusive VerificationMeasurementStatus = "inconclusive" + VerificationMeasurementStatusPassed VerificationMeasurementStatus = "passed" +) + // Defines values for VerificationRuleTriggerOn. const ( JobCreated VerificationRuleTriggerOn = "jobCreated" @@ -279,23 +293,22 @@ type CreateSystemRequest struct { // CreateWorkflow defines model for CreateWorkflow. type CreateWorkflow struct { - Inputs []WorkflowInput `json:"inputs"` - Jobs []CreateWorkflowJobTemplate `json:"jobs"` - Name string `json:"name"` + Inputs []WorkflowInput `json:"inputs"` + JobAgents []CreateWorkflowJobAgent `json:"jobAgents"` + Name string `json:"name"` } -// CreateWorkflowJobTemplate defines model for CreateWorkflowJobTemplate. -type CreateWorkflowJobTemplate struct { +// CreateWorkflowJobAgent defines model for CreateWorkflowJobAgent. +type CreateWorkflowJobAgent struct { // Config Configuration for the job agent Config map[string]interface{} `json:"config"` - - // If CEL expression to determine if the job should run - If *string `json:"if,omitempty"` - Matrix *WorkflowJobMatrix `json:"matrix,omitempty"` - Name string `json:"name"` + Name string `json:"name"` // Ref Reference to the job agent Ref string `json:"ref"` + + // Selector CEL expression to determine if the job agent should dispatch a job + Selector string `json:"selector"` } // CreateWorkspaceRequest defines model for CreateWorkspaceRequest. @@ -844,6 +857,28 @@ type ReleaseTargetState struct { LatestJob *Job `json:"latestJob,omitempty"` } +// ReleaseTargetStateResponse defines model for ReleaseTargetStateResponse. +type ReleaseTargetStateResponse struct { + CurrentRelease *Release `json:"currentRelease,omitempty"` + DesiredRelease *Release `json:"desiredRelease,omitempty"` + LatestJob *struct { + Job Job `json:"job"` + Verifications []struct { + CreatedAt time.Time `json:"createdAt"` + Id string `json:"id"` + JobId string `json:"jobId"` + Message *string `json:"message,omitempty"` + Metrics []VerificationMetricStatus `json:"metrics"` + + // Status Computed aggregate status of this verification + Status ReleaseTargetStateResponseLatestJobVerificationsStatus `json:"status"` + } `json:"verifications"` + } `json:"latestJob,omitempty"` +} + +// ReleaseTargetStateResponseLatestJobVerificationsStatus Computed aggregate status of this verification +type ReleaseTargetStateResponseLatestJobVerificationsStatus string + // ReleaseTargetWithState defines model for ReleaseTargetWithState. type ReleaseTargetWithState struct { ReleaseTarget ReleaseTarget `json:"releaseTarget"` @@ -1032,9 +1067,9 @@ type UpdateDeploymentVersionRequest struct { // UpdateWorkflow defines model for UpdateWorkflow. type UpdateWorkflow struct { - Inputs []WorkflowInput `json:"inputs"` - Jobs []CreateWorkflowJobTemplate `json:"jobs"` - Name string `json:"name"` + Inputs []WorkflowInput `json:"inputs"` + JobAgents []CreateWorkflowJobAgent `json:"jobAgents"` + Name string `json:"name"` } // UpdateWorkspaceRequest defines model for UpdateWorkspaceRequest. @@ -1181,6 +1216,24 @@ type Value struct { union json.RawMessage } +// VerificationMeasurement defines model for VerificationMeasurement. +type VerificationMeasurement struct { + // Data Raw measurement data + Data *map[string]interface{} `json:"data,omitempty"` + + // MeasuredAt When measurement was taken + MeasuredAt time.Time `json:"measuredAt"` + + // Message Measurement result message + Message *string `json:"message,omitempty"` + + // Status Status of a verification measurement + Status VerificationMeasurementStatus `json:"status"` +} + +// VerificationMeasurementStatus Status of a verification measurement +type VerificationMeasurementStatus string + // VerificationMetricSpec defines model for VerificationMetricSpec. type VerificationMetricSpec struct { // Count Number of measurements to take @@ -1206,6 +1259,34 @@ type VerificationMetricSpec struct { SuccessThreshold *int `json:"successThreshold,omitempty"` } +// VerificationMetricStatus defines model for VerificationMetricStatus. +type VerificationMetricStatus struct { + // Count Number of measurements to take + Count int `json:"count"` + + // FailureCondition CEL expression to evaluate measurement failure (e.g., "result.statusCode == 500"), if not provided, a failure is just the opposite of the success condition + FailureCondition *string `json:"failureCondition,omitempty"` + + // FailureThreshold Stop after this many consecutive failures (0 = no limit) + FailureThreshold *int `json:"failureThreshold,omitempty"` + + // IntervalSeconds Interval between measurements in seconds + IntervalSeconds int32 `json:"intervalSeconds"` + + // Measurements Individual verification measurements taken for this metric + Measurements []VerificationMeasurement `json:"measurements"` + + // Name Name of the verification metric + Name string `json:"name"` + Provider MetricProvider `json:"provider"` + + // SuccessCondition CEL expression to evaluate measurement success (e.g., "result.statusCode == 200") + SuccessCondition string `json:"successCondition"` + + // SuccessThreshold Minimum number of consecutive successful measurements required to consider the metric successful + SuccessThreshold *int `json:"successThreshold,omitempty"` +} + // VerificationRule defines model for VerificationRule. type VerificationRule struct { // Metrics Metrics to verify @@ -1235,10 +1316,10 @@ type VersionSelectorRule struct { // Workflow defines model for Workflow. type Workflow struct { - Id string `json:"id"` - Inputs []WorkflowInput `json:"inputs"` - Jobs []WorkflowJobTemplate `json:"jobs"` - Name string `json:"name"` + Id string `json:"id"` + Inputs []WorkflowInput `json:"inputs"` + JobAgents []WorkflowJobAgent `json:"jobAgents"` + Name string `json:"name"` } // WorkflowArrayInput defines model for WorkflowArrayInput. @@ -1273,33 +1354,17 @@ type WorkflowJob struct { WorkflowId string `json:"workflowId"` } -// WorkflowJobMatrix defines model for WorkflowJobMatrix. -type WorkflowJobMatrix map[string]WorkflowJobMatrix_AdditionalProperties - -// WorkflowJobMatrix0 defines model for . -type WorkflowJobMatrix0 = []map[string]interface{} - -// WorkflowJobMatrix1 defines model for . -type WorkflowJobMatrix1 = string - -// WorkflowJobMatrix_AdditionalProperties defines model for WorkflowJobMatrix.AdditionalProperties. -type WorkflowJobMatrix_AdditionalProperties struct { - union json.RawMessage -} - -// WorkflowJobTemplate defines model for WorkflowJobTemplate. -type WorkflowJobTemplate struct { +// WorkflowJobAgent defines model for WorkflowJobAgent. +type WorkflowJobAgent struct { // Config Configuration for the job agent Config map[string]interface{} `json:"config"` - Id string `json:"id"` - - // If CEL expression to determine if the job should run - If *string `json:"if,omitempty"` - Matrix *WorkflowJobMatrix `json:"matrix,omitempty"` - Name string `json:"name"` + Name string `json:"name"` // Ref Reference to the job agent Ref string `json:"ref"` + + // Selector CEL expression to determine if the job agent should dispatch a job + Selector string `json:"selector"` } // WorkflowManualArrayInput defines model for WorkflowManualArrayInput. @@ -2292,68 +2357,6 @@ func (t *WorkflowInput) UnmarshalJSON(b []byte) error { return err } -// AsWorkflowJobMatrix0 returns the union data inside the WorkflowJobMatrix_AdditionalProperties as a WorkflowJobMatrix0 -func (t WorkflowJobMatrix_AdditionalProperties) AsWorkflowJobMatrix0() (WorkflowJobMatrix0, error) { - var body WorkflowJobMatrix0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromWorkflowJobMatrix0 overwrites any union data inside the WorkflowJobMatrix_AdditionalProperties as the provided WorkflowJobMatrix0 -func (t *WorkflowJobMatrix_AdditionalProperties) FromWorkflowJobMatrix0(v WorkflowJobMatrix0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeWorkflowJobMatrix0 performs a merge with any union data inside the WorkflowJobMatrix_AdditionalProperties, using the provided WorkflowJobMatrix0 -func (t *WorkflowJobMatrix_AdditionalProperties) MergeWorkflowJobMatrix0(v WorkflowJobMatrix0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsWorkflowJobMatrix1 returns the union data inside the WorkflowJobMatrix_AdditionalProperties as a WorkflowJobMatrix1 -func (t WorkflowJobMatrix_AdditionalProperties) AsWorkflowJobMatrix1() (WorkflowJobMatrix1, error) { - var body WorkflowJobMatrix1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromWorkflowJobMatrix1 overwrites any union data inside the WorkflowJobMatrix_AdditionalProperties as the provided WorkflowJobMatrix1 -func (t *WorkflowJobMatrix_AdditionalProperties) FromWorkflowJobMatrix1(v WorkflowJobMatrix1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeWorkflowJobMatrix1 performs a merge with any union data inside the WorkflowJobMatrix_AdditionalProperties, using the provided WorkflowJobMatrix1 -func (t *WorkflowJobMatrix_AdditionalProperties) MergeWorkflowJobMatrix1(v WorkflowJobMatrix1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t WorkflowJobMatrix_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *WorkflowJobMatrix_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error @@ -10080,7 +10083,7 @@ func (r GetJobsForReleaseTargetResponse) StatusCode() int { type GetReleaseTargetStateResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ReleaseTargetState + JSON200 *ReleaseTargetStateResponse JSON400 *ErrorResponse JSON404 *ErrorResponse } @@ -10780,7 +10783,7 @@ func (r ListWorkflowsResponse) StatusCode() int { type CreateWorkflowResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *Workflow + JSON201 *Workflow JSON400 *ErrorResponse } @@ -13941,7 +13944,7 @@ func ParseGetReleaseTargetStateResponse(rsp *http.Response) (*GetReleaseTargetSt switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ReleaseTargetState + var dest ReleaseTargetStateResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -14988,12 +14991,12 @@ func ParseCreateWorkflowResponse(rsp *http.Response) (*CreateWorkflowResponse, e } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest Workflow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ErrorResponse From 7865e05d7b228c8da1d2c90418aec7900fca76ac Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 14 May 2026 08:02:12 +0900 Subject: [PATCH 2/6] reset client.gen.go to main --- internal/api/client.gen.go | 2245 +++++++++++++++++++++++++++++++++--- 1 file changed, 2086 insertions(+), 159 deletions(-) diff --git a/internal/api/client.gen.go b/internal/api/client.gen.go index 387e885..f47e156 100644 --- a/internal/api/client.gen.go +++ b/internal/api/client.gen.go @@ -55,12 +55,12 @@ const ( DeploymentPlanStatusFailed DeploymentPlanStatus = "failed" ) -// Defines values for DeploymentPlanTargetStatus. +// Defines values for DeploymentPlanTargetResultStatus. const ( - DeploymentPlanTargetStatusCompleted DeploymentPlanTargetStatus = "completed" - DeploymentPlanTargetStatusComputing DeploymentPlanTargetStatus = "computing" - DeploymentPlanTargetStatusErrored DeploymentPlanTargetStatus = "errored" - DeploymentPlanTargetStatusUnsupported DeploymentPlanTargetStatus = "unsupported" + DeploymentPlanTargetResultStatusCompleted DeploymentPlanTargetResultStatus = "completed" + DeploymentPlanTargetResultStatusComputing DeploymentPlanTargetResultStatus = "computing" + DeploymentPlanTargetResultStatusErrored DeploymentPlanTargetResultStatus = "errored" + DeploymentPlanTargetResultStatusUnsupported DeploymentPlanTargetResultStatus = "unsupported" ) // Defines values for DeploymentVersionStatus. @@ -108,6 +108,20 @@ const ( Successful JobStatus = "successful" ) +// Defines values for ListResourcesFiltersOrder. +const ( + ListResourcesFiltersOrderAsc ListResourcesFiltersOrder = "asc" + ListResourcesFiltersOrderDesc ListResourcesFiltersOrder = "desc" +) + +// Defines values for ListResourcesFiltersSortBy. +const ( + CreatedAt ListResourcesFiltersSortBy = "createdAt" + Kind ListResourcesFiltersSortBy = "kind" + Name ListResourcesFiltersSortBy = "name" + UpdatedAt ListResourcesFiltersSortBy = "updatedAt" +) + // Defines values for NullValue. const ( True NullValue = true @@ -193,6 +207,12 @@ const ( String WorkflowStringInputType = "string" ) +// Defines values for ListDeploymentVersionsParamsOrder. +const ( + ListDeploymentVersionsParamsOrderAsc ListDeploymentVersionsParamsOrder = "asc" + ListDeploymentVersionsParamsOrderDesc ListDeploymentVersionsParamsOrder = "desc" +) + // AnyApprovalRule defines model for AnyApprovalRule. type AnyApprovalRule struct { MinApprovals int32 `json:"minApprovals"` @@ -215,10 +235,11 @@ type CreateDeploymentPlanRequest struct { type CreateDeploymentRequest struct { Description *string `json:"description,omitempty"` JobAgentConfig *map[string]interface{} `json:"jobAgentConfig,omitempty"` - JobAgentId *string `json:"jobAgentId,omitempty"` - JobAgents *[]DeploymentJobAgent `json:"jobAgents,omitempty"` - Metadata *map[string]string `json:"metadata,omitempty"` - Name string `json:"name"` + + // JobAgentSelector CEL expression to match job agents + JobAgentSelector *string `json:"jobAgentSelector,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + Name string `json:"name"` // ResourceSelector CEL expression to determine if the deployment should be used ResourceSelector *string `json:"resourceSelector,omitempty"` @@ -227,8 +248,14 @@ type CreateDeploymentRequest struct { // CreateDeploymentVersionRequest defines model for CreateDeploymentVersionRequest. type CreateDeploymentVersionRequest struct { - Config *map[string]interface{} `json:"config,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` + Config *map[string]interface{} `json:"config,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // Dependencies Map of dependency deployment ID to a CEL version selector evaluated against that deployment's current release on the same resource. Inserted atomically with the version so reconciliation cannot fire before edges are attached. + Dependencies *map[string]struct { + // VersionSelector CEL expression evaluated against the dependency deployment's current release version on the same resource. + VersionSelector string `json:"versionSelector"` + } `json:"dependencies,omitempty"` JobAgentConfig *map[string]interface{} `json:"jobAgentConfig,omitempty"` Metadata *map[string]string `json:"metadata,omitempty"` Name string `json:"name"` @@ -268,6 +295,7 @@ type CreatePolicyRule struct { DeploymentWindow *DeploymentWindowRule `json:"deploymentWindow,omitempty"` EnvironmentProgression *EnvironmentProgressionRule `json:"environmentProgression,omitempty"` GradualRollout *GradualRolloutRule `json:"gradualRollout,omitempty"` + PlanValidationOpa *PlanValidationOpaRule `json:"planValidationOpa,omitempty"` Retry *RetryRule `json:"retry,omitempty"` Verification *VerificationRule `json:"verification,omitempty"` VersionCooldown *VersionCooldownRule `json:"versionCooldown,omitempty"` @@ -291,6 +319,17 @@ type CreateSystemRequest struct { Slug *string `json:"slug,omitempty"` } +// CreateVariableSet defines model for CreateVariableSet. +type CreateVariableSet struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Priority *int `json:"priority,omitempty"` + + // Selector A CEL expression to select which release targets this variable set applies to + Selector string `json:"selector"` + Variables []VariableSetVariable `json:"variables"` +} + // CreateWorkflow defines model for CreateWorkflow. type CreateWorkflow struct { Inputs []WorkflowInput `json:"inputs"` @@ -356,10 +395,11 @@ type Deployment struct { Description *string `json:"description,omitempty"` Id string `json:"id"` JobAgentConfig map[string]interface{} `json:"jobAgentConfig"` - JobAgentId *string `json:"jobAgentId,omitempty"` - JobAgents *[]DeploymentJobAgent `json:"jobAgents,omitempty"` - Metadata *map[string]string `json:"metadata,omitempty"` - Name string `json:"name"` + + // JobAgentSelector CEL expression to match job agents + JobAgentSelector string `json:"jobAgentSelector"` + Metadata *map[string]string `json:"metadata,omitempty"` + Name string `json:"name"` // ResourceSelector CEL expression to determine if the deployment should be used ResourceSelector *string `json:"resourceSelector,omitempty"` @@ -374,19 +414,10 @@ type DeploymentAndSystems struct { // DeploymentDependencyRule defines model for DeploymentDependencyRule. type DeploymentDependencyRule struct { - // DependsOn CEL expression to match upstream deployment(s) that must have a successful release before this deployment can proceed. + // DependsOn CEL expression to match upstream deployment(s) that must have a successful release before this deployment can proceed. The expression can reference both deployment properties (deployment.id, deployment.name, deployment.slug, deployment.metadata) and the currently deployed version properties (version.id, version.tag, version.name, version.status, version.metadata, version.createdAt). For example: deployment.name == 'db-migration' && version.tag.startsWith('v2.'). DependsOn string `json:"dependsOn"` } -// DeploymentJobAgent defines model for DeploymentJobAgent. -type DeploymentJobAgent struct { - Config JobAgentConfig `json:"config"` - Ref string `json:"ref"` - - // Selector CEL expression to determine if the job agent should be used - Selector string `json:"selector"` -} - // DeploymentPlan defines model for DeploymentPlan. type DeploymentPlan struct { Id string `json:"id"` @@ -409,24 +440,36 @@ type DeploymentPlanSummary struct { // DeploymentPlanTarget defines model for DeploymentPlanTarget. type DeploymentPlanTarget struct { + EnvironmentId string `json:"environmentId"` + EnvironmentName string `json:"environmentName"` + + // HasChanges True if any result for this target has changes + HasChanges bool `json:"hasChanges"` + ResourceId string `json:"resourceId"` + ResourceName string `json:"resourceName"` + Results []DeploymentPlanTargetResult `json:"results"` +} + +// DeploymentPlanTargetResult defines model for DeploymentPlanTargetResult. +type DeploymentPlanTargetResult struct { // ContentHash Hash of the rendered output for change detection - ContentHash *string `json:"contentHash,omitempty"` + ContentHash string `json:"contentHash"` // Current Full rendered output of the currently deployed state - Current *string `json:"current,omitempty"` - EnvironmentId string `json:"environmentId"` - EnvironmentName string `json:"environmentName"` - HasChanges *bool `json:"hasChanges"` + Current string `json:"current"` + HasChanges bool `json:"hasChanges"` + Id string `json:"id"` + + // Message Agent message (e.g. error explanation or summary) + Message string `json:"message"` // Proposed Full rendered output of the proposed version - Proposed *string `json:"proposed,omitempty"` - ResourceId string `json:"resourceId"` - ResourceName string `json:"resourceName"` - Status DeploymentPlanTargetStatus `json:"status"` + Proposed string `json:"proposed"` + Status DeploymentPlanTargetResultStatus `json:"status"` } -// DeploymentPlanTargetStatus defines model for DeploymentPlanTarget.Status. -type DeploymentPlanTargetStatus string +// DeploymentPlanTargetResultStatus defines model for DeploymentPlanTargetResult.Status. +type DeploymentPlanTargetResultStatus string // DeploymentPlanVersion defines model for DeploymentPlanVersion. type DeploymentPlanVersion struct { @@ -449,11 +492,10 @@ type DeploymentRequestAccepted struct { // DeploymentVariable defines model for DeploymentVariable. type DeploymentVariable struct { - DefaultValue *LiteralValue `json:"defaultValue,omitempty"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description,omitempty"` - Id string `json:"id"` - Key string `json:"key"` + DeploymentId string `json:"deploymentId"` + Description *string `json:"description,omitempty"` + Id string `json:"id"` + Key string `json:"key"` } // DeploymentVariableRequestAccepted defines model for DeploymentVariableRequestAccepted. @@ -499,6 +541,15 @@ type DeploymentVersion struct { Tag string `json:"tag"` } +// DeploymentVersionDependency defines model for DeploymentVersionDependency. +type DeploymentVersionDependency struct { + DependencyDeploymentId string `json:"dependencyDeploymentId"` + DeploymentVersionId string `json:"deploymentVersionId"` + + // VersionSelector CEL expression evaluated against the dependency deployment's current release version on the same resource. + VersionSelector string `json:"versionSelector"` +} + // DeploymentVersionStatus defines model for DeploymentVersionStatus. type DeploymentVersionStatus string @@ -559,10 +610,13 @@ type EnvironmentProgressionRule struct { // MaximumAgeHours Maximum age of dependency deployment before blocking progression (prevents stale promotions) MaximumAgeHours *int32 `json:"maximumAgeHours,omitempty"` - // MinimumSockTimeMinutes Minimum time to wait after the depends on environment is in a success state before the current environment can be deployed - MinimumSockTimeMinutes *int32 `json:"minimumSockTimeMinutes,omitempty"` - MinimumSuccessPercentage *float32 `json:"minimumSuccessPercentage,omitempty"` - SuccessStatuses *[]JobStatus `json:"successStatuses,omitempty"` + // MinimumSoakTimeMinutes Minimum time to wait after the depends on environment is in a success state before the current environment can be deployed. Defaults to 0 if not provided. + MinimumSoakTimeMinutes *int32 `json:"minimumSoakTimeMinutes,omitempty"` + MinimumSuccessPercentage *float32 `json:"minimumSuccessPercentage,omitempty"` + + // RequireVerificationPassed If true, jobs must also have passed verification to count toward the success percentage + RequireVerificationPassed *bool `json:"requireVerificationPassed,omitempty"` + SuccessStatuses *[]JobStatus `json:"successStatuses,omitempty"` } // EnvironmentRequestAccepted defines model for EnvironmentRequestAccepted. @@ -695,6 +749,30 @@ type JobWithRelease struct { Resource *Resource `json:"resource,omitempty"` } +// ListResourcesFilters defines model for ListResourcesFilters. +type ListResourcesFilters struct { + Identifiers *[]string `json:"identifiers,omitempty"` + Kinds *[]string `json:"kinds,omitempty"` + Limit *int `json:"limit,omitempty"` + + // Metadata Exact metadata key/value matches + Metadata *map[string]string `json:"metadata,omitempty"` + Offset *int `json:"offset,omitempty"` + Order *ListResourcesFiltersOrder `json:"order,omitempty"` + ProviderIds *[]string `json:"providerIds,omitempty"` + + // Query Text search on name or identifier + Query *string `json:"query,omitempty"` + SortBy *ListResourcesFiltersSortBy `json:"sortBy,omitempty"` + Versions *[]string `json:"versions,omitempty"` +} + +// ListResourcesFiltersOrder defines model for ListResourcesFilters.Order. +type ListResourcesFiltersOrder string + +// ListResourcesFiltersSortBy defines model for ListResourcesFilters.SortBy. +type ListResourcesFiltersSortBy string + // LiteralValue defines model for LiteralValue. type LiteralValue struct { union json.RawMessage @@ -716,6 +794,17 @@ type ObjectValue struct { Object map[string]interface{} `json:"object"` } +// PlanValidationOpaRule defines model for PlanValidationOpaRule. +type PlanValidationOpaRule struct { + Description *string `json:"description,omitempty"` + + // Name Human-readable rule name; used in check output to identify which rule produced a violation. + Name string `json:"name"` + + // Rego Rego v1 source code. Must define a `deny` rule set following the Conftest convention (deny contains msg if { ... }). + Rego string `json:"rego"` +} + // Policy defines model for Policy. type Policy struct { CreatedAt string `json:"createdAt"` @@ -743,6 +832,7 @@ type PolicyRule struct { EnvironmentProgression *EnvironmentProgressionRule `json:"environmentProgression,omitempty"` GradualRollout *GradualRolloutRule `json:"gradualRollout,omitempty"` Id string `json:"id"` + PlanValidationOpa *PlanValidationOpaRule `json:"planValidationOpa,omitempty"` PolicyId string `json:"policyId"` Retry *RetryRule `json:"retry,omitempty"` Verification *VerificationRule `json:"verification,omitempty"` @@ -1065,6 +1155,15 @@ type UpdateDeploymentVersionRequest struct { Tag *string `json:"tag,omitempty"` } +// UpdateVariableSet defines model for UpdateVariableSet. +type UpdateVariableSet struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Priority *int `json:"priority,omitempty"` + Selector *string `json:"selector,omitempty"` + Variables *[]VariableSetVariable `json:"variables,omitempty"` +} + // UpdateWorkflow defines model for UpdateWorkflow. type UpdateWorkflow struct { Inputs []WorkflowInput `json:"inputs"` @@ -1085,10 +1184,11 @@ type UpdateWorkspaceRequest struct { type UpsertDeploymentRequest struct { Description *string `json:"description,omitempty"` JobAgentConfig *map[string]interface{} `json:"jobAgentConfig,omitempty"` - JobAgentId *string `json:"jobAgentId,omitempty"` - JobAgents *[]DeploymentJobAgent `json:"jobAgents,omitempty"` - Metadata *map[string]string `json:"metadata,omitempty"` - Name string `json:"name"` + + // JobAgentSelector CEL expression to match job agents + JobAgentSelector *string `json:"jobAgentSelector,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + Name string `json:"name"` // ResourceSelector CEL expression to determine if the deployment should be used ResourceSelector *string `json:"resourceSelector,omitempty"` @@ -1097,10 +1197,9 @@ type UpsertDeploymentRequest struct { // UpsertDeploymentVariableRequest defines model for UpsertDeploymentVariableRequest. type UpsertDeploymentVariableRequest struct { - DefaultValue *LiteralValue `json:"defaultValue,omitempty"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description,omitempty"` - Key string `json:"key"` + DeploymentId string `json:"deploymentId"` + Description *string `json:"description,omitempty"` + Key string `json:"key"` } // UpsertDeploymentVariableValueRequest defines model for UpsertDeploymentVariableValueRequest. @@ -1113,6 +1212,12 @@ type UpsertDeploymentVariableValueRequest struct { Value Value `json:"value"` } +// UpsertDeploymentVersionDependencyRequest defines model for UpsertDeploymentVersionDependencyRequest. +type UpsertDeploymentVersionDependencyRequest struct { + // VersionSelector CEL expression evaluated against the dependency deployment's current release version on the same resource. + VersionSelector string `json:"versionSelector"` +} + // UpsertEnvironmentRequest defines model for UpsertEnvironmentRequest. type UpsertEnvironmentRequest struct { Description *string `json:"description,omitempty"` @@ -1155,6 +1260,7 @@ type UpsertPolicyRule struct { EnvironmentProgression *EnvironmentProgressionRule `json:"environmentProgression,omitempty"` GradualRollout *GradualRolloutRule `json:"gradualRollout,omitempty"` Id *string `json:"id,omitempty"` + PlanValidationOpa *PlanValidationOpaRule `json:"planValidationOpa,omitempty"` PolicyId *string `json:"policyId,omitempty"` Retry *RetryRule `json:"retry,omitempty"` Verification *VerificationRule `json:"verification,omitempty"` @@ -1216,6 +1322,39 @@ type Value struct { union json.RawMessage } +// VariableSet defines model for VariableSet. +type VariableSet struct { + CreatedAt time.Time `json:"createdAt"` + Description string `json:"description"` + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + Priority int `json:"priority"` + + // Selector A CEL expression to select which release targets this variable set applies to + Selector string `json:"selector"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// VariableSetVariable defines model for VariableSetVariable. +type VariableSetVariable struct { + Key string `json:"key"` + Value Value `json:"value"` +} + +// VariableSetWithVariables defines model for VariableSetWithVariables. +type VariableSetWithVariables struct { + CreatedAt time.Time `json:"createdAt"` + Description string `json:"description"` + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + Priority int `json:"priority"` + + // Selector A CEL expression to select which release targets this variable set applies to + Selector string `json:"selector"` + UpdatedAt time.Time `json:"updatedAt"` + Variables []VariableSetVariable `json:"variables"` +} + // VerificationMeasurement defines model for VerificationMeasurement. type VerificationMeasurement struct { // Data Raw measurement data @@ -1466,6 +1605,9 @@ type ListDeploymentsParams struct { // Offset Number of items to skip Offset *int `form:"offset,omitempty" json:"offset,omitempty"` + + // Cel CEL expression to filter the results + Cel *string `form:"cel,omitempty" json:"cel,omitempty"` } // ListDeploymentVariablesByDeploymentParams defines parameters for ListDeploymentVariablesByDeployment. @@ -1484,8 +1626,17 @@ type ListDeploymentVersionsParams struct { // Offset Number of items to skip Offset *int `form:"offset,omitempty" json:"offset,omitempty"` + + // Order Sort order for results + Order *ListDeploymentVersionsParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // Cel CEL expression to filter the results + Cel *string `form:"cel,omitempty" json:"cel,omitempty"` } +// ListDeploymentVersionsParamsOrder defines parameters for ListDeploymentVersions. +type ListDeploymentVersionsParamsOrder string + // ListEnvironmentsParams defines parameters for ListEnvironments. type ListEnvironmentsParams struct { // Limit Maximum number of items to return @@ -1620,6 +1771,15 @@ type ListSystemsParams struct { Offset *int `form:"offset,omitempty" json:"offset,omitempty"` } +// ListVariableSetsParams defines parameters for ListVariableSets. +type ListVariableSetsParams struct { + // Limit Maximum number of items to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of items to skip + Offset *int `form:"offset,omitempty" json:"offset,omitempty"` +} + // ListWorkflowsParams defines parameters for ListWorkflows. type ListWorkflowsParams struct { // Limit Maximum number of items to return @@ -1647,6 +1807,9 @@ type RequestDeploymentVariableValueUpsertJSONRequestBody = UpsertDeploymentVaria // RequestDeploymentVariableUpdateJSONRequestBody defines body for RequestDeploymentVariableUpdate for application/json ContentType. type RequestDeploymentVariableUpdateJSONRequestBody = UpsertDeploymentVariableRequest +// RequestDeploymentVersionDependencyUpsertJSONRequestBody defines body for RequestDeploymentVersionDependencyUpsert for application/json ContentType. +type RequestDeploymentVersionDependencyUpsertJSONRequestBody = UpsertDeploymentVersionDependencyRequest + // RequestUserApprovalRecordUpsertJSONRequestBody defines body for RequestUserApprovalRecordUpsert for application/json ContentType. type RequestUserApprovalRecordUpsertJSONRequestBody = UpsertUserApprovalRecordRequest @@ -1707,12 +1870,21 @@ type UpsertResourceByIdentifierJSONRequestBody = UpsertResourceRequest // RequestResourceVariablesUpdateJSONRequestBody defines body for RequestResourceVariablesUpdate for application/json ContentType. type RequestResourceVariablesUpdateJSONRequestBody RequestResourceVariablesUpdateJSONBody +// SearchResourcesJSONRequestBody defines body for SearchResources for application/json ContentType. +type SearchResourcesJSONRequestBody = ListResourcesFilters + // RequestSystemCreationJSONRequestBody defines body for RequestSystemCreation for application/json ContentType. type RequestSystemCreationJSONRequestBody = CreateSystemRequest // RequestSystemUpsertJSONRequestBody defines body for RequestSystemUpsert for application/json ContentType. type RequestSystemUpsertJSONRequestBody = UpsertSystemRequest +// CreateVariableSetJSONRequestBody defines body for CreateVariableSet for application/json ContentType. +type CreateVariableSetJSONRequestBody = CreateVariableSet + +// UpdateVariableSetJSONRequestBody defines body for UpdateVariableSet for application/json ContentType. +type UpdateVariableSetJSONRequestBody = UpdateVariableSet + // CreateWorkflowJSONRequestBody defines body for CreateWorkflow for application/json ContentType. type CreateWorkflowJSONRequestBody = CreateWorkflow @@ -2474,6 +2646,17 @@ type ClientInterface interface { RequestDeploymentVariableUpdate(ctx context.Context, workspaceId string, variableId string, body RequestDeploymentVariableUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListDeploymentVersionDependencies request + ListDeploymentVersionDependencies(ctx context.Context, workspaceId string, deploymentVersionId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RequestDeploymentVersionDependencyDeletion request + RequestDeploymentVersionDependencyDeletion(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RequestDeploymentVersionDependencyUpsertWithBody request with any body + RequestDeploymentVersionDependencyUpsertWithBody(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + RequestDeploymentVersionDependencyUpsert(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, body RequestDeploymentVersionDependencyUpsertJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // RequestUserApprovalRecordUpsertWithBody request with any body RequestUserApprovalRecordUpsertWithBody(ctx context.Context, workspaceId string, deploymentVersionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2487,6 +2670,9 @@ type ClientInterface interface { RequestDeploymentCreation(ctx context.Context, workspaceId string, body RequestDeploymentCreationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetDeploymentByName request + GetDeploymentByName(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + // RequestDeploymentDeletion request RequestDeploymentDeletion(ctx context.Context, workspaceId string, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2530,6 +2716,9 @@ type ClientInterface interface { RequestEnvironmentCreation(ctx context.Context, workspaceId string, body RequestEnvironmentCreationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetEnvironmentByName request + GetEnvironmentByName(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + // RequestEnvironmentDeletion request RequestEnvironmentDeletion(ctx context.Context, workspaceId string, environmentId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2673,6 +2862,11 @@ type ClientInterface interface { RequestResourceVariablesUpdate(ctx context.Context, workspaceId string, identifier string, body RequestResourceVariablesUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SearchResourcesWithBody request with any body + SearchResourcesWithBody(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SearchResources(ctx context.Context, workspaceId string, body SearchResourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetReleaseTargetForResourceInDeployment request GetReleaseTargetForResourceInDeployment(ctx context.Context, workspaceId string, resourceIdentifier string, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2713,6 +2907,25 @@ type ClientInterface interface { // LinkEnvironmentToSystem request LinkEnvironmentToSystem(ctx context.Context, workspaceId string, systemId string, environmentId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListVariableSets request + ListVariableSets(ctx context.Context, workspaceId string, params *ListVariableSetsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateVariableSetWithBody request with any body + CreateVariableSetWithBody(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateVariableSet(ctx context.Context, workspaceId string, body CreateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteVariableSet request + DeleteVariableSet(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetVariableSet request + GetVariableSet(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateVariableSetWithBody request with any body + UpdateVariableSetWithBody(ctx context.Context, workspaceId string, variableSetId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateVariableSet(ctx context.Context, workspaceId string, variableSetId string, body UpdateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWorkflows request ListWorkflows(ctx context.Context, workspaceId string, params *ListWorkflowsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2930,6 +3143,54 @@ func (c *Client) RequestDeploymentVariableUpdate(ctx context.Context, workspaceI return c.Client.Do(req) } +func (c *Client) ListDeploymentVersionDependencies(ctx context.Context, workspaceId string, deploymentVersionId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDeploymentVersionDependenciesRequest(c.Server, workspaceId, deploymentVersionId) + 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) +} + +func (c *Client) RequestDeploymentVersionDependencyDeletion(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestDeploymentVersionDependencyDeletionRequest(c.Server, workspaceId, deploymentVersionId, dependencyDeploymentId) + 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) +} + +func (c *Client) RequestDeploymentVersionDependencyUpsertWithBody(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestDeploymentVersionDependencyUpsertRequestWithBody(c.Server, workspaceId, deploymentVersionId, dependencyDeploymentId, 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) +} + +func (c *Client) RequestDeploymentVersionDependencyUpsert(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, body RequestDeploymentVersionDependencyUpsertJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRequestDeploymentVersionDependencyUpsertRequest(c.Server, workspaceId, deploymentVersionId, dependencyDeploymentId, 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) +} + func (c *Client) RequestUserApprovalRecordUpsertWithBody(ctx context.Context, workspaceId string, deploymentVersionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequestUserApprovalRecordUpsertRequestWithBody(c.Server, workspaceId, deploymentVersionId, contentType, body) if err != nil { @@ -2990,6 +3251,18 @@ func (c *Client) RequestDeploymentCreation(ctx context.Context, workspaceId stri return c.Client.Do(req) } +func (c *Client) GetDeploymentByName(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDeploymentByNameRequest(c.Server, workspaceId, name) + 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) +} + func (c *Client) RequestDeploymentDeletion(ctx context.Context, workspaceId string, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequestDeploymentDeletionRequest(c.Server, workspaceId, deploymentId) if err != nil { @@ -3182,6 +3455,18 @@ func (c *Client) RequestEnvironmentCreation(ctx context.Context, workspaceId str return c.Client.Do(req) } +func (c *Client) GetEnvironmentByName(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvironmentByNameRequest(c.Server, workspaceId, name) + 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) +} + func (c *Client) RequestEnvironmentDeletion(ctx context.Context, workspaceId string, environmentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequestEnvironmentDeletionRequest(c.Server, workspaceId, environmentId) if err != nil { @@ -3806,6 +4091,30 @@ func (c *Client) RequestResourceVariablesUpdate(ctx context.Context, workspaceId return c.Client.Do(req) } +func (c *Client) SearchResourcesWithBody(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSearchResourcesRequestWithBody(c.Server, workspaceId, 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) +} + +func (c *Client) SearchResources(ctx context.Context, workspaceId string, body SearchResourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSearchResourcesRequest(c.Server, workspaceId, 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) +} + func (c *Client) GetReleaseTargetForResourceInDeployment(ctx context.Context, workspaceId string, resourceIdentifier string, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReleaseTargetForResourceInDeploymentRequest(c.Server, workspaceId, resourceIdentifier, deploymentId) if err != nil { @@ -3974,6 +4283,90 @@ func (c *Client) LinkEnvironmentToSystem(ctx context.Context, workspaceId string return c.Client.Do(req) } +func (c *Client) ListVariableSets(ctx context.Context, workspaceId string, params *ListVariableSetsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListVariableSetsRequest(c.Server, workspaceId, 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) +} + +func (c *Client) CreateVariableSetWithBody(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateVariableSetRequestWithBody(c.Server, workspaceId, 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) +} + +func (c *Client) CreateVariableSet(ctx context.Context, workspaceId string, body CreateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateVariableSetRequest(c.Server, workspaceId, 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) +} + +func (c *Client) DeleteVariableSet(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteVariableSetRequest(c.Server, workspaceId, variableSetId) + 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) +} + +func (c *Client) GetVariableSet(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetVariableSetRequest(c.Server, workspaceId, variableSetId) + 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) +} + +func (c *Client) UpdateVariableSetWithBody(ctx context.Context, workspaceId string, variableSetId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateVariableSetRequestWithBody(c.Server, workspaceId, variableSetId, 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) +} + +func (c *Client) UpdateVariableSet(ctx context.Context, workspaceId string, variableSetId string, body UpdateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateVariableSetRequest(c.Server, workspaceId, variableSetId, 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) +} + func (c *Client) ListWorkflows(ctx context.Context, workspaceId string, params *ListWorkflowsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWorkflowsRequest(c.Server, workspaceId, params) if err != nil { @@ -4570,14 +4963,164 @@ func NewRequestDeploymentVariableUpdateRequestWithBody(server string, workspaceI return req, nil } -// NewRequestUserApprovalRecordUpsertRequest calls the generic RequestUserApprovalRecordUpsert builder with application/json body -func NewRequestUserApprovalRecordUpsertRequest(server string, workspaceId string, deploymentVersionId string, body RequestUserApprovalRecordUpsertJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) +// NewListDeploymentVersionDependenciesRequest generates requests for ListDeploymentVersionDependencies +func NewListDeploymentVersionDependenciesRequest(server string, workspaceId string, deploymentVersionId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "deploymentVersionId", runtime.ParamLocationPath, deploymentVersionId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/deployment-versions/%s/dependencies", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRequestDeploymentVersionDependencyDeletionRequest generates requests for RequestDeploymentVersionDependencyDeletion +func NewRequestDeploymentVersionDependencyDeletionRequest(server string, workspaceId string, deploymentVersionId string, dependencyDeploymentId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "deploymentVersionId", runtime.ParamLocationPath, deploymentVersionId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "dependencyDeploymentId", runtime.ParamLocationPath, dependencyDeploymentId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/deployment-versions/%s/dependencies/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRequestDeploymentVersionDependencyUpsertRequest calls the generic RequestDeploymentVersionDependencyUpsert builder with application/json body +func NewRequestDeploymentVersionDependencyUpsertRequest(server string, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, body RequestDeploymentVersionDependencyUpsertJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRequestDeploymentVersionDependencyUpsertRequestWithBody(server, workspaceId, deploymentVersionId, dependencyDeploymentId, "application/json", bodyReader) +} + +// NewRequestDeploymentVersionDependencyUpsertRequestWithBody generates requests for RequestDeploymentVersionDependencyUpsert with any type of body +func NewRequestDeploymentVersionDependencyUpsertRequestWithBody(server string, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "deploymentVersionId", runtime.ParamLocationPath, deploymentVersionId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "dependencyDeploymentId", runtime.ParamLocationPath, dependencyDeploymentId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/deployment-versions/%s/dependencies/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewRequestUserApprovalRecordUpsertRequest calls the generic RequestUserApprovalRecordUpsert builder with application/json body +func NewRequestUserApprovalRecordUpsertRequest(server string, workspaceId string, deploymentVersionId string, body RequestUserApprovalRecordUpsertJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) return NewRequestUserApprovalRecordUpsertRequestWithBody(server, workspaceId, deploymentVersionId, "application/json", bodyReader) } @@ -4685,6 +5228,22 @@ func NewListDeploymentsRequest(server string, workspaceId string, params *ListDe } + if params.Cel != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cel", runtime.ParamLocationQuery, *params.Cel); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -4743,6 +5302,47 @@ func NewRequestDeploymentCreationRequestWithBody(server string, workspaceId stri return req, nil } +// NewGetDeploymentByNameRequest generates requests for GetDeploymentByName +func NewGetDeploymentByNameRequest(server string, workspaceId string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/deployments/name/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewRequestDeploymentDeletionRequest generates requests for RequestDeploymentDeletion func NewRequestDeploymentDeletionRequest(server string, workspaceId string, deploymentId string) (*http.Request, error) { var err error @@ -5128,6 +5728,38 @@ func NewListDeploymentVersionsRequest(server string, workspaceId string, deploym } + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "order", runtime.ParamLocationQuery, *params.Order); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Cel != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cel", runtime.ParamLocationQuery, *params.Cel); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -5366,6 +5998,47 @@ func NewRequestEnvironmentCreationRequestWithBody(server string, workspaceId str return req, nil } +// NewGetEnvironmentByNameRequest generates requests for GetEnvironmentByName +func NewGetEnvironmentByNameRequest(server string, workspaceId string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/environments/name/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewRequestEnvironmentDeletionRequest generates requests for RequestEnvironmentDeletion func NewRequestEnvironmentDeletionRequest(server string, workspaceId string, environmentId string) (*http.Request, error) { var err error @@ -7498,6 +8171,53 @@ func NewRequestResourceVariablesUpdateRequestWithBody(server string, workspaceId return req, nil } +// NewSearchResourcesRequest calls the generic SearchResources builder with application/json body +func NewSearchResourcesRequest(server string, workspaceId string, body SearchResourcesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSearchResourcesRequestWithBody(server, workspaceId, "application/json", bodyReader) +} + +// NewSearchResourcesRequestWithBody generates requests for SearchResources with any type of body +func NewSearchResourcesRequestWithBody(server string, workspaceId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/resources/search", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewGetReleaseTargetForResourceInDeploymentRequest generates requests for GetReleaseTargetForResourceInDeployment func NewGetReleaseTargetForResourceInDeploymentRequest(server string, workspaceId string, resourceIdentifier string, deploymentId string) (*http.Request, error) { var err error @@ -7747,19 +8467,206 @@ func NewGetSystemRequest(server string, workspaceId string, systemId string) (*h return req, nil } -// NewRequestSystemUpsertRequest calls the generic RequestSystemUpsert builder with application/json body -func NewRequestSystemUpsertRequest(server string, workspaceId string, systemId string, body RequestSystemUpsertJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewRequestSystemUpsertRequest calls the generic RequestSystemUpsert builder with application/json body +func NewRequestSystemUpsertRequest(server string, workspaceId string, systemId string, body RequestSystemUpsertJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewRequestSystemUpsertRequestWithBody(server, workspaceId, systemId, "application/json", bodyReader) +} + +// NewRequestSystemUpsertRequestWithBody generates requests for RequestSystemUpsert with any type of body +func NewRequestSystemUpsertRequestWithBody(server string, workspaceId string, systemId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUnlinkDeploymentFromSystemRequest generates requests for UnlinkDeploymentFromSystem +func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetDeploymentSystemLinkRequest generates requests for GetDeploymentSystemLink +func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewLinkDeploymentToSystemRequest generates requests for LinkDeploymentToSystem +func NewLinkDeploymentToSystemRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), nil) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewRequestSystemUpsertRequestWithBody(server, workspaceId, systemId, "application/json", bodyReader) + + return req, nil } -// NewRequestSystemUpsertRequestWithBody generates requests for RequestSystemUpsert with any type of body -func NewRequestSystemUpsertRequestWithBody(server string, workspaceId string, systemId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUnlinkEnvironmentFromSystemRequest generates requests for UnlinkEnvironmentFromSystem +func NewUnlinkEnvironmentFromSystemRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { var err error var pathParam0 string @@ -7776,12 +8683,19 @@ func NewRequestSystemUpsertRequestWithBody(server string, workspaceId string, sy return nil, err } + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7791,18 +8705,16 @@ func NewRequestSystemUpsertRequestWithBody(server string, workspaceId string, sy return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewUnlinkDeploymentFromSystemRequest generates requests for UnlinkDeploymentFromSystem -func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { +// NewGetEnvironmentSystemLinkRequest generates requests for GetEnvironmentSystemLink +func NewGetEnvironmentSystemLinkRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { var err error var pathParam0 string @@ -7821,7 +8733,7 @@ func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, sys var pathParam2 string - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) if err != nil { return nil, err } @@ -7831,7 +8743,7 @@ func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, sys return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7841,7 +8753,7 @@ func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, sys return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -7849,8 +8761,8 @@ func NewUnlinkDeploymentFromSystemRequest(server string, workspaceId string, sys return req, nil } -// NewGetDeploymentSystemLinkRequest generates requests for GetDeploymentSystemLink -func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { +// NewLinkEnvironmentToSystemRequest generates requests for LinkEnvironmentToSystem +func NewLinkEnvironmentToSystemRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { var err error var pathParam0 string @@ -7869,7 +8781,7 @@ func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, system var pathParam2 string - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) if err != nil { return nil, err } @@ -7879,7 +8791,7 @@ func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, system return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7889,7 +8801,7 @@ func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, system return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), nil) if err != nil { return nil, err } @@ -7897,8 +8809,8 @@ func NewGetDeploymentSystemLinkRequest(server string, workspaceId string, system return req, nil } -// NewLinkDeploymentToSystemRequest generates requests for LinkDeploymentToSystem -func NewLinkDeploymentToSystemRequest(server string, workspaceId string, systemId string, deploymentId string) (*http.Request, error) { +// NewListVariableSetsRequest generates requests for ListVariableSets +func NewListVariableSetsRequest(server string, workspaceId string, params *ListVariableSetsParams) (*http.Request, error) { var err error var pathParam0 string @@ -7908,16 +8820,85 @@ func NewLinkDeploymentToSystemRequest(server string, workspaceId string, systemI return nil, err } - var pathParam1 string + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) + operationPath := fmt.Sprintf("/v1/workspaces/%s/variable-sets", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } - var pathParam2 string + if params != nil { + queryValues := queryURL.Query() - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "deploymentId", runtime.ParamLocationPath, deploymentId) + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateVariableSetRequest calls the generic CreateVariableSet builder with application/json body +func NewCreateVariableSetRequest(server string, workspaceId string, body CreateVariableSetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateVariableSetRequestWithBody(server, workspaceId, "application/json", bodyReader) +} + +// NewCreateVariableSetRequestWithBody generates requests for CreateVariableSet with any type of body +func NewCreateVariableSetRequestWithBody(server string, workspaceId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) if err != nil { return nil, err } @@ -7927,7 +8908,7 @@ func NewLinkDeploymentToSystemRequest(server string, workspaceId string, systemI return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/deployments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/variable-sets", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7937,16 +8918,18 @@ func NewLinkDeploymentToSystemRequest(server string, workspaceId string, systemI return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUnlinkEnvironmentFromSystemRequest generates requests for UnlinkEnvironmentFromSystem -func NewUnlinkEnvironmentFromSystemRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { +// NewDeleteVariableSetRequest generates requests for DeleteVariableSet +func NewDeleteVariableSetRequest(server string, workspaceId string, variableSetId string) (*http.Request, error) { var err error var pathParam0 string @@ -7958,14 +8941,7 @@ func NewUnlinkEnvironmentFromSystemRequest(server string, workspaceId string, sy var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "variableSetId", runtime.ParamLocationPath, variableSetId) if err != nil { return nil, err } @@ -7975,7 +8951,7 @@ func NewUnlinkEnvironmentFromSystemRequest(server string, workspaceId string, sy return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/variable-sets/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7993,8 +8969,8 @@ func NewUnlinkEnvironmentFromSystemRequest(server string, workspaceId string, sy return req, nil } -// NewGetEnvironmentSystemLinkRequest generates requests for GetEnvironmentSystemLink -func NewGetEnvironmentSystemLinkRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { +// NewGetVariableSetRequest generates requests for GetVariableSet +func NewGetVariableSetRequest(server string, workspaceId string, variableSetId string) (*http.Request, error) { var err error var pathParam0 string @@ -8006,14 +8982,7 @@ func NewGetEnvironmentSystemLinkRequest(server string, workspaceId string, syste var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "variableSetId", runtime.ParamLocationPath, variableSetId) if err != nil { return nil, err } @@ -8023,7 +8992,7 @@ func NewGetEnvironmentSystemLinkRequest(server string, workspaceId string, syste return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/variable-sets/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -8041,8 +9010,19 @@ func NewGetEnvironmentSystemLinkRequest(server string, workspaceId string, syste return req, nil } -// NewLinkEnvironmentToSystemRequest generates requests for LinkEnvironmentToSystem -func NewLinkEnvironmentToSystemRequest(server string, workspaceId string, systemId string, environmentId string) (*http.Request, error) { +// NewUpdateVariableSetRequest calls the generic UpdateVariableSet builder with application/json body +func NewUpdateVariableSetRequest(server string, workspaceId string, variableSetId string, body UpdateVariableSetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateVariableSetRequestWithBody(server, workspaceId, variableSetId, "application/json", bodyReader) +} + +// NewUpdateVariableSetRequestWithBody generates requests for UpdateVariableSet with any type of body +func NewUpdateVariableSetRequestWithBody(server string, workspaceId string, variableSetId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -8054,14 +9034,7 @@ func NewLinkEnvironmentToSystemRequest(server string, workspaceId string, system var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "systemId", runtime.ParamLocationPath, systemId) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "environmentId", runtime.ParamLocationPath, environmentId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "variableSetId", runtime.ParamLocationPath, variableSetId) if err != nil { return nil, err } @@ -8071,7 +9044,7 @@ func NewLinkEnvironmentToSystemRequest(server string, workspaceId string, system return nil, err } - operationPath := fmt.Sprintf("/v1/workspaces/%s/systems/%s/environments/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/workspaces/%s/variable-sets/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -8081,11 +9054,13 @@ func NewLinkEnvironmentToSystemRequest(server string, workspaceId string, system return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } @@ -8485,6 +9460,17 @@ type ClientWithResponsesInterface interface { RequestDeploymentVariableUpdateWithResponse(ctx context.Context, workspaceId string, variableId string, body RequestDeploymentVariableUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeploymentVariableUpdateResponse, error) + // ListDeploymentVersionDependenciesWithResponse request + ListDeploymentVersionDependenciesWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, reqEditors ...RequestEditorFn) (*ListDeploymentVersionDependenciesResponse, error) + + // RequestDeploymentVersionDependencyDeletionWithResponse request + RequestDeploymentVersionDependencyDeletionWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyDeletionResponse, error) + + // RequestDeploymentVersionDependencyUpsertWithBodyWithResponse request with any body + RequestDeploymentVersionDependencyUpsertWithBodyWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyUpsertResponse, error) + + RequestDeploymentVersionDependencyUpsertWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, body RequestDeploymentVersionDependencyUpsertJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyUpsertResponse, error) + // RequestUserApprovalRecordUpsertWithBodyWithResponse request with any body RequestUserApprovalRecordUpsertWithBodyWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestUserApprovalRecordUpsertResponse, error) @@ -8498,6 +9484,9 @@ type ClientWithResponsesInterface interface { RequestDeploymentCreationWithResponse(ctx context.Context, workspaceId string, body RequestDeploymentCreationJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeploymentCreationResponse, error) + // GetDeploymentByNameWithResponse request + GetDeploymentByNameWithResponse(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*GetDeploymentByNameResponse, error) + // RequestDeploymentDeletionWithResponse request RequestDeploymentDeletionWithResponse(ctx context.Context, workspaceId string, deploymentId string, reqEditors ...RequestEditorFn) (*RequestDeploymentDeletionResponse, error) @@ -8541,6 +9530,9 @@ type ClientWithResponsesInterface interface { RequestEnvironmentCreationWithResponse(ctx context.Context, workspaceId string, body RequestEnvironmentCreationJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestEnvironmentCreationResponse, error) + // GetEnvironmentByNameWithResponse request + GetEnvironmentByNameWithResponse(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*GetEnvironmentByNameResponse, error) + // RequestEnvironmentDeletionWithResponse request RequestEnvironmentDeletionWithResponse(ctx context.Context, workspaceId string, environmentId string, reqEditors ...RequestEditorFn) (*RequestEnvironmentDeletionResponse, error) @@ -8684,6 +9676,11 @@ type ClientWithResponsesInterface interface { RequestResourceVariablesUpdateWithResponse(ctx context.Context, workspaceId string, identifier string, body RequestResourceVariablesUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestResourceVariablesUpdateResponse, error) + // SearchResourcesWithBodyWithResponse request with any body + SearchResourcesWithBodyWithResponse(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchResourcesResponse, error) + + SearchResourcesWithResponse(ctx context.Context, workspaceId string, body SearchResourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchResourcesResponse, error) + // GetReleaseTargetForResourceInDeploymentWithResponse request GetReleaseTargetForResourceInDeploymentWithResponse(ctx context.Context, workspaceId string, resourceIdentifier string, deploymentId string, reqEditors ...RequestEditorFn) (*GetReleaseTargetForResourceInDeploymentResponse, error) @@ -8724,6 +9721,25 @@ type ClientWithResponsesInterface interface { // LinkEnvironmentToSystemWithResponse request LinkEnvironmentToSystemWithResponse(ctx context.Context, workspaceId string, systemId string, environmentId string, reqEditors ...RequestEditorFn) (*LinkEnvironmentToSystemResponse, error) + // ListVariableSetsWithResponse request + ListVariableSetsWithResponse(ctx context.Context, workspaceId string, params *ListVariableSetsParams, reqEditors ...RequestEditorFn) (*ListVariableSetsResponse, error) + + // CreateVariableSetWithBodyWithResponse request with any body + CreateVariableSetWithBodyWithResponse(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVariableSetResponse, error) + + CreateVariableSetWithResponse(ctx context.Context, workspaceId string, body CreateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVariableSetResponse, error) + + // DeleteVariableSetWithResponse request + DeleteVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*DeleteVariableSetResponse, error) + + // GetVariableSetWithResponse request + GetVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*GetVariableSetResponse, error) + + // UpdateVariableSetWithBodyWithResponse request with any body + UpdateVariableSetWithBodyWithResponse(ctx context.Context, workspaceId string, variableSetId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateVariableSetResponse, error) + + UpdateVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, body UpdateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateVariableSetResponse, error) + // ListWorkflowsWithResponse request ListWorkflowsWithResponse(ctx context.Context, workspaceId string, params *ListWorkflowsParams, reqEditors ...RequestEditorFn) (*ListWorkflowsResponse, error) @@ -8948,16 +9964,88 @@ func (r GetDeploymentVariableValueResponse) StatusCode() int { return 0 } -type RequestDeploymentVariableValueUpsertResponse struct { +type RequestDeploymentVariableValueUpsertResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *DeploymentVariableValueRequestAccepted + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r RequestDeploymentVariableValueUpsertResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RequestDeploymentVariableValueUpsertResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RequestDeploymentVariableDeletionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *DeploymentVariableRequestAccepted + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r RequestDeploymentVariableDeletionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RequestDeploymentVariableDeletionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDeploymentVariableResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DeploymentVariableWithValues + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r GetDeploymentVariableResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDeploymentVariableResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RequestDeploymentVariableUpdateResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *DeploymentVariableValueRequestAccepted + JSON202 *DeploymentVariableRequestAccepted JSON400 *ErrorResponse JSON404 *ErrorResponse } // Status returns HTTPResponse.Status -func (r RequestDeploymentVariableValueUpsertResponse) Status() string { +func (r RequestDeploymentVariableUpdateResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8965,23 +10053,22 @@ func (r RequestDeploymentVariableValueUpsertResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RequestDeploymentVariableValueUpsertResponse) StatusCode() int { +func (r RequestDeploymentVariableUpdateResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RequestDeploymentVariableDeletionResponse struct { +type ListDeploymentVersionDependenciesResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *DeploymentVariableRequestAccepted - JSON400 *ErrorResponse + JSON200 *[]DeploymentVersionDependency JSON404 *ErrorResponse } // Status returns HTTPResponse.Status -func (r RequestDeploymentVariableDeletionResponse) Status() string { +func (r ListDeploymentVersionDependenciesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8989,23 +10076,23 @@ func (r RequestDeploymentVariableDeletionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RequestDeploymentVariableDeletionResponse) StatusCode() int { +func (r ListDeploymentVersionDependenciesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDeploymentVariableResponse struct { +type RequestDeploymentVersionDependencyDeletionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DeploymentVariableWithValues + JSON202 *DeploymentRequestAccepted JSON400 *ErrorResponse JSON404 *ErrorResponse } // Status returns HTTPResponse.Status -func (r GetDeploymentVariableResponse) Status() string { +func (r RequestDeploymentVersionDependencyDeletionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9013,23 +10100,23 @@ func (r GetDeploymentVariableResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDeploymentVariableResponse) StatusCode() int { +func (r RequestDeploymentVersionDependencyDeletionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RequestDeploymentVariableUpdateResponse struct { +type RequestDeploymentVersionDependencyUpsertResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *DeploymentVariableRequestAccepted + JSON202 *DeploymentRequestAccepted JSON400 *ErrorResponse JSON404 *ErrorResponse } // Status returns HTTPResponse.Status -func (r RequestDeploymentVariableUpdateResponse) Status() string { +func (r RequestDeploymentVersionDependencyUpsertResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9037,7 +10124,7 @@ func (r RequestDeploymentVariableUpdateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RequestDeploymentVariableUpdateResponse) StatusCode() int { +func (r RequestDeploymentVersionDependencyUpsertResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9105,6 +10192,8 @@ type RequestDeploymentCreationResponse struct { Body []byte HTTPResponse *http.Response JSON202 *DeploymentRequestAccepted + JSON400 *ErrorResponse + JSON409 *ErrorResponse } // Status returns HTTPResponse.Status @@ -9123,6 +10212,30 @@ func (r RequestDeploymentCreationResponse) StatusCode() int { return 0 } +type GetDeploymentByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DeploymentWithVariablesAndSystems + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r GetDeploymentByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDeploymentByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type RequestDeploymentDeletionResponse struct { Body []byte HTTPResponse *http.Response @@ -9175,6 +10288,8 @@ type RequestDeploymentUpsertResponse struct { Body []byte HTTPResponse *http.Response JSON202 *DeploymentRequestAccepted + JSON400 *ErrorResponse + JSON409 *ErrorResponse } // Status returns HTTPResponse.Status @@ -9313,8 +10428,9 @@ func (r ListDeploymentVersionsResponse) StatusCode() int { type CreateDeploymentVersionResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *DeploymentVersion + JSON200 *DeploymentVersion JSON400 *ErrorResponse + JSON404 *ErrorResponse } // Status returns HTTPResponse.Status @@ -9393,6 +10509,8 @@ type RequestEnvironmentCreationResponse struct { Body []byte HTTPResponse *http.Response JSON202 *EnvironmentRequestAccepted + JSON400 *ErrorResponse + JSON409 *ErrorResponse } // Status returns HTTPResponse.Status @@ -9411,6 +10529,30 @@ func (r RequestEnvironmentCreationResponse) StatusCode() int { return 0 } +type GetEnvironmentByNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EnvironmentWithSystems + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r GetEnvironmentByNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEnvironmentByNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type RequestEnvironmentDeletionResponse struct { Body []byte HTTPResponse *http.Response @@ -9465,6 +10607,7 @@ type RequestEnvironmentUpsertResponse struct { JSON202 *EnvironmentRequestAccepted JSON400 *ErrorResponse JSON404 *ErrorResponse + JSON409 *ErrorResponse } // Status returns HTTPResponse.Status @@ -10453,6 +11596,40 @@ func (r RequestResourceVariablesUpdateResponse) StatusCode() int { return 0 } +type SearchResourcesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []Resource `json:"items"` + + // Limit Maximum number of items returned + Limit int `json:"limit"` + + // Offset Number of items skipped + Offset int `json:"offset"` + + // Total Total number of items available + Total int `json:"total"` + } + JSON400 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r SearchResourcesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SearchResourcesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetReleaseTargetForResourceInDeploymentResponse struct { Body []byte HTTPResponse *http.Response @@ -10746,6 +11923,135 @@ func (r LinkEnvironmentToSystemResponse) StatusCode() int { return 0 } +type ListVariableSetsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []VariableSetWithVariables `json:"items"` + + // Limit Maximum number of items returned + Limit int `json:"limit"` + + // Offset Number of items skipped + Offset int `json:"offset"` + + // Total Total number of items available + Total int `json:"total"` + } + JSON400 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r ListVariableSetsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListVariableSetsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateVariableSetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *VariableSet + JSON400 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r CreateVariableSetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateVariableSetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteVariableSetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *VariableSet + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r DeleteVariableSetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteVariableSetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetVariableSetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *VariableSetWithVariables + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r GetVariableSetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetVariableSetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateVariableSetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *VariableSet + JSON400 *ErrorResponse + JSON404 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r UpdateVariableSetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateVariableSetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListWorkflowsResponse struct { Body []byte HTTPResponse *http.Response @@ -11039,6 +12345,41 @@ func (c *ClientWithResponses) RequestDeploymentVariableUpdateWithResponse(ctx co return ParseRequestDeploymentVariableUpdateResponse(rsp) } +// ListDeploymentVersionDependenciesWithResponse request returning *ListDeploymentVersionDependenciesResponse +func (c *ClientWithResponses) ListDeploymentVersionDependenciesWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, reqEditors ...RequestEditorFn) (*ListDeploymentVersionDependenciesResponse, error) { + rsp, err := c.ListDeploymentVersionDependencies(ctx, workspaceId, deploymentVersionId, reqEditors...) + if err != nil { + return nil, err + } + return ParseListDeploymentVersionDependenciesResponse(rsp) +} + +// RequestDeploymentVersionDependencyDeletionWithResponse request returning *RequestDeploymentVersionDependencyDeletionResponse +func (c *ClientWithResponses) RequestDeploymentVersionDependencyDeletionWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyDeletionResponse, error) { + rsp, err := c.RequestDeploymentVersionDependencyDeletion(ctx, workspaceId, deploymentVersionId, dependencyDeploymentId, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestDeploymentVersionDependencyDeletionResponse(rsp) +} + +// RequestDeploymentVersionDependencyUpsertWithBodyWithResponse request with arbitrary body returning *RequestDeploymentVersionDependencyUpsertResponse +func (c *ClientWithResponses) RequestDeploymentVersionDependencyUpsertWithBodyWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyUpsertResponse, error) { + rsp, err := c.RequestDeploymentVersionDependencyUpsertWithBody(ctx, workspaceId, deploymentVersionId, dependencyDeploymentId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestDeploymentVersionDependencyUpsertResponse(rsp) +} + +func (c *ClientWithResponses) RequestDeploymentVersionDependencyUpsertWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, dependencyDeploymentId string, body RequestDeploymentVersionDependencyUpsertJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestDeploymentVersionDependencyUpsertResponse, error) { + rsp, err := c.RequestDeploymentVersionDependencyUpsert(ctx, workspaceId, deploymentVersionId, dependencyDeploymentId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestDeploymentVersionDependencyUpsertResponse(rsp) +} + // RequestUserApprovalRecordUpsertWithBodyWithResponse request with arbitrary body returning *RequestUserApprovalRecordUpsertResponse func (c *ClientWithResponses) RequestUserApprovalRecordUpsertWithBodyWithResponse(ctx context.Context, workspaceId string, deploymentVersionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestUserApprovalRecordUpsertResponse, error) { rsp, err := c.RequestUserApprovalRecordUpsertWithBody(ctx, workspaceId, deploymentVersionId, contentType, body, reqEditors...) @@ -11082,6 +12423,15 @@ func (c *ClientWithResponses) RequestDeploymentCreationWithResponse(ctx context. return ParseRequestDeploymentCreationResponse(rsp) } +// GetDeploymentByNameWithResponse request returning *GetDeploymentByNameResponse +func (c *ClientWithResponses) GetDeploymentByNameWithResponse(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*GetDeploymentByNameResponse, error) { + rsp, err := c.GetDeploymentByName(ctx, workspaceId, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDeploymentByNameResponse(rsp) +} + // RequestDeploymentDeletionWithResponse request returning *RequestDeploymentDeletionResponse func (c *ClientWithResponses) RequestDeploymentDeletionWithResponse(ctx context.Context, workspaceId string, deploymentId string, reqEditors ...RequestEditorFn) (*RequestDeploymentDeletionResponse, error) { rsp, err := c.RequestDeploymentDeletion(ctx, workspaceId, deploymentId, reqEditors...) @@ -11221,6 +12571,15 @@ func (c *ClientWithResponses) RequestEnvironmentCreationWithResponse(ctx context return ParseRequestEnvironmentCreationResponse(rsp) } +// GetEnvironmentByNameWithResponse request returning *GetEnvironmentByNameResponse +func (c *ClientWithResponses) GetEnvironmentByNameWithResponse(ctx context.Context, workspaceId string, name string, reqEditors ...RequestEditorFn) (*GetEnvironmentByNameResponse, error) { + rsp, err := c.GetEnvironmentByName(ctx, workspaceId, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvironmentByNameResponse(rsp) +} + // RequestEnvironmentDeletionWithResponse request returning *RequestEnvironmentDeletionResponse func (c *ClientWithResponses) RequestEnvironmentDeletionWithResponse(ctx context.Context, workspaceId string, environmentId string, reqEditors ...RequestEditorFn) (*RequestEnvironmentDeletionResponse, error) { rsp, err := c.RequestEnvironmentDeletion(ctx, workspaceId, environmentId, reqEditors...) @@ -11659,21 +13018,38 @@ func (c *ClientWithResponses) GetVariablesForResourceWithResponse(ctx context.Co return ParseGetVariablesForResourceResponse(rsp) } -// RequestResourceVariablesUpdateWithBodyWithResponse request with arbitrary body returning *RequestResourceVariablesUpdateResponse -func (c *ClientWithResponses) RequestResourceVariablesUpdateWithBodyWithResponse(ctx context.Context, workspaceId string, identifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestResourceVariablesUpdateResponse, error) { - rsp, err := c.RequestResourceVariablesUpdateWithBody(ctx, workspaceId, identifier, contentType, body, reqEditors...) +// RequestResourceVariablesUpdateWithBodyWithResponse request with arbitrary body returning *RequestResourceVariablesUpdateResponse +func (c *ClientWithResponses) RequestResourceVariablesUpdateWithBodyWithResponse(ctx context.Context, workspaceId string, identifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestResourceVariablesUpdateResponse, error) { + rsp, err := c.RequestResourceVariablesUpdateWithBody(ctx, workspaceId, identifier, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestResourceVariablesUpdateResponse(rsp) +} + +func (c *ClientWithResponses) RequestResourceVariablesUpdateWithResponse(ctx context.Context, workspaceId string, identifier string, body RequestResourceVariablesUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestResourceVariablesUpdateResponse, error) { + rsp, err := c.RequestResourceVariablesUpdate(ctx, workspaceId, identifier, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseRequestResourceVariablesUpdateResponse(rsp) +} + +// SearchResourcesWithBodyWithResponse request with arbitrary body returning *SearchResourcesResponse +func (c *ClientWithResponses) SearchResourcesWithBodyWithResponse(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchResourcesResponse, error) { + rsp, err := c.SearchResourcesWithBody(ctx, workspaceId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseRequestResourceVariablesUpdateResponse(rsp) + return ParseSearchResourcesResponse(rsp) } -func (c *ClientWithResponses) RequestResourceVariablesUpdateWithResponse(ctx context.Context, workspaceId string, identifier string, body RequestResourceVariablesUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestResourceVariablesUpdateResponse, error) { - rsp, err := c.RequestResourceVariablesUpdate(ctx, workspaceId, identifier, body, reqEditors...) +func (c *ClientWithResponses) SearchResourcesWithResponse(ctx context.Context, workspaceId string, body SearchResourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchResourcesResponse, error) { + rsp, err := c.SearchResources(ctx, workspaceId, body, reqEditors...) if err != nil { return nil, err } - return ParseRequestResourceVariablesUpdateResponse(rsp) + return ParseSearchResourcesResponse(rsp) } // GetReleaseTargetForResourceInDeploymentWithResponse request returning *GetReleaseTargetForResourceInDeploymentResponse @@ -11800,6 +13176,67 @@ func (c *ClientWithResponses) LinkEnvironmentToSystemWithResponse(ctx context.Co return ParseLinkEnvironmentToSystemResponse(rsp) } +// ListVariableSetsWithResponse request returning *ListVariableSetsResponse +func (c *ClientWithResponses) ListVariableSetsWithResponse(ctx context.Context, workspaceId string, params *ListVariableSetsParams, reqEditors ...RequestEditorFn) (*ListVariableSetsResponse, error) { + rsp, err := c.ListVariableSets(ctx, workspaceId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListVariableSetsResponse(rsp) +} + +// CreateVariableSetWithBodyWithResponse request with arbitrary body returning *CreateVariableSetResponse +func (c *ClientWithResponses) CreateVariableSetWithBodyWithResponse(ctx context.Context, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateVariableSetResponse, error) { + rsp, err := c.CreateVariableSetWithBody(ctx, workspaceId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateVariableSetResponse(rsp) +} + +func (c *ClientWithResponses) CreateVariableSetWithResponse(ctx context.Context, workspaceId string, body CreateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateVariableSetResponse, error) { + rsp, err := c.CreateVariableSet(ctx, workspaceId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateVariableSetResponse(rsp) +} + +// DeleteVariableSetWithResponse request returning *DeleteVariableSetResponse +func (c *ClientWithResponses) DeleteVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*DeleteVariableSetResponse, error) { + rsp, err := c.DeleteVariableSet(ctx, workspaceId, variableSetId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteVariableSetResponse(rsp) +} + +// GetVariableSetWithResponse request returning *GetVariableSetResponse +func (c *ClientWithResponses) GetVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, reqEditors ...RequestEditorFn) (*GetVariableSetResponse, error) { + rsp, err := c.GetVariableSet(ctx, workspaceId, variableSetId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetVariableSetResponse(rsp) +} + +// UpdateVariableSetWithBodyWithResponse request with arbitrary body returning *UpdateVariableSetResponse +func (c *ClientWithResponses) UpdateVariableSetWithBodyWithResponse(ctx context.Context, workspaceId string, variableSetId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateVariableSetResponse, error) { + rsp, err := c.UpdateVariableSetWithBody(ctx, workspaceId, variableSetId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateVariableSetResponse(rsp) +} + +func (c *ClientWithResponses) UpdateVariableSetWithResponse(ctx context.Context, workspaceId string, variableSetId string, body UpdateVariableSetJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateVariableSetResponse, error) { + rsp, err := c.UpdateVariableSet(ctx, workspaceId, variableSetId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateVariableSetResponse(rsp) +} + // ListWorkflowsWithResponse request returning *ListWorkflowsResponse func (c *ClientWithResponses) ListWorkflowsWithResponse(ctx context.Context, workspaceId string, params *ListWorkflowsParams, reqEditors ...RequestEditorFn) (*ListWorkflowsResponse, error) { rsp, err := c.ListWorkflows(ctx, workspaceId, params, reqEditors...) @@ -12407,6 +13844,119 @@ func ParseRequestDeploymentVariableUpdateResponse(rsp *http.Response) (*RequestD return response, nil } +// ParseListDeploymentVersionDependenciesResponse parses an HTTP response from a ListDeploymentVersionDependenciesWithResponse call +func ParseListDeploymentVersionDependenciesResponse(rsp *http.Response) (*ListDeploymentVersionDependenciesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListDeploymentVersionDependenciesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []DeploymentVersionDependency + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseRequestDeploymentVersionDependencyDeletionResponse parses an HTTP response from a RequestDeploymentVersionDependencyDeletionWithResponse call +func ParseRequestDeploymentVersionDependencyDeletionResponse(rsp *http.Response) (*RequestDeploymentVersionDependencyDeletionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RequestDeploymentVersionDependencyDeletionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest DeploymentRequestAccepted + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseRequestDeploymentVersionDependencyUpsertResponse parses an HTTP response from a RequestDeploymentVersionDependencyUpsertWithResponse call +func ParseRequestDeploymentVersionDependencyUpsertResponse(rsp *http.Response) (*RequestDeploymentVersionDependencyUpsertResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RequestDeploymentVersionDependencyUpsertResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest DeploymentRequestAccepted + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + // ParseRequestUserApprovalRecordUpsertResponse parses an HTTP response from a RequestUserApprovalRecordUpsertWithResponse call func ParseRequestUserApprovalRecordUpsertResponse(rsp *http.Response) (*RequestUserApprovalRecordUpsertResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -12505,6 +14055,60 @@ func ParseRequestDeploymentCreationResponse(rsp *http.Response) (*RequestDeploym } response.JSON202 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + } + + return response, nil +} + +// ParseGetDeploymentByNameResponse parses an HTTP response from a GetDeploymentByNameWithResponse call +func ParseGetDeploymentByNameResponse(rsp *http.Response) (*GetDeploymentByNameResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetDeploymentByNameResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DeploymentWithVariablesAndSystems + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil @@ -12611,6 +14215,20 @@ func ParseRequestDeploymentUpsertResponse(rsp *http.Response) (*RequestDeploymen } response.JSON202 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } return response, nil @@ -12805,12 +14423,12 @@ func ParseCreateDeploymentVersionResponse(rsp *http.Response) (*CreateDeployment } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest DeploymentVersion 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 == 400: var dest ErrorResponse @@ -12819,6 +14437,13 @@ func ParseCreateDeploymentVersionResponse(rsp *http.Response) (*CreateDeployment } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + } return response, nil @@ -12887,33 +14512,87 @@ func ParseListEnvironmentsResponse(rsp *http.Response) (*ListEnvironmentsRespons if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseRequestEnvironmentCreationResponse parses an HTTP response from a RequestEnvironmentCreationWithResponse call +func ParseRequestEnvironmentCreationResponse(rsp *http.Response) (*RequestEnvironmentCreationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RequestEnvironmentCreationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest EnvironmentRequestAccepted + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest } return response, nil } -// ParseRequestEnvironmentCreationResponse parses an HTTP response from a RequestEnvironmentCreationWithResponse call -func ParseRequestEnvironmentCreationResponse(rsp *http.Response) (*RequestEnvironmentCreationResponse, error) { +// ParseGetEnvironmentByNameResponse parses an HTTP response from a GetEnvironmentByNameWithResponse call +func ParseGetEnvironmentByNameResponse(rsp *http.Response) (*GetEnvironmentByNameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RequestEnvironmentCreationResponse{ + response := &GetEnvironmentByNameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest EnvironmentRequestAccepted + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EnvironmentWithSystems 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest } @@ -13035,6 +14714,13 @@ func ParseRequestEnvironmentUpsertResponse(rsp *http.Response) (*RequestEnvironm } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } return response, nil @@ -14484,6 +16170,50 @@ func ParseRequestResourceVariablesUpdateResponse(rsp *http.Response) (*RequestRe return response, nil } +// ParseSearchResourcesResponse parses an HTTP response from a SearchResourcesWithResponse call +func ParseSearchResourcesResponse(rsp *http.Response) (*SearchResourcesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SearchResourcesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []Resource `json:"items"` + + // Limit Maximum number of items returned + Limit int `json:"limit"` + + // Offset Number of items skipped + Offset int `json:"offset"` + + // Total Total number of items available + Total int `json:"total"` + } + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + // ParseGetReleaseTargetForResourceInDeploymentResponse parses an HTTP response from a GetReleaseTargetForResourceInDeploymentWithResponse call func ParseGetReleaseTargetForResourceInDeploymentResponse(rsp *http.Response) (*GetReleaseTargetForResourceInDeploymentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -14933,6 +16663,203 @@ func ParseLinkEnvironmentToSystemResponse(rsp *http.Response) (*LinkEnvironmentT return response, nil } +// ParseListVariableSetsResponse parses an HTTP response from a ListVariableSetsWithResponse call +func ParseListVariableSetsResponse(rsp *http.Response) (*ListVariableSetsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListVariableSetsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []VariableSetWithVariables `json:"items"` + + // Limit Maximum number of items returned + Limit int `json:"limit"` + + // Offset Number of items skipped + Offset int `json:"offset"` + + // Total Total number of items available + Total int `json:"total"` + } + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateVariableSetResponse parses an HTTP response from a CreateVariableSetWithResponse call +func ParseCreateVariableSetResponse(rsp *http.Response) (*CreateVariableSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateVariableSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest VariableSet + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteVariableSetResponse parses an HTTP response from a DeleteVariableSetWithResponse call +func ParseDeleteVariableSetResponse(rsp *http.Response) (*DeleteVariableSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteVariableSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest VariableSet + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseGetVariableSetResponse parses an HTTP response from a GetVariableSetWithResponse call +func ParseGetVariableSetResponse(rsp *http.Response) (*GetVariableSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetVariableSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest VariableSetWithVariables + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseUpdateVariableSetResponse parses an HTTP response from a UpdateVariableSetWithResponse call +func ParseUpdateVariableSetResponse(rsp *http.Response) (*UpdateVariableSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateVariableSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest VariableSet + 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 == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + // ParseListWorkflowsResponse parses an HTTP response from a ListWorkflowsWithResponse call func ParseListWorkflowsResponse(rsp *http.Response) (*ListWorkflowsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) From 7e7ce738439b9c21728ddde2db51d19b13df04a2 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 14 May 2026 08:04:30 +0900 Subject: [PATCH 3/6] re generate files --- internal/api/client.gen.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/internal/api/client.gen.go b/internal/api/client.gen.go index f47e156..73cb541 100644 --- a/internal/api/client.gen.go +++ b/internal/api/client.gen.go @@ -553,6 +553,25 @@ type DeploymentVersionDependency struct { // DeploymentVersionStatus defines model for DeploymentVersionStatus. type DeploymentVersionStatus string +// DeploymentVersionWithDependencies defines model for DeploymentVersionWithDependencies. +type DeploymentVersionWithDependencies struct { + Config map[string]interface{} `json:"config"` + CreatedAt time.Time `json:"createdAt"` + + // Dependencies Map of dependency deployment ID to its CEL version selector evaluated against that deployment's current release on the same resource. + Dependencies map[string]struct { + VersionSelector string `json:"versionSelector"` + } `json:"dependencies"` + DeploymentId string `json:"deploymentId"` + Id string `json:"id"` + JobAgentConfig map[string]interface{} `json:"jobAgentConfig"` + Message *string `json:"message,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + Name string `json:"name"` + Status DeploymentVersionStatus `json:"status"` + Tag string `json:"tag"` +} + // DeploymentWindowRule defines model for DeploymentWindowRule. type DeploymentWindowRule struct { // AllowWindow If true, deployments are only allowed during the window. If false, deployments are blocked during the window (deny window) @@ -10394,7 +10413,7 @@ type ListDeploymentVersionsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []DeploymentVersion `json:"items"` + Items []DeploymentVersionWithDependencies `json:"items"` // Limit Maximum number of items returned Limit int `json:"limit"` @@ -14374,7 +14393,7 @@ func ParseListDeploymentVersionsResponse(rsp *http.Response) (*ListDeploymentVer switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []DeploymentVersion `json:"items"` + Items []DeploymentVersionWithDependencies `json:"items"` // Limit Maximum number of items returned Limit int `json:"limit"` From 601eb6b0b929a988c3b13c03b3df12abdc412c34 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 14 May 2026 11:45:24 +0900 Subject: [PATCH 4/6] improve parsing --- cmd/ctrlc/root/workflow/list.go | 12 +++++++++++- cmd/ctrlc/root/workflow/trigger.go | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/ctrlc/root/workflow/list.go b/cmd/ctrlc/root/workflow/list.go index ff8b2a4..02aacc3 100644 --- a/cmd/ctrlc/root/workflow/list.go +++ b/cmd/ctrlc/root/workflow/list.go @@ -27,7 +27,17 @@ func NewListCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } + + if limit < 0 { + return fmt.Errorf("invalid --limit %d, must be non-negative", limit) + } + if offset < 0 { + return fmt.Errorf("invalid --offset %d, must be non-negative", offset) + } params := &api.ListWorkflowsParams{} if limit > 0 { diff --git a/cmd/ctrlc/root/workflow/trigger.go b/cmd/ctrlc/root/workflow/trigger.go index f49601e..e4d02dd 100644 --- a/cmd/ctrlc/root/workflow/trigger.go +++ b/cmd/ctrlc/root/workflow/trigger.go @@ -38,6 +38,9 @@ func NewTriggerCmd() *cobra.Command { if !found { return fmt.Errorf("invalid input format %q, expected key=value", input) } + if key == "" { + return fmt.Errorf("invalid input format %q, empty key, expected key=value", input) + } inputs[key] = value } From 1568711b2f072ea18bc4b07f31eb6a4c19f2aa5c Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 14 May 2026 11:45:42 +0900 Subject: [PATCH 5/6] refactor GetWorkspaceID --- cmd/ctrlc/root/api/get/deployment/deployment.go | 5 ++++- cmd/ctrlc/root/api/get/release/release.go | 5 ++++- .../root/api/get/releasetargets/releasetargets.go | 5 ++++- cmd/ctrlc/root/api/get/resources/resources.go | 5 ++++- cmd/ctrlc/root/api/plan/version/version.go | 5 ++++- .../upsert/deploymentversion/deployment-version.go | 5 ++++- cmd/ctrlc/root/apply/cmd.go | 7 +++---- cmd/ctrlc/root/sync/pipe/pipe.go | 6 +++++- cmd/ctrlc/root/ui/cmd.go | 6 +++--- cmd/ctrlc/root/workflow/trigger.go | 5 ++++- internal/api/client.go | 13 ++++++------- internal/api/resolver/resolver.go | 6 +++--- internal/resources/service.go | 5 ++++- pkg/resourceprovider/resourceprovider.go | 6 +++++- 14 files changed, 57 insertions(+), 27 deletions(-) diff --git a/cmd/ctrlc/root/api/get/deployment/deployment.go b/cmd/ctrlc/root/api/get/deployment/deployment.go index 4ad4cb2..23e083c 100644 --- a/cmd/ctrlc/root/api/get/deployment/deployment.go +++ b/cmd/ctrlc/root/api/get/deployment/deployment.go @@ -25,7 +25,10 @@ func NewDeploymentCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } resp, err := client.GetDeploymentByName(cmd.Context(), workspaceID.String(), name) if err != nil { return fmt.Errorf("failed to get deployment: %w", err) diff --git a/cmd/ctrlc/root/api/get/release/release.go b/cmd/ctrlc/root/api/get/release/release.go index 2c954fb..18d42b1 100644 --- a/cmd/ctrlc/root/api/get/release/release.go +++ b/cmd/ctrlc/root/api/get/release/release.go @@ -25,7 +25,10 @@ func NewReleaseCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } resp, err := client.GetRelease(cmd.Context(), workspaceID.String(), releaseID) if err != nil { return fmt.Errorf("failed to get release: %w", err) diff --git a/cmd/ctrlc/root/api/get/releasetargets/releasetargets.go b/cmd/ctrlc/root/api/get/releasetargets/releasetargets.go index fa83acc..b223518 100644 --- a/cmd/ctrlc/root/api/get/releasetargets/releasetargets.go +++ b/cmd/ctrlc/root/api/get/releasetargets/releasetargets.go @@ -61,7 +61,10 @@ func NewReleaseTargetsCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } params := &api.PreviewReleaseTargetsForResourceParams{} if limit > 0 { diff --git a/cmd/ctrlc/root/api/get/resources/resources.go b/cmd/ctrlc/root/api/get/resources/resources.go index 523a2be..ddd3abc 100644 --- a/cmd/ctrlc/root/api/get/resources/resources.go +++ b/cmd/ctrlc/root/api/get/resources/resources.go @@ -29,7 +29,10 @@ func NewResourcesCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } params := &api.GetAllResourcesParams{} if limit > 0 { diff --git a/cmd/ctrlc/root/api/plan/version/version.go b/cmd/ctrlc/root/api/plan/version/version.go index ef09d40..697b557 100644 --- a/cmd/ctrlc/root/api/plan/version/version.go +++ b/cmd/ctrlc/root/api/plan/version/version.go @@ -50,7 +50,10 @@ func NewPlanVersionCmd() *cobra.Command { metadata["ctrlplane/links"] = string(linksJSON) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } config := cliutil.ConvertConfigArrayToNestedMap(configArray) diff --git a/cmd/ctrlc/root/api/upsert/deploymentversion/deployment-version.go b/cmd/ctrlc/root/api/upsert/deploymentversion/deployment-version.go index d6f6eab..5dd7064 100644 --- a/cmd/ctrlc/root/api/upsert/deploymentversion/deployment-version.go +++ b/cmd/ctrlc/root/api/upsert/deploymentversion/deployment-version.go @@ -93,7 +93,10 @@ func NewUpsertDeploymentVersionCmd() *cobra.Command { stat = &s } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } config := cliutil.ConvertConfigArrayToNestedMap(configArray) diff --git a/cmd/ctrlc/root/apply/cmd.go b/cmd/ctrlc/root/apply/cmd.go index 3b0ea14..c889d32 100644 --- a/cmd/ctrlc/root/apply/cmd.go +++ b/cmd/ctrlc/root/apply/cmd.go @@ -11,7 +11,6 @@ import ( "github.com/ctrlplanedev/cli/internal/api/providers" "github.com/ctrlplanedev/cli/internal/api/resolver" "github.com/fatih/color" - "github.com/google/uuid" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -76,9 +75,9 @@ func runApply(ctx context.Context, filePatterns []string, selectorRaw string) er return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(ctx, workspace) - if workspaceID == uuid.Nil { - return fmt.Errorf("workspace not found: %s", workspace) + workspaceID, err := client.GetWorkspaceID(ctx, workspace) + if err != nil { + return err } resolver := resolver.NewAPIResolver(client, workspaceID) diff --git a/cmd/ctrlc/root/sync/pipe/pipe.go b/cmd/ctrlc/root/sync/pipe/pipe.go index f4272dd..bd22d2e 100644 --- a/cmd/ctrlc/root/sync/pipe/pipe.go +++ b/cmd/ctrlc/root/sync/pipe/pipe.go @@ -101,7 +101,11 @@ func NewSyncPipeCmd() *cobra.Command { return fmt.Errorf("failed to upsert resources: %w", err) } - workspaceID := ctrlplaneClient.GetWorkspaceID(ctx, workspace).String() + workspaceUUID, err := ctrlplaneClient.GetWorkspaceID(ctx, workspace) + if err != nil { + return err + } + workspaceID := workspaceUUID.String() if err := syncResourceVariables(ctx, ctrlplaneClient, workspaceID, resourceInputs); err != nil { return err } diff --git a/cmd/ctrlc/root/ui/cmd.go b/cmd/ctrlc/root/ui/cmd.go index 9e0b952..0fad314 100644 --- a/cmd/ctrlc/root/ui/cmd.go +++ b/cmd/ctrlc/root/ui/cmd.go @@ -36,9 +36,9 @@ func NewUICmd() *cobra.Command { } // Resolve workspace slug to UUID - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) - if workspaceID.String() == "00000000-0000-0000-0000-000000000000" { - return fmt.Errorf("failed to resolve workspace: %s", workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err } // Load last-viewed resource type (default: resources) diff --git a/cmd/ctrlc/root/workflow/trigger.go b/cmd/ctrlc/root/workflow/trigger.go index e4d02dd..ea4e036 100644 --- a/cmd/ctrlc/root/workflow/trigger.go +++ b/cmd/ctrlc/root/workflow/trigger.go @@ -30,7 +30,10 @@ func NewTriggerCmd() *cobra.Command { return fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(cmd.Context(), workspace) + workspaceID, err := client.GetWorkspaceID(cmd.Context(), workspace) + if err != nil { + return err + } inputs := make(map[string]interface{}) for _, input := range inputFlags { diff --git a/internal/api/client.go b/internal/api/client.go index 9da03e1..dfdc9ef 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -23,20 +23,19 @@ func NewAPIKeyClientWithResponses(server string, apiKey string) (*ClientWithResp ) } -func (c *ClientWithResponses) GetWorkspaceID(ctx context.Context, workspace string) uuid.UUID { - id, err := uuid.Parse(workspace) - if err == nil { - return id +func (c *ClientWithResponses) GetWorkspaceID(ctx context.Context, workspace string) (uuid.UUID, error) { + if id, err := uuid.Parse(workspace); err == nil { + return id, nil } resp, err := c.GetWorkspaceBySlugWithResponse(ctx, workspace) if err != nil { - return uuid.Nil + return uuid.Nil, fmt.Errorf("failed to look up workspace %q: %w", workspace, err) } if resp.JSON200 == nil { - return uuid.Nil + return uuid.Nil, fmt.Errorf("workspace %q not found", workspace) } - return resp.JSON200.Id + return resp.JSON200.Id, nil } diff --git a/internal/api/resolver/resolver.go b/internal/api/resolver/resolver.go index 50f582f..4a52995 100644 --- a/internal/api/resolver/resolver.go +++ b/internal/api/resolver/resolver.go @@ -25,9 +25,9 @@ func NewAPIResolver(client *api.ClientWithResponses, workspaceID uuid.UUID) *API } func NewAPIResolverFromWorkspace(ctx context.Context, client *api.ClientWithResponses, workspace string) (*APIResolver, error) { - workspaceID := client.GetWorkspaceID(ctx, workspace) - if workspaceID == uuid.Nil { - return nil, fmt.Errorf("workspace not found: %s", workspace) + workspaceID, err := client.GetWorkspaceID(ctx, workspace) + if err != nil { + return nil, err } return NewAPIResolver(client, workspaceID), nil } diff --git a/internal/resources/service.go b/internal/resources/service.go index f164795..15ce9c2 100644 --- a/internal/resources/service.go +++ b/internal/resources/service.go @@ -26,7 +26,10 @@ func NewAPIResourceService(ctx context.Context, apiURL, apiKey, workspace string return nil, fmt.Errorf("failed to create API client: %w", err) } - workspaceID := client.GetWorkspaceID(ctx, workspace) + workspaceID, err := client.GetWorkspaceID(ctx, workspace) + if err != nil { + return nil, err + } log.Debug("resolved workspace", "input", workspace, "workspaceID", workspaceID.String()) return &APIResourceService{ diff --git a/pkg/resourceprovider/resourceprovider.go b/pkg/resourceprovider/resourceprovider.go index ddde245..b3fc590 100644 --- a/pkg/resourceprovider/resourceprovider.go +++ b/pkg/resourceprovider/resourceprovider.go @@ -12,7 +12,11 @@ import ( func New(client *api.ClientWithResponses, workspace string, name string) (*ResourceProvider, error) { ctx := context.Background() - workspaceId := client.GetWorkspaceID(ctx, workspace).String() + workspaceUUID, err := client.GetWorkspaceID(ctx, workspace) + if err != nil { + return nil, err + } + workspaceId := workspaceUUID.String() log.Debug("Upserting resource provider", "workspaceId", workspaceId, "name", name) From 24743f3ed163bcd3665077424f20f5bdd3fac446 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 14 May 2026 11:54:31 +0900 Subject: [PATCH 6/6] nitpick --- internal/api/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/api/client.go b/internal/api/client.go index dfdc9ef..c60244f 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -34,7 +34,10 @@ func (c *ClientWithResponses) GetWorkspaceID(ctx context.Context, workspace stri } if resp.JSON200 == nil { - return uuid.Nil, fmt.Errorf("workspace %q not found", workspace) + if resp.StatusCode() == http.StatusNotFound { + return uuid.Nil, fmt.Errorf("workspace %q not found", workspace) + } + return uuid.Nil, fmt.Errorf("failed to look up workspace %q: %s: %s", workspace, resp.Status(), strings.TrimSpace(string(resp.Body))) } return resp.JSON200.Id, nil