From 4b447f095981fffcbaee3638a88d546bffafb513 Mon Sep 17 00:00:00 2001 From: Aditya Choudhari Date: Fri, 11 Jul 2025 19:34:30 -0400 Subject: [PATCH 1/4] chore: update metadata match relationship --- cmd/ctrlc/root/api/create/create.go | 4 - .../deployment-version-channel.go | 69 - .../api/create/environment/environment.go | 6 - .../create/releasechannel/release-channel.go | 69 - cmd/ctrlc/root/apply/relationships.go | 55 +- cmd/ctrlc/root/apply/types.go | 16 +- internal/api/client.gen.go | 1274 +++++++++-------- 7 files changed, 723 insertions(+), 770 deletions(-) delete mode 100644 cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go delete mode 100644 cmd/ctrlc/root/api/create/releasechannel/release-channel.go diff --git a/cmd/ctrlc/root/api/create/create.go b/cmd/ctrlc/root/api/create/create.go index 8368680..fe003c1 100644 --- a/cmd/ctrlc/root/api/create/create.go +++ b/cmd/ctrlc/root/api/create/create.go @@ -2,11 +2,9 @@ package create import ( "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/deploymentversion" - "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/deploymentversionchannel" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/environment" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/relationship" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/release" - "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/releasechannel" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/create/system" "github.com/spf13/cobra" ) @@ -21,8 +19,6 @@ func NewCreateCmd() *cobra.Command { }, } - cmd.AddCommand(releasechannel.NewCreateReleaseChannelCmd()) - cmd.AddCommand(deploymentversionchannel.NewCreateDeploymentVersionChannelCmd()) cmd.AddCommand(deploymentversion.NewCreateDeploymentVersionCmd()) cmd.AddCommand(environment.NewCreateEnvironmentCmd()) cmd.AddCommand(relationship.NewRelationshipCmd()) diff --git a/cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go b/cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go deleted file mode 100644 index 1ae5fca..0000000 --- a/cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go +++ /dev/null @@ -1,69 +0,0 @@ -package deploymentversionchannel - -import ( - "encoding/json" - "fmt" - - "github.com/MakeNowJust/heredoc/v2" - "github.com/ctrlplanedev/cli/internal/api" - "github.com/ctrlplanedev/cli/internal/cliutil" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func NewCreateDeploymentVersionChannelCmd() *cobra.Command { - var name string - var deploymentID string - var description string - var selector string - - cmd := &cobra.Command{ - Use: "deployment-version-channel [flags]", - Short: "Create a new deployment version channel", - Long: `Create a new deployment version channel with the specified name and configuration.`, - Example: heredoc.Doc(` - # Create a new deployment version channel - $ ctrlc create deployment-version-channel --name my-version-channel --deployment 1234567890 - - # Create a new deployment version channel with selector - $ ctrlc create deployment-version-channel --name my-version-channel --deployment 1234567890 --selector '{"type":"tag","operator":"equals","value":"v1.0.0"}' - `), - RunE: func(cmd *cobra.Command, args []string) error { - apiURL := viper.GetString("url") - apiKey := viper.GetString("api-key") - client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) - if err != nil { - return fmt.Errorf("failed to create API client: %w", err) - } - - versionSelector := make(map[string]interface{}) - if selector != "" { - if err := json.Unmarshal([]byte(selector), &versionSelector); err != nil { - return fmt.Errorf("failed to parse version selector JSON: %w", err) - } - } - - resp, err := client.CreateDeploymentVersionChannel(cmd.Context(), api.CreateDeploymentVersionChannelJSONRequestBody{ - Name: name, - DeploymentId: deploymentID, - Description: &description, - VersionSelector: versionSelector, - }) - if err != nil { - return fmt.Errorf("failed to create deployment version channel: %w", err) - } - - return cliutil.HandleResponseOutput(cmd, resp) - }, - } - - // Add flags - cmd.Flags().StringVar(&name, "name", "", "Name of the deployment version channel (required)") - cmd.Flags().StringVar(&deploymentID, "deployment", "", "ID of the deployment (required)") - cmd.Flags().StringVar(&selector, "selector", "", "JSON string containing version selector criteria") - cmd.Flags().StringVar(&description, "description", "", "Description of the deployment version channel") - cmd.MarkFlagRequired("name") - cmd.MarkFlagRequired("deployment") - - return cmd -} diff --git a/cmd/ctrlc/root/api/create/environment/environment.go b/cmd/ctrlc/root/api/create/environment/environment.go index 5fcc1fa..18fb610 100644 --- a/cmd/ctrlc/root/api/create/environment/environment.go +++ b/cmd/ctrlc/root/api/create/environment/environment.go @@ -13,8 +13,6 @@ import ( func NewCreateEnvironmentCmd() *cobra.Command { var nameFlag string - var releaseChannels []string - var deploymentVersionChannels []string var system string var resourceSelector string var metadata map[string]string @@ -42,8 +40,6 @@ func NewCreateEnvironmentCmd() *cobra.Command { body := api.CreateEnvironmentJSONRequestBody{} body.Name = nameFlag - body.ReleaseChannels = &releaseChannels - body.DeploymentVersionChannels = &deploymentVersionChannels body.SystemId = system body.Metadata = cliutil.StringMapPtr(metadata) @@ -66,8 +62,6 @@ func NewCreateEnvironmentCmd() *cobra.Command { cmd.Flags().StringVarP(&nameFlag, "name", "n", "", "Name of the environment (required)") cmd.Flags().StringVarP(&system, "system", "s", "", "ID of the system (required)") - cmd.Flags().StringSliceVarP(&releaseChannels, "release-channel", "r", []string{}, "Release channel in format ") - cmd.Flags().StringSliceVarP(&deploymentVersionChannels, "deployment-version-channel", "d", []string{}, "Deployment version channel in format ") cmd.Flags().StringVarP(&resourceSelector, "resource-selector", "f", "", "Resource selector as JSON string") cmd.Flags().StringToStringVarP(&metadata, "metadata", "m", make(map[string]string), "Metadata key-value pairs (e.g. --metadata key=value)") diff --git a/cmd/ctrlc/root/api/create/releasechannel/release-channel.go b/cmd/ctrlc/root/api/create/releasechannel/release-channel.go deleted file mode 100644 index d6fd808..0000000 --- a/cmd/ctrlc/root/api/create/releasechannel/release-channel.go +++ /dev/null @@ -1,69 +0,0 @@ -package releasechannel - -import ( - "encoding/json" - "fmt" - - "github.com/MakeNowJust/heredoc/v2" - "github.com/ctrlplanedev/cli/internal/api" - "github.com/ctrlplanedev/cli/internal/cliutil" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func NewCreateReleaseChannelCmd() *cobra.Command { - var name string - var deploymentID string - var description string - var selector string - - cmd := &cobra.Command{ - Use: "release-channel [flags]", - Short: "Create a new release channel", - Long: `Create a new release channel with the specified name and configuration.`, - Example: heredoc.Doc(` - # Create a new release channel - $ ctrlc create release-channel --name my-release-channel - - # Create a new release channel using Go template syntax - $ ctrlc create release-channel --name my-release-channel --template='{{.status.phase}}' - `), - RunE: func(cmd *cobra.Command, args []string) error { - apiURL := viper.GetString("url") - apiKey := viper.GetString("api-key") - client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) - if err != nil { - return fmt.Errorf("failed to create API client: %w", err) - } - - releaseSelector := make(map[string]interface{}) - if selector != "" { - if err := json.Unmarshal([]byte(selector), &releaseSelector); err != nil { - return fmt.Errorf("failed to parse release selector JSON: %w", err) - } - } - - resp, err := client.CreateReleaseChannel(cmd.Context(), api.CreateReleaseChannelJSONRequestBody{ - Name: name, - DeploymentId: deploymentID, - Description: &description, - ReleaseSelector: releaseSelector, - }) - if err != nil { - return fmt.Errorf("failed to create release channel: %w", err) - } - - return cliutil.HandleResponseOutput(cmd, resp) - }, - } - - // Add flags - cmd.Flags().StringVar(&name, "name", "", "Name of the release channel (required)") - cmd.Flags().StringVar(&deploymentID, "deployment", "", "ID of the deployment (required)") - cmd.Flags().StringVar(&selector, "selector", "", "JSON string containing release selector criteria") - cmd.Flags().StringVar(&description, "description", "", "Description of the release channel") - cmd.MarkFlagRequired("name") - cmd.MarkFlagRequired("deployment-id") - - return cmd -} diff --git a/cmd/ctrlc/root/apply/relationships.go b/cmd/ctrlc/root/apply/relationships.go index d8fefba..8be59be 100644 --- a/cmd/ctrlc/root/apply/relationships.go +++ b/cmd/ctrlc/root/apply/relationships.go @@ -40,12 +40,42 @@ func processResourceRelationships( } } +func createMetadataKeysMatch(match MetadataKeysMatch) (*struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` +}, error) { + if match.Key != nil { + return &struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + SourceKey: *match.SourceKey, + TargetKey: *match.TargetKey, + }, nil + } + + if match.SourceKey == nil || match.TargetKey == nil { + return nil, fmt.Errorf("sourceKey and targetKey must be provided") + } + + return &struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + SourceKey: *match.SourceKey, + TargetKey: *match.TargetKey, + }, nil +} + func createRelationshipRequestBody(workspaceId string, relationship ResourceRelationship) api.CreateResourceRelationshipRule { config := api.CreateResourceRelationshipRule{ - WorkspaceId: workspaceId, - Reference: relationship.Reference, - DependencyType: api.ResourceRelationshipRuleDependencyType(relationship.DependencyType), - MetadataKeysMatches: &[]string{}, + WorkspaceId: workspaceId, + Reference: relationship.Reference, + DependencyType: api.ResourceRelationshipRuleDependencyType(relationship.DependencyType), + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{}, TargetMetadataEquals: &[]struct { Key string `json:"key"` Value string `json:"value"` @@ -82,7 +112,22 @@ func createRelationshipRequestBody(workspaceId string, relationship ResourceRela } if relationship.MetadataKeysMatch != nil { - config.MetadataKeysMatches = &relationship.MetadataKeysMatch + metadataKeysMatches := []struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{} + + for _, match := range relationship.MetadataKeysMatch { + metadataKeysMatch, err := createMetadataKeysMatch(match) + if err != nil { + log.Error("Failed to create metadata keys match", "error", err, "match", match) + continue + } + + metadataKeysMatches = append(metadataKeysMatches, *metadataKeysMatch) + } + + config.MetadataKeysMatches = &metadataKeysMatches } // Log the MetadataTargetKeysEquals for debugging diff --git a/cmd/ctrlc/root/apply/types.go b/cmd/ctrlc/root/apply/types.go index c7d5a0d..5fb1a52 100644 --- a/cmd/ctrlc/root/apply/types.go +++ b/cmd/ctrlc/root/apply/types.go @@ -107,12 +107,18 @@ type SourceResource struct { Version string `yaml:"version"` } +type MetadataKeysMatch struct { + Key *string `yaml:"key,omitempty"` + SourceKey *string `yaml:"sourceKey,omitempty"` + TargetKey *string `yaml:"targetKey,omitempty"` +} + type ResourceRelationship struct { - Reference string `yaml:"reference"` - Target *TargetResource `yaml:"target,omitempty"` - Source *SourceResource `yaml:"source,omitempty"` - MetadataKeysMatch []string `yaml:"metadataKeysMatch"` - DependencyType string `yaml:"dependencyType"` + Reference string `yaml:"reference"` + Target *TargetResource `yaml:"target,omitempty"` + Source *SourceResource `yaml:"source,omitempty"` + MetadataKeysMatch []MetadataKeysMatch `yaml:"metadataKeysMatch"` + DependencyType string `yaml:"dependencyType"` } // Policy structs diff --git a/internal/api/client.gen.go b/internal/api/client.gen.go index 973ff58..e6357a1 100644 --- a/internal/api/client.gen.go +++ b/internal/api/client.gen.go @@ -105,6 +105,14 @@ const ( UpdateDeploymentVersionJSONBodyStatusRejected UpdateDeploymentVersionJSONBodyStatus = "rejected" ) +// Defines values for ListDeploymentVersionsParamsStatus. +const ( + ListDeploymentVersionsParamsStatusBuilding ListDeploymentVersionsParamsStatus = "building" + ListDeploymentVersionsParamsStatusFailed ListDeploymentVersionsParamsStatus = "failed" + ListDeploymentVersionsParamsStatusReady ListDeploymentVersionsParamsStatus = "ready" + ListDeploymentVersionsParamsStatusRejected ListDeploymentVersionsParamsStatus = "rejected" +) + // Defines values for UpsertReleaseJSONBodyStatus. const ( UpsertReleaseJSONBodyStatusBuilding UpsertReleaseJSONBodyStatus = "building" @@ -115,10 +123,10 @@ const ( // Defines values for UpdateReleaseJSONBodyStatus. const ( - Building UpdateReleaseJSONBodyStatus = "building" - Failed UpdateReleaseJSONBodyStatus = "failed" - Ready UpdateReleaseJSONBodyStatus = "ready" - Rejected UpdateReleaseJSONBodyStatus = "rejected" + UpdateReleaseJSONBodyStatusBuilding UpdateReleaseJSONBodyStatus = "building" + UpdateReleaseJSONBodyStatusFailed UpdateReleaseJSONBodyStatus = "failed" + UpdateReleaseJSONBodyStatusReady UpdateReleaseJSONBodyStatus = "ready" + UpdateReleaseJSONBodyStatusRejected UpdateReleaseJSONBodyStatus = "rejected" ) // ApprovalRecord defines model for ApprovalRecord. @@ -171,13 +179,16 @@ type CreateResourceRelationshipRule struct { DependencyDescription *string `json:"dependencyDescription,omitempty"` DependencyType ResourceRelationshipRuleDependencyType `json:"dependencyType"` Description *string `json:"description,omitempty"` - MetadataKeysMatches *[]string `json:"metadataKeysMatches,omitempty"` - Name string `json:"name"` - Reference string `json:"reference"` - SourceKind string `json:"sourceKind"` - SourceVersion string `json:"sourceVersion"` - TargetKind string `json:"targetKind"` - TargetMetadataEquals *[]struct { + MetadataKeysMatches *[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + } `json:"metadataKeysMatches,omitempty"` + Name string `json:"name"` + Reference string `json:"reference"` + SourceKind string `json:"sourceKind"` + SourceVersion string `json:"sourceVersion"` + TargetKind string `json:"targetKind"` + TargetMetadataEquals *[]struct { Key string `json:"key"` Value string `json:"value"` } `json:"targetMetadataEquals,omitempty"` @@ -439,7 +450,9 @@ type JobWithTrigger struct { // JobAgentConfig Configuration for the Job Agent JobAgentConfig map[string]interface{} `json:"jobAgentConfig"` JobAgentId *openapi_types.UUID `json:"jobAgentId,omitempty"` + Links *map[string]string `json:"links,omitempty"` Message *string `json:"message,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` Reason *string `json:"reason,omitempty"` Release *Release `json:"release,omitempty"` Resource *struct { @@ -647,13 +660,16 @@ type ResourceRelationshipRule struct { DependencyType ResourceRelationshipRuleDependencyType `json:"dependencyType"` Description *string `json:"description,omitempty"` Id openapi_types.UUID `json:"id"` - MetadataKeysMatches *[]string `json:"metadataKeysMatches,omitempty"` - Name string `json:"name"` - Reference string `json:"reference"` - SourceKind string `json:"sourceKind"` - SourceVersion string `json:"sourceVersion"` - TargetKind *string `json:"targetKind,omitempty"` - TargetMetadataEquals *[]struct { + MetadataKeysMatches *[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + } `json:"metadataKeysMatches,omitempty"` + Name string `json:"name"` + Reference string `json:"reference"` + SourceKind string `json:"sourceKind"` + SourceVersion string `json:"sourceVersion"` + TargetKind *string `json:"targetKind,omitempty"` + TargetMetadataEquals *[]struct { Key string `json:"key"` Value string `json:"value"` } `json:"targetMetadataEquals,omitempty"` @@ -745,13 +761,16 @@ type UpdateResourceRelationshipRule struct { DependencyDescription *string `json:"dependencyDescription,omitempty"` DependencyType *ResourceRelationshipRuleDependencyType `json:"dependencyType,omitempty"` Description *string `json:"description,omitempty"` - MetadataKeysMatch *[]string `json:"metadataKeysMatch,omitempty"` - Name *string `json:"name,omitempty"` - Reference *string `json:"reference,omitempty"` - SourceKind *string `json:"sourceKind,omitempty"` - SourceVersion *string `json:"sourceVersion,omitempty"` - TargetKind *string `json:"targetKind,omitempty"` - TargetMetadataEquals *[]struct { + MetadataKeysMatches *[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + } `json:"metadataKeysMatches,omitempty"` + Name *string `json:"name,omitempty"` + Reference *string `json:"reference,omitempty"` + SourceKind *string `json:"sourceKind,omitempty"` + SourceVersion *string `json:"sourceVersion,omitempty"` + TargetKind *string `json:"targetKind,omitempty"` + TargetMetadataEquals *[]struct { Key string `json:"key"` Value string `json:"value"` } `json:"targetMetadataEquals,omitempty"` @@ -823,14 +842,6 @@ type Workspace struct { // GetCloudProviderRegionsParamsProvider defines parameters for GetCloudProviderRegions. type GetCloudProviderRegionsParamsProvider string -// CreateDeploymentVersionChannelJSONBody defines parameters for CreateDeploymentVersionChannel. -type CreateDeploymentVersionChannelJSONBody struct { - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Name string `json:"name"` - VersionSelector map[string]interface{} `json:"versionSelector"` -} - // UpsertDeploymentVersionJSONBody defines parameters for UpsertDeploymentVersion. type UpsertDeploymentVersionJSONBody struct { Config *map[string]interface{} `json:"config,omitempty"` @@ -939,17 +950,22 @@ type CreateDeploymentVariableJSONBody struct { ReferenceValues *[]ReferenceDeploymentVariableValue `json:"referenceValues,omitempty"` } +// ListDeploymentVersionsParams defines parameters for ListDeploymentVersions. +type ListDeploymentVersionsParams struct { + Status *ListDeploymentVersionsParamsStatus `form:"status,omitempty" json:"status,omitempty"` +} + +// ListDeploymentVersionsParamsStatus defines parameters for ListDeploymentVersions. +type ListDeploymentVersionsParamsStatus string + // CreateEnvironmentJSONBody defines parameters for CreateEnvironment. type CreateEnvironmentJSONBody struct { - DeploymentVersionChannels *[]string `json:"deploymentVersionChannels,omitempty"` - Description *string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` // Directory The directory path of the environment Directory *string `json:"directory,omitempty"` Metadata *map[string]string `json:"metadata,omitempty"` Name string `json:"name"` - PolicyId *string `json:"policyId,omitempty"` - ReleaseChannels *[]string `json:"releaseChannels,omitempty"` ResourceSelector *map[string]interface{} `json:"resourceSelector,omitempty"` SystemId string `json:"systemId"` } @@ -1041,12 +1057,21 @@ type CreateResourceToResourceRelationshipJSONBody struct { WorkspaceId openapi_types.UUID `json:"workspaceId"` } -// CreateReleaseChannelJSONBody defines parameters for CreateReleaseChannel. -type CreateReleaseChannelJSONBody struct { - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Name string `json:"name"` - ReleaseSelector map[string]interface{} `json:"releaseSelector"` +// PinReleaseTargetJSONBody defines parameters for PinReleaseTarget. +type PinReleaseTargetJSONBody struct { + union json.RawMessage +} + +// PinReleaseTargetJSONBody0 defines parameters for PinReleaseTarget. +type PinReleaseTargetJSONBody0 struct { + // VersionId The ID of the version to pin + VersionId openapi_types.UUID `json:"versionId"` +} + +// PinReleaseTargetJSONBody1 defines parameters for PinReleaseTarget. +type PinReleaseTargetJSONBody1 struct { + // VersionTag The tag of the version to pin + VersionTag string `json:"versionTag"` } // UpsertReleaseJSONBody defines parameters for UpsertRelease. @@ -1160,9 +1185,6 @@ type GetGroupedCountsJSONBody struct { MetadataKeys []string `json:"metadataKeys"` } -// CreateDeploymentVersionChannelJSONRequestBody defines body for CreateDeploymentVersionChannel for application/json ContentType. -type CreateDeploymentVersionChannelJSONRequestBody CreateDeploymentVersionChannelJSONBody - // UpsertDeploymentVersionJSONRequestBody defines body for UpsertDeploymentVersion for application/json ContentType. type UpsertDeploymentVersionJSONRequestBody UpsertDeploymentVersionJSONBody @@ -1211,8 +1233,8 @@ type CreateJobToResourceRelationshipJSONRequestBody CreateJobToResourceRelations // CreateResourceToResourceRelationshipJSONRequestBody defines body for CreateResourceToResourceRelationship for application/json ContentType. type CreateResourceToResourceRelationshipJSONRequestBody CreateResourceToResourceRelationshipJSONBody -// CreateReleaseChannelJSONRequestBody defines body for CreateReleaseChannel for application/json ContentType. -type CreateReleaseChannelJSONRequestBody CreateReleaseChannelJSONBody +// PinReleaseTargetJSONRequestBody defines body for PinReleaseTarget for application/json ContentType. +type PinReleaseTargetJSONRequestBody PinReleaseTargetJSONBody // UpsertReleaseJSONRequestBody defines body for UpsertRelease for application/json ContentType. type UpsertReleaseJSONRequestBody UpsertReleaseJSONBody @@ -2427,11 +2449,6 @@ type ClientInterface interface { // GetCloudProviderRegions request GetCloudProviderRegions(ctx context.Context, provider GetCloudProviderRegionsParamsProvider, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateDeploymentVersionChannelWithBody request with any body - CreateDeploymentVersionChannelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateDeploymentVersionChannel(ctx context.Context, body CreateDeploymentVersionChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpsertDeploymentVersionWithBody request with any body UpsertDeploymentVersionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2481,12 +2498,6 @@ type ClientInterface interface { UpdateDeployment(ctx context.Context, deploymentId openapi_types.UUID, body UpdateDeploymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteDeploymentVersionChannel request - DeleteDeploymentVersionChannel(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteReleaseChannel request - DeleteReleaseChannel(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetResourcesForDeployment request GetResourcesForDeployment(ctx context.Context, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2498,6 +2509,9 @@ type ClientInterface interface { CreateDeploymentVariable(ctx context.Context, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListDeploymentVersions request + ListDeploymentVersions(ctx context.Context, deploymentId openapi_types.UUID, params *ListDeploymentVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateEnvironmentWithBody request with any body CreateEnvironmentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2566,20 +2580,29 @@ type ClientInterface interface { CreateResourceToResourceRelationship(ctx context.Context, body CreateResourceToResourceRelationshipJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateReleaseChannelWithBody request with any body - CreateReleaseChannelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetReleaseTarget request + GetReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateReleaseChannel(ctx context.Context, body CreateReleaseChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetLatestJobs request + GetLatestJobs(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // LockReleaseTarget request LockReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // PinReleaseTargetWithBody request with any body + PinReleaseTargetWithBody(ctx context.Context, releaseTargetId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PinReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, body PinReleaseTargetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetReleaseTargetReleases request GetReleaseTargetReleases(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // UnlockReleaseTarget request UnlockReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // UnpinReleaseTarget request + UnpinReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpsertReleaseWithBody request with any body UpsertReleaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2702,30 +2725,6 @@ func (c *Client) GetCloudProviderRegions(ctx context.Context, provider GetCloudP return c.Client.Do(req) } -func (c *Client) CreateDeploymentVersionChannelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDeploymentVersionChannelRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateDeploymentVersionChannel(ctx context.Context, body CreateDeploymentVersionChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDeploymentVersionChannelRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) UpsertDeploymentVersionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpsertDeploymentVersionRequestWithBody(c.Server, contentType, body) if err != nil { @@ -2954,20 +2953,8 @@ func (c *Client) UpdateDeployment(ctx context.Context, deploymentId openapi_type return c.Client.Do(req) } -func (c *Client) DeleteDeploymentVersionChannel(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDeploymentVersionChannelRequest(c.Server, deploymentId, 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) DeleteReleaseChannel(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteReleaseChannelRequest(c.Server, deploymentId, name) +func (c *Client) GetResourcesForDeployment(ctx context.Context, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetResourcesForDeploymentRequest(c.Server, deploymentId) if err != nil { return nil, err } @@ -2978,8 +2965,8 @@ func (c *Client) DeleteReleaseChannel(ctx context.Context, deploymentId string, return c.Client.Do(req) } -func (c *Client) GetResourcesForDeployment(ctx context.Context, deploymentId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetResourcesForDeploymentRequest(c.Server, deploymentId) +func (c *Client) GetDeploymentVariables(ctx context.Context, deploymentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDeploymentVariablesRequest(c.Server, deploymentId) if err != nil { return nil, err } @@ -2990,8 +2977,8 @@ func (c *Client) GetResourcesForDeployment(ctx context.Context, deploymentId str return c.Client.Do(req) } -func (c *Client) GetDeploymentVariables(ctx context.Context, deploymentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDeploymentVariablesRequest(c.Server, deploymentId) +func (c *Client) CreateDeploymentVariableWithBody(ctx context.Context, deploymentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDeploymentVariableRequestWithBody(c.Server, deploymentId, contentType, body) if err != nil { return nil, err } @@ -3002,8 +2989,8 @@ func (c *Client) GetDeploymentVariables(ctx context.Context, deploymentId openap return c.Client.Do(req) } -func (c *Client) CreateDeploymentVariableWithBody(ctx context.Context, deploymentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDeploymentVariableRequestWithBody(c.Server, deploymentId, contentType, body) +func (c *Client) CreateDeploymentVariable(ctx context.Context, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDeploymentVariableRequest(c.Server, deploymentId, body) if err != nil { return nil, err } @@ -3014,8 +3001,8 @@ func (c *Client) CreateDeploymentVariableWithBody(ctx context.Context, deploymen return c.Client.Do(req) } -func (c *Client) CreateDeploymentVariable(ctx context.Context, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDeploymentVariableRequest(c.Server, deploymentId, body) +func (c *Client) ListDeploymentVersions(ctx context.Context, deploymentId openapi_types.UUID, params *ListDeploymentVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDeploymentVersionsRequest(c.Server, deploymentId, params) if err != nil { return nil, err } @@ -3326,8 +3313,8 @@ func (c *Client) CreateResourceToResourceRelationship(ctx context.Context, body return c.Client.Do(req) } -func (c *Client) CreateReleaseChannelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateReleaseChannelRequestWithBody(c.Server, contentType, body) +func (c *Client) GetReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetReleaseTargetRequest(c.Server, releaseTargetId) if err != nil { return nil, err } @@ -3338,8 +3325,8 @@ func (c *Client) CreateReleaseChannelWithBody(ctx context.Context, contentType s return c.Client.Do(req) } -func (c *Client) CreateReleaseChannel(ctx context.Context, body CreateReleaseChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateReleaseChannelRequest(c.Server, body) +func (c *Client) GetLatestJobs(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetLatestJobsRequest(c.Server, releaseTargetId) if err != nil { return nil, err } @@ -3362,6 +3349,30 @@ func (c *Client) LockReleaseTarget(ctx context.Context, releaseTargetId openapi_ return c.Client.Do(req) } +func (c *Client) PinReleaseTargetWithBody(ctx context.Context, releaseTargetId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPinReleaseTargetRequestWithBody(c.Server, releaseTargetId, 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) PinReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, body PinReleaseTargetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPinReleaseTargetRequest(c.Server, releaseTargetId, 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) GetReleaseTargetReleases(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReleaseTargetReleasesRequest(c.Server, releaseTargetId) if err != nil { @@ -3386,6 +3397,18 @@ func (c *Client) UnlockReleaseTarget(ctx context.Context, releaseTargetId openap return c.Client.Do(req) } +func (c *Client) UnpinReleaseTarget(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUnpinReleaseTargetRequest(c.Server, releaseTargetId) + 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) UpsertReleaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpsertReleaseRequestWithBody(c.Server, contentType, body) if err != nil { @@ -3900,46 +3923,6 @@ func NewGetCloudProviderRegionsRequest(server string, provider GetCloudProviderR return req, nil } -// NewCreateDeploymentVersionChannelRequest calls the generic CreateDeploymentVersionChannel builder with application/json body -func NewCreateDeploymentVersionChannelRequest(server string, body CreateDeploymentVersionChannelJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateDeploymentVersionChannelRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateDeploymentVersionChannelRequestWithBody generates requests for CreateDeploymentVersionChannel with any type of body -func NewCreateDeploymentVersionChannelRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/deployment-version-channels") - 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 -} - // NewUpsertDeploymentVersionRequest calls the generic UpsertDeploymentVersion builder with application/json body func NewUpsertDeploymentVersionRequest(server string, body UpsertDeploymentVersionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -4425,8 +4408,8 @@ func NewUpdateDeploymentRequestWithBody(server string, deploymentId openapi_type return req, nil } -// NewDeleteDeploymentVersionChannelRequest generates requests for DeleteDeploymentVersionChannel -func NewDeleteDeploymentVersionChannelRequest(server string, deploymentId string, name string) (*http.Request, error) { +// NewGetResourcesForDeploymentRequest generates requests for GetResourcesForDeployment +func NewGetResourcesForDeploymentRequest(server string, deploymentId string) (*http.Request, error) { var err error var pathParam0 string @@ -4436,19 +4419,12 @@ func NewDeleteDeploymentVersionChannelRequest(server string, deploymentId string 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/deployments/%s/deployment-version-channels/name/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/deployments/%s/resources", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4458,7 +4434,7 @@ func NewDeleteDeploymentVersionChannelRequest(server string, deploymentId string 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 } @@ -4466,8 +4442,8 @@ func NewDeleteDeploymentVersionChannelRequest(server string, deploymentId string return req, nil } -// NewDeleteReleaseChannelRequest generates requests for DeleteReleaseChannel -func NewDeleteReleaseChannelRequest(server string, deploymentId string, name string) (*http.Request, error) { +// NewGetDeploymentVariablesRequest generates requests for GetDeploymentVariables +func NewGetDeploymentVariablesRequest(server string, deploymentId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -4477,19 +4453,12 @@ func NewDeleteReleaseChannelRequest(server string, deploymentId string, name str 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/deployments/%s/release-channels/name/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/deployments/%s/variables", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4499,7 +4468,7 @@ func NewDeleteReleaseChannelRequest(server string, deploymentId string, name str 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 } @@ -4507,42 +4476,19 @@ func NewDeleteReleaseChannelRequest(server string, deploymentId string, name str return req, nil } -// NewGetResourcesForDeploymentRequest generates requests for GetResourcesForDeployment -func NewGetResourcesForDeploymentRequest(server string, deploymentId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, 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/deployments/%s/resources", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) +// NewCreateDeploymentVariableRequest calls the generic CreateDeploymentVariable builder with application/json body +func NewCreateDeploymentVariableRequest(server string, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } - - return req, nil + bodyReader = bytes.NewReader(buf) + return NewCreateDeploymentVariableRequestWithBody(server, deploymentId, "application/json", bodyReader) } -// NewGetDeploymentVariablesRequest generates requests for GetDeploymentVariables -func NewGetDeploymentVariablesRequest(server string, deploymentId openapi_types.UUID) (*http.Request, error) { +// NewCreateDeploymentVariableRequestWithBody generates requests for CreateDeploymentVariable with any type of body +func NewCreateDeploymentVariableRequestWithBody(server string, deploymentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4567,27 +4513,18 @@ func NewGetDeploymentVariablesRequest(server string, deploymentId openapi_types. return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewCreateDeploymentVariableRequest calls the generic CreateDeploymentVariable builder with application/json body -func NewCreateDeploymentVariableRequest(server string, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateDeploymentVariableRequestWithBody(server, deploymentId, "application/json", bodyReader) + return req, nil } -// NewCreateDeploymentVariableRequestWithBody generates requests for CreateDeploymentVariable with any type of body -func NewCreateDeploymentVariableRequestWithBody(server string, deploymentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewListDeploymentVersionsRequest generates requests for ListDeploymentVersions +func NewListDeploymentVersionsRequest(server string, deploymentId openapi_types.UUID, params *ListDeploymentVersionsParams) (*http.Request, error) { var err error var pathParam0 string @@ -4602,7 +4539,7 @@ func NewCreateDeploymentVariableRequestWithBody(server string, deploymentId open return nil, err } - operationPath := fmt.Sprintf("/v1/deployments/%s/variables", pathParam0) + operationPath := fmt.Sprintf("/v1/deployments/%s/versions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4612,13 +4549,33 @@ func NewCreateDeploymentVariableRequestWithBody(server string, deploymentId open return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + if params != nil { + queryValues := queryURL.Query() + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "status", runtime.ParamLocationQuery, *params.Status); 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 } - req.Header.Add("Content-Type", contentType) - return req, nil } @@ -5290,27 +5247,23 @@ func NewCreateResourceToResourceRelationshipRequestWithBody(server string, conte return req, nil } -// NewCreateReleaseChannelRequest calls the generic CreateReleaseChannel builder with application/json body -func NewCreateReleaseChannelRequest(server string, body CreateReleaseChannelJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetReleaseTargetRequest generates requests for GetReleaseTarget +func NewGetReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "releaseTargetId", runtime.ParamLocationPath, releaseTargetId) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateReleaseChannelRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateReleaseChannelRequestWithBody generates requests for CreateReleaseChannel with any type of body -func NewCreateReleaseChannelRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/release-channels") + operationPath := fmt.Sprintf("/v1/release-targets/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5320,18 +5273,16 @@ func NewCreateReleaseChannelRequestWithBody(server string, contentType string, b return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewLockReleaseTargetRequest generates requests for LockReleaseTarget -func NewLockReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { +// NewGetLatestJobsRequest generates requests for GetLatestJobs +func NewGetLatestJobsRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5346,7 +5297,7 @@ func NewLockReleaseTargetRequest(server string, releaseTargetId openapi_types.UU return nil, err } - operationPath := fmt.Sprintf("/v1/release-targets/%s/lock", pathParam0) + operationPath := fmt.Sprintf("/v1/release-targets/%s/latest-jobs", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5356,7 +5307,7 @@ func NewLockReleaseTargetRequest(server string, releaseTargetId openapi_types.UU return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -5364,8 +5315,8 @@ func NewLockReleaseTargetRequest(server string, releaseTargetId openapi_types.UU return req, nil } -// NewGetReleaseTargetReleasesRequest generates requests for GetReleaseTargetReleases -func NewGetReleaseTargetReleasesRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { +// NewLockReleaseTargetRequest generates requests for LockReleaseTarget +func NewLockReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5380,7 +5331,7 @@ func NewGetReleaseTargetReleasesRequest(server string, releaseTargetId openapi_t return nil, err } - operationPath := fmt.Sprintf("/v1/release-targets/%s/releases", pathParam0) + operationPath := fmt.Sprintf("/v1/release-targets/%s/lock", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5390,7 +5341,7 @@ func NewGetReleaseTargetReleasesRequest(server string, releaseTargetId openapi_t return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -5398,9 +5349,90 @@ func NewGetReleaseTargetReleasesRequest(server string, releaseTargetId openapi_t return req, nil } -// NewUnlockReleaseTargetRequest generates requests for UnlockReleaseTarget -func NewUnlockReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { - var err error +// NewPinReleaseTargetRequest calls the generic PinReleaseTarget builder with application/json body +func NewPinReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID, body PinReleaseTargetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPinReleaseTargetRequestWithBody(server, releaseTargetId, "application/json", bodyReader) +} + +// NewPinReleaseTargetRequestWithBody generates requests for PinReleaseTarget with any type of body +func NewPinReleaseTargetRequestWithBody(server string, releaseTargetId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "releaseTargetId", runtime.ParamLocationPath, releaseTargetId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/release-targets/%s/pin", 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 +} + +// NewGetReleaseTargetReleasesRequest generates requests for GetReleaseTargetReleases +func NewGetReleaseTargetReleasesRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "releaseTargetId", runtime.ParamLocationPath, releaseTargetId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/release-targets/%s/releases", pathParam0) + 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 +} + +// NewUnlockReleaseTargetRequest generates requests for UnlockReleaseTarget +func NewUnlockReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { + var err error var pathParam0 string @@ -5432,6 +5464,40 @@ func NewUnlockReleaseTargetRequest(server string, releaseTargetId openapi_types. return req, nil } +// NewUnpinReleaseTargetRequest generates requests for UnpinReleaseTarget +func NewUnpinReleaseTargetRequest(server string, releaseTargetId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "releaseTargetId", runtime.ParamLocationPath, releaseTargetId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/release-targets/%s/unpin", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewUpsertReleaseRequest calls the generic UpsertRelease builder with application/json body func NewUpsertReleaseRequest(server string, body UpsertReleaseJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -6614,11 +6680,6 @@ type ClientWithResponsesInterface interface { // GetCloudProviderRegionsWithResponse request GetCloudProviderRegionsWithResponse(ctx context.Context, provider GetCloudProviderRegionsParamsProvider, reqEditors ...RequestEditorFn) (*GetCloudProviderRegionsResponse, error) - // CreateDeploymentVersionChannelWithBodyWithResponse request with any body - CreateDeploymentVersionChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDeploymentVersionChannelResponse, error) - - CreateDeploymentVersionChannelWithResponse(ctx context.Context, body CreateDeploymentVersionChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDeploymentVersionChannelResponse, error) - // UpsertDeploymentVersionWithBodyWithResponse request with any body UpsertDeploymentVersionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertDeploymentVersionResponse, error) @@ -6668,12 +6729,6 @@ type ClientWithResponsesInterface interface { UpdateDeploymentWithResponse(ctx context.Context, deploymentId openapi_types.UUID, body UpdateDeploymentJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDeploymentResponse, error) - // DeleteDeploymentVersionChannelWithResponse request - DeleteDeploymentVersionChannelWithResponse(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*DeleteDeploymentVersionChannelResponse, error) - - // DeleteReleaseChannelWithResponse request - DeleteReleaseChannelWithResponse(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*DeleteReleaseChannelResponse, error) - // GetResourcesForDeploymentWithResponse request GetResourcesForDeploymentWithResponse(ctx context.Context, deploymentId string, reqEditors ...RequestEditorFn) (*GetResourcesForDeploymentResponse, error) @@ -6685,6 +6740,9 @@ type ClientWithResponsesInterface interface { CreateDeploymentVariableWithResponse(ctx context.Context, deploymentId openapi_types.UUID, body CreateDeploymentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDeploymentVariableResponse, error) + // ListDeploymentVersionsWithResponse request + ListDeploymentVersionsWithResponse(ctx context.Context, deploymentId openapi_types.UUID, params *ListDeploymentVersionsParams, reqEditors ...RequestEditorFn) (*ListDeploymentVersionsResponse, error) + // CreateEnvironmentWithBodyWithResponse request with any body CreateEnvironmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEnvironmentResponse, error) @@ -6753,20 +6811,29 @@ type ClientWithResponsesInterface interface { CreateResourceToResourceRelationshipWithResponse(ctx context.Context, body CreateResourceToResourceRelationshipJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResourceToResourceRelationshipResponse, error) - // CreateReleaseChannelWithBodyWithResponse request with any body - CreateReleaseChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReleaseChannelResponse, error) + // GetReleaseTargetWithResponse request + GetReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetReleaseTargetResponse, error) - CreateReleaseChannelWithResponse(ctx context.Context, body CreateReleaseChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReleaseChannelResponse, error) + // GetLatestJobsWithResponse request + GetLatestJobsWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetLatestJobsResponse, error) // LockReleaseTargetWithResponse request LockReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*LockReleaseTargetResponse, error) + // PinReleaseTargetWithBodyWithResponse request with any body + PinReleaseTargetWithBodyWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PinReleaseTargetResponse, error) + + PinReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, body PinReleaseTargetJSONRequestBody, reqEditors ...RequestEditorFn) (*PinReleaseTargetResponse, error) + // GetReleaseTargetReleasesWithResponse request GetReleaseTargetReleasesWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetReleaseTargetReleasesResponse, error) // UnlockReleaseTargetWithResponse request UnlockReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnlockReleaseTargetResponse, error) + // UnpinReleaseTargetWithResponse request + UnpinReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpinReleaseTargetResponse, error) + // UpsertReleaseWithBodyWithResponse request with any body UpsertReleaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertReleaseResponse, error) @@ -6902,48 +6969,6 @@ func (r GetCloudProviderRegionsResponse) StatusCode() int { return 0 } -type CreateDeploymentVersionChannelResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - CreatedAt time.Time `json:"createdAt"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Id string `json:"id"` - Name string `json:"name"` - VersionSelector *map[string]interface{} `json:"versionSelector,omitempty"` - } - JSON401 *struct { - Error string `json:"error"` - } - JSON403 *struct { - Error string `json:"error"` - } - JSON409 *struct { - Error string `json:"error"` - Id string `json:"id"` - } - JSON500 *struct { - Error string `json:"error"` - } -} - -// Status returns HTTPResponse.Status -func (r CreateDeploymentVersionChannelResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateDeploymentVersionChannelResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - type UpsertDeploymentVersionResponse struct { Body []byte HTTPResponse *http.Response @@ -7267,25 +7292,20 @@ func (r UpdateDeploymentResponse) StatusCode() int { return 0 } -type DeleteDeploymentVersionChannelResponse struct { +type GetResourcesForDeploymentResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Message string `json:"message"` - } - JSON403 *struct { - Error string `json:"error"` - } - JSON404 *struct { - Error string `json:"error"` + Count *float32 `json:"count,omitempty"` + Resources *[]Resource `json:"resources,omitempty"` } JSON500 *struct { - Error string `json:"error"` + Error *string `json:"error,omitempty"` } } // Status returns HTTPResponse.Status -func (r DeleteDeploymentVersionChannelResponse) Status() string { +func (r GetResourcesForDeploymentResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7293,23 +7313,18 @@ func (r DeleteDeploymentVersionChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteDeploymentVersionChannelResponse) StatusCode() int { +func (r GetResourcesForDeploymentResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteReleaseChannelResponse struct { +type GetDeploymentVariablesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Message string `json:"message"` - } - JSON403 *struct { - Error string `json:"error"` - } - JSON404 *struct { + JSON200 *[]DeploymentVariable + JSON404 *struct { Error string `json:"error"` } JSON500 *struct { @@ -7318,7 +7333,7 @@ type DeleteReleaseChannelResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteReleaseChannelResponse) Status() string { +func (r GetDeploymentVariablesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7326,46 +7341,21 @@ func (r DeleteReleaseChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteReleaseChannelResponse) StatusCode() int { +func (r GetDeploymentVariablesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetResourcesForDeploymentResponse struct { +type CreateDeploymentVariableResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Count *float32 `json:"count,omitempty"` - Resources *[]Resource `json:"resources,omitempty"` - } - JSON500 *struct { - Error *string `json:"error,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetResourcesForDeploymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetResourcesForDeploymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + JSON200 *DeploymentVariable + JSON400 *struct { + Error string `json:"error"` } - return 0 -} - -type GetDeploymentVariablesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]DeploymentVariable - JSON404 *struct { + JSON404 *struct { Error string `json:"error"` } JSON500 *struct { @@ -7374,7 +7364,7 @@ type GetDeploymentVariablesResponse struct { } // Status returns HTTPResponse.Status -func (r GetDeploymentVariablesResponse) Status() string { +func (r CreateDeploymentVariableResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7382,21 +7372,18 @@ func (r GetDeploymentVariablesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDeploymentVariablesResponse) StatusCode() int { +func (r CreateDeploymentVariableResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateDeploymentVariableResponse struct { +type ListDeploymentVersionsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DeploymentVariable - JSON400 *struct { - Error string `json:"error"` - } - JSON404 *struct { + JSON200 *[]DeploymentVersion + JSON404 *struct { Error string `json:"error"` } JSON500 *struct { @@ -7405,7 +7392,7 @@ type CreateDeploymentVariableResponse struct { } // Status returns HTTPResponse.Status -func (r CreateDeploymentVariableResponse) Status() string { +func (r ListDeploymentVersionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7413,7 +7400,7 @@ func (r CreateDeploymentVariableResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateDeploymentVariableResponse) StatusCode() int { +func (r ListDeploymentVersionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7656,7 +7643,8 @@ type UpdateJobResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Id string `json:"id"` + Message string `json:"message"` + Success bool `json:"success"` } } @@ -7911,34 +7899,45 @@ func (r CreateResourceToResourceRelationshipResponse) StatusCode() int { return 0 } -type CreateReleaseChannelResponse struct { +type GetReleaseTargetResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - CreatedAt time.Time `json:"createdAt"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Id string `json:"id"` - Name string `json:"name"` - ReleaseSelector *map[string]interface{} `json:"releaseSelector,omitempty"` + JSON200 *ReleaseTarget + JSON404 *struct { + Error *string `json:"error,omitempty"` } - JSON401 *struct { - Error string `json:"error"` +} + +// Status returns HTTPResponse.Status +func (r GetReleaseTargetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - JSON403 *struct { - Error string `json:"error"` + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetReleaseTargetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - JSON409 *struct { - Error string `json:"error"` - Id string `json:"id"` + return 0 +} + +type GetLatestJobsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]JobWithTrigger + JSON404 *struct { + Error *string `json:"error,omitempty"` } JSON500 *struct { - Error string `json:"error"` + Error *string `json:"error,omitempty"` } } // Status returns HTTPResponse.Status -func (r CreateReleaseChannelResponse) Status() string { +func (r GetLatestJobsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7946,7 +7945,7 @@ func (r CreateReleaseChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateReleaseChannelResponse) StatusCode() int { +func (r GetLatestJobsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7981,11 +7980,44 @@ func (r LockReleaseTargetResponse) StatusCode() int { return 0 } -type GetReleaseTargetReleasesResponse struct { +type PinReleaseTargetResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]struct { - Deployment Deployment `json:"deployment"` + JSON200 *struct { + Success *bool `json:"success,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + } + JSON404 *struct { + Error *string `json:"error,omitempty"` + } + JSON500 *struct { + Error *string `json:"error,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r PinReleaseTargetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PinReleaseTargetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetReleaseTargetReleasesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Deployment Deployment `json:"deployment"` Variables []struct { Key string `json:"key"` Value string `json:"value"` @@ -8047,6 +8079,39 @@ func (r UnlockReleaseTargetResponse) StatusCode() int { return 0 } +type UnpinReleaseTargetResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Success *bool `json:"success,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + } + JSON404 *struct { + Error *string `json:"error,omitempty"` + } + JSON500 *struct { + Error *string `json:"error,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UnpinReleaseTargetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UnpinReleaseTargetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type UpsertReleaseResponse struct { Body []byte HTTPResponse *http.Response @@ -8890,23 +8955,6 @@ func (c *ClientWithResponses) GetCloudProviderRegionsWithResponse(ctx context.Co return ParseGetCloudProviderRegionsResponse(rsp) } -// CreateDeploymentVersionChannelWithBodyWithResponse request with arbitrary body returning *CreateDeploymentVersionChannelResponse -func (c *ClientWithResponses) CreateDeploymentVersionChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDeploymentVersionChannelResponse, error) { - rsp, err := c.CreateDeploymentVersionChannelWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateDeploymentVersionChannelResponse(rsp) -} - -func (c *ClientWithResponses) CreateDeploymentVersionChannelWithResponse(ctx context.Context, body CreateDeploymentVersionChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDeploymentVersionChannelResponse, error) { - rsp, err := c.CreateDeploymentVersionChannel(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateDeploymentVersionChannelResponse(rsp) -} - // UpsertDeploymentVersionWithBodyWithResponse request with arbitrary body returning *UpsertDeploymentVersionResponse func (c *ClientWithResponses) UpsertDeploymentVersionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertDeploymentVersionResponse, error) { rsp, err := c.UpsertDeploymentVersionWithBody(ctx, contentType, body, reqEditors...) @@ -9070,24 +9118,6 @@ func (c *ClientWithResponses) UpdateDeploymentWithResponse(ctx context.Context, return ParseUpdateDeploymentResponse(rsp) } -// DeleteDeploymentVersionChannelWithResponse request returning *DeleteDeploymentVersionChannelResponse -func (c *ClientWithResponses) DeleteDeploymentVersionChannelWithResponse(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*DeleteDeploymentVersionChannelResponse, error) { - rsp, err := c.DeleteDeploymentVersionChannel(ctx, deploymentId, name, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteDeploymentVersionChannelResponse(rsp) -} - -// DeleteReleaseChannelWithResponse request returning *DeleteReleaseChannelResponse -func (c *ClientWithResponses) DeleteReleaseChannelWithResponse(ctx context.Context, deploymentId string, name string, reqEditors ...RequestEditorFn) (*DeleteReleaseChannelResponse, error) { - rsp, err := c.DeleteReleaseChannel(ctx, deploymentId, name, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteReleaseChannelResponse(rsp) -} - // GetResourcesForDeploymentWithResponse request returning *GetResourcesForDeploymentResponse func (c *ClientWithResponses) GetResourcesForDeploymentWithResponse(ctx context.Context, deploymentId string, reqEditors ...RequestEditorFn) (*GetResourcesForDeploymentResponse, error) { rsp, err := c.GetResourcesForDeployment(ctx, deploymentId, reqEditors...) @@ -9123,6 +9153,15 @@ func (c *ClientWithResponses) CreateDeploymentVariableWithResponse(ctx context.C return ParseCreateDeploymentVariableResponse(rsp) } +// ListDeploymentVersionsWithResponse request returning *ListDeploymentVersionsResponse +func (c *ClientWithResponses) ListDeploymentVersionsWithResponse(ctx context.Context, deploymentId openapi_types.UUID, params *ListDeploymentVersionsParams, reqEditors ...RequestEditorFn) (*ListDeploymentVersionsResponse, error) { + rsp, err := c.ListDeploymentVersions(ctx, deploymentId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListDeploymentVersionsResponse(rsp) +} + // CreateEnvironmentWithBodyWithResponse request with arbitrary body returning *CreateEnvironmentResponse func (c *ClientWithResponses) CreateEnvironmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEnvironmentResponse, error) { rsp, err := c.CreateEnvironmentWithBody(ctx, contentType, body, reqEditors...) @@ -9341,21 +9380,22 @@ func (c *ClientWithResponses) CreateResourceToResourceRelationshipWithResponse(c return ParseCreateResourceToResourceRelationshipResponse(rsp) } -// CreateReleaseChannelWithBodyWithResponse request with arbitrary body returning *CreateReleaseChannelResponse -func (c *ClientWithResponses) CreateReleaseChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateReleaseChannelResponse, error) { - rsp, err := c.CreateReleaseChannelWithBody(ctx, contentType, body, reqEditors...) +// GetReleaseTargetWithResponse request returning *GetReleaseTargetResponse +func (c *ClientWithResponses) GetReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetReleaseTargetResponse, error) { + rsp, err := c.GetReleaseTarget(ctx, releaseTargetId, reqEditors...) if err != nil { return nil, err } - return ParseCreateReleaseChannelResponse(rsp) + return ParseGetReleaseTargetResponse(rsp) } -func (c *ClientWithResponses) CreateReleaseChannelWithResponse(ctx context.Context, body CreateReleaseChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateReleaseChannelResponse, error) { - rsp, err := c.CreateReleaseChannel(ctx, body, reqEditors...) +// GetLatestJobsWithResponse request returning *GetLatestJobsResponse +func (c *ClientWithResponses) GetLatestJobsWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetLatestJobsResponse, error) { + rsp, err := c.GetLatestJobs(ctx, releaseTargetId, reqEditors...) if err != nil { return nil, err } - return ParseCreateReleaseChannelResponse(rsp) + return ParseGetLatestJobsResponse(rsp) } // LockReleaseTargetWithResponse request returning *LockReleaseTargetResponse @@ -9367,6 +9407,23 @@ func (c *ClientWithResponses) LockReleaseTargetWithResponse(ctx context.Context, return ParseLockReleaseTargetResponse(rsp) } +// PinReleaseTargetWithBodyWithResponse request with arbitrary body returning *PinReleaseTargetResponse +func (c *ClientWithResponses) PinReleaseTargetWithBodyWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PinReleaseTargetResponse, error) { + rsp, err := c.PinReleaseTargetWithBody(ctx, releaseTargetId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePinReleaseTargetResponse(rsp) +} + +func (c *ClientWithResponses) PinReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, body PinReleaseTargetJSONRequestBody, reqEditors ...RequestEditorFn) (*PinReleaseTargetResponse, error) { + rsp, err := c.PinReleaseTarget(ctx, releaseTargetId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePinReleaseTargetResponse(rsp) +} + // GetReleaseTargetReleasesWithResponse request returning *GetReleaseTargetReleasesResponse func (c *ClientWithResponses) GetReleaseTargetReleasesWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetReleaseTargetReleasesResponse, error) { rsp, err := c.GetReleaseTargetReleases(ctx, releaseTargetId, reqEditors...) @@ -9385,6 +9442,15 @@ func (c *ClientWithResponses) UnlockReleaseTargetWithResponse(ctx context.Contex return ParseUnlockReleaseTargetResponse(rsp) } +// UnpinReleaseTargetWithResponse request returning *UnpinReleaseTargetResponse +func (c *ClientWithResponses) UnpinReleaseTargetWithResponse(ctx context.Context, releaseTargetId openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpinReleaseTargetResponse, error) { + rsp, err := c.UnpinReleaseTarget(ctx, releaseTargetId, reqEditors...) + if err != nil { + return nil, err + } + return ParseUnpinReleaseTargetResponse(rsp) +} + // UpsertReleaseWithBodyWithResponse request with arbitrary body returning *UpsertReleaseResponse func (c *ClientWithResponses) UpsertReleaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertReleaseResponse, error) { rsp, err := c.UpsertReleaseWithBody(ctx, contentType, body, reqEditors...) @@ -9769,76 +9835,6 @@ func ParseGetCloudProviderRegionsResponse(rsp *http.Response) (*GetCloudProvider return response, nil } -// ParseCreateDeploymentVersionChannelResponse parses an HTTP response from a CreateDeploymentVersionChannelWithResponse call -func ParseCreateDeploymentVersionChannelResponse(rsp *http.Response) (*CreateDeploymentVersionChannelResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateDeploymentVersionChannelResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - CreatedAt time.Time `json:"createdAt"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Id string `json:"id"` - Name string `json:"name"` - VersionSelector *map[string]interface{} `json:"versionSelector,omitempty"` - } - 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 == 401: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest struct { - Error string `json:"error"` - Id string `json:"id"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - // ParseUpsertDeploymentVersionResponse parses an HTTP response from a UpsertDeploymentVersionWithResponse call func ParseUpsertDeploymentVersionResponse(rsp *http.Response) (*UpsertDeploymentVersionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -10356,15 +10352,15 @@ func ParseUpdateDeploymentResponse(rsp *http.Response) (*UpdateDeploymentRespons return response, nil } -// ParseDeleteDeploymentVersionChannelResponse parses an HTTP response from a DeleteDeploymentVersionChannelWithResponse call -func ParseDeleteDeploymentVersionChannelResponse(rsp *http.Response) (*DeleteDeploymentVersionChannelResponse, error) { +// ParseGetResourcesForDeploymentResponse parses an HTTP response from a GetResourcesForDeploymentWithResponse call +func ParseGetResourcesForDeploymentResponse(rsp *http.Response) (*GetResourcesForDeploymentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteDeploymentVersionChannelResponse{ + response := &GetResourcesForDeploymentResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -10372,34 +10368,17 @@ func ParseDeleteDeploymentVersionChannelResponse(rsp *http.Response) (*DeleteDep switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Message string `json:"message"` + Count *float32 `json:"count,omitempty"` + Resources *[]Resource `json:"resources,omitempty"` } 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 == 403: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest struct { - Error string `json:"error"` + Error *string `json:"error,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -10411,38 +10390,27 @@ func ParseDeleteDeploymentVersionChannelResponse(rsp *http.Response) (*DeleteDep return response, nil } -// ParseDeleteReleaseChannelResponse parses an HTTP response from a DeleteReleaseChannelWithResponse call -func ParseDeleteReleaseChannelResponse(rsp *http.Response) (*DeleteReleaseChannelResponse, error) { +// ParseGetDeploymentVariablesResponse parses an HTTP response from a GetDeploymentVariablesWithResponse call +func ParseGetDeploymentVariablesResponse(rsp *http.Response) (*GetDeploymentVariablesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteReleaseChannelResponse{ + response := &GetDeploymentVariablesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Message string `json:"message"` - } + var dest []DeploymentVariable 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 == 403: - var dest struct { - Error string `json:"error"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { Error string `json:"error"` @@ -10466,64 +10434,35 @@ func ParseDeleteReleaseChannelResponse(rsp *http.Response) (*DeleteReleaseChanne return response, nil } -// ParseGetResourcesForDeploymentResponse parses an HTTP response from a GetResourcesForDeploymentWithResponse call -func ParseGetResourcesForDeploymentResponse(rsp *http.Response) (*GetResourcesForDeploymentResponse, error) { +// ParseCreateDeploymentVariableResponse parses an HTTP response from a CreateDeploymentVariableWithResponse call +func ParseCreateDeploymentVariableResponse(rsp *http.Response) (*CreateDeploymentVariableResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetResourcesForDeploymentResponse{ + response := &CreateDeploymentVariableResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Count *float32 `json:"count,omitempty"` - Resources *[]Resource `json:"resources,omitempty"` - } + var dest DeploymentVariable 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 == 500: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Error *string `json:"error,omitempty"` + Error string `json:"error"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseGetDeploymentVariablesResponse parses an HTTP response from a GetDeploymentVariablesWithResponse call -func ParseGetDeploymentVariablesResponse(rsp *http.Response) (*GetDeploymentVariablesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetDeploymentVariablesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []DeploymentVariable - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { @@ -10548,36 +10487,27 @@ func ParseGetDeploymentVariablesResponse(rsp *http.Response) (*GetDeploymentVari return response, nil } -// ParseCreateDeploymentVariableResponse parses an HTTP response from a CreateDeploymentVariableWithResponse call -func ParseCreateDeploymentVariableResponse(rsp *http.Response) (*CreateDeploymentVariableResponse, error) { +// ParseListDeploymentVersionsResponse parses an HTTP response from a ListDeploymentVersionsWithResponse call +func ParseListDeploymentVersionsResponse(rsp *http.Response) (*ListDeploymentVersionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateDeploymentVariableResponse{ + response := &ListDeploymentVersionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DeploymentVariable + var dest []DeploymentVersion 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 struct { - Error string `json:"error"` - } - 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 struct { Error string `json:"error"` @@ -10918,7 +10848,8 @@ func ParseUpdateJobResponse(rsp *http.Response) (*UpdateJobResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Id string `json:"id"` + Message string `json:"message"` + Success bool `json:"success"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -11293,65 +11224,74 @@ func ParseCreateResourceToResourceRelationshipResponse(rsp *http.Response) (*Cre return response, nil } -// ParseCreateReleaseChannelResponse parses an HTTP response from a CreateReleaseChannelWithResponse call -func ParseCreateReleaseChannelResponse(rsp *http.Response) (*CreateReleaseChannelResponse, error) { +// ParseGetReleaseTargetResponse parses an HTTP response from a GetReleaseTargetWithResponse call +func ParseGetReleaseTargetResponse(rsp *http.Response) (*GetReleaseTargetResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateReleaseChannelResponse{ + response := &GetReleaseTargetResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - CreatedAt time.Time `json:"createdAt"` - DeploymentId string `json:"deploymentId"` - Description *string `json:"description"` - Id string `json:"id"` - Name string `json:"name"` - ReleaseSelector *map[string]interface{} `json:"releaseSelector,omitempty"` - } + var dest ReleaseTarget 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 == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { - Error string `json:"error"` + Error *string `json:"error,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest struct { - Error string `json:"error"` - } + } + + return response, nil +} + +// ParseGetLatestJobsResponse parses an HTTP response from a GetLatestJobsWithResponse call +func ParseGetLatestJobsResponse(rsp *http.Response) (*GetLatestJobsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetLatestJobsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []JobWithTrigger if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { - Error string `json:"error"` - Id string `json:"id"` + Error *string `json:"error,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON409 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest struct { - Error string `json:"error"` + Error *string `json:"error,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -11407,6 +11347,61 @@ func ParseLockReleaseTargetResponse(rsp *http.Response) (*LockReleaseTargetRespo return response, nil } +// ParsePinReleaseTargetResponse parses an HTTP response from a PinReleaseTargetWithResponse call +func ParsePinReleaseTargetResponse(rsp *http.Response) (*PinReleaseTargetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PinReleaseTargetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Success *bool `json:"success,omitempty"` + } + 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 struct { + Error *string `json:"error,omitempty"` + } + 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 struct { + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest struct { + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseGetReleaseTargetReleasesResponse parses an HTTP response from a GetReleaseTargetReleasesWithResponse call func ParseGetReleaseTargetReleasesResponse(rsp *http.Response) (*GetReleaseTargetReleasesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -11511,6 +11506,61 @@ func ParseUnlockReleaseTargetResponse(rsp *http.Response) (*UnlockReleaseTargetR return response, nil } +// ParseUnpinReleaseTargetResponse parses an HTTP response from a UnpinReleaseTargetWithResponse call +func ParseUnpinReleaseTargetResponse(rsp *http.Response) (*UnpinReleaseTargetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UnpinReleaseTargetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Success *bool `json:"success,omitempty"` + } + 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 struct { + Error *string `json:"error,omitempty"` + } + 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 struct { + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest struct { + Error *string `json:"error,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseUpsertReleaseResponse parses an HTTP response from a UpsertReleaseWithResponse call func ParseUpsertReleaseResponse(rsp *http.Response) (*UpsertReleaseResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) From f234182f8394580692bbaade619d960c738a717e Mon Sep 17 00:00:00 2001 From: Aditya Choudhari Date: Fri, 11 Jul 2025 19:47:26 -0400 Subject: [PATCH 2/4] fix --- cmd/ctrlc/root/api/delete/delete.go | 4 -- .../deployment-version-channel.go | 48 ------------------- .../delete/releasechannel/release-channel.go | 48 ------------------- 3 files changed, 100 deletions(-) delete mode 100644 cmd/ctrlc/root/api/delete/deploymentversionchannel/deployment-version-channel.go delete mode 100644 cmd/ctrlc/root/api/delete/releasechannel/release-channel.go diff --git a/cmd/ctrlc/root/api/delete/delete.go b/cmd/ctrlc/root/api/delete/delete.go index 9881285..dc7773f 100644 --- a/cmd/ctrlc/root/api/delete/delete.go +++ b/cmd/ctrlc/root/api/delete/delete.go @@ -1,10 +1,8 @@ package delete import ( - "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/delete/deploymentversionchannel" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/delete/environment" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/delete/policy" - "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/delete/releasechannel" "github.com/ctrlplanedev/cli/cmd/ctrlc/root/api/delete/resource" "github.com/spf13/cobra" ) @@ -21,8 +19,6 @@ func NewDeleteCmd() *cobra.Command { cmd.AddCommand(resource.NewDeleteResourceCmd()) cmd.AddCommand(environment.NewDeleteEnvironmentCmd()) - cmd.AddCommand(releasechannel.NewDeleteReleaseChannelCmd()) - cmd.AddCommand(deploymentversionchannel.NewDeleteDeploymentVersionChannelCmd()) cmd.AddCommand(policy.NewDeletePolicyCmd()) return cmd } diff --git a/cmd/ctrlc/root/api/delete/deploymentversionchannel/deployment-version-channel.go b/cmd/ctrlc/root/api/delete/deploymentversionchannel/deployment-version-channel.go deleted file mode 100644 index 12b317c..0000000 --- a/cmd/ctrlc/root/api/delete/deploymentversionchannel/deployment-version-channel.go +++ /dev/null @@ -1,48 +0,0 @@ -package deploymentversionchannel - -import ( - "fmt" - - "github.com/MakeNowJust/heredoc/v2" - "github.com/ctrlplanedev/cli/internal/api" - "github.com/ctrlplanedev/cli/internal/cliutil" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func NewDeleteDeploymentVersionChannelCmd() *cobra.Command { - var deploymentID string - var name string - - cmd := &cobra.Command{ - Use: "deployment-version-channel [flags]", - Short: "Delete a deployment version channel", - Long: `Delete a deployment version channel by specifying a deployment ID and a name.`, - Example: heredoc.Doc(` - $ ctrlc delete deployment-version-channel --deployment 123e4567-e89b-12d3-a456-426614174000 --name mychannel - `), - RunE: func(cmd *cobra.Command, args []string) error { - if deploymentID == "" || name == "" { - return fmt.Errorf("deployment and name are required") - } - - apiURL := viper.GetString("url") - apiKey := viper.GetString("api-key") - client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) - if err != nil { - return fmt.Errorf("failed to create API client: %w", err) - } - resp, err := client.DeleteDeploymentVersionChannel(cmd.Context(), deploymentID, name) - if err != nil { - return fmt.Errorf("failed to delete deployment version channel: %w", err) - } - - return cliutil.HandleResponseOutput(cmd, resp) - }, - } - - cmd.Flags().StringVar(&deploymentID, "deployment", "", "Deployment ID") - cmd.Flags().StringVar(&name, "name", "", "Deployment version channel name") - - return cmd -} diff --git a/cmd/ctrlc/root/api/delete/releasechannel/release-channel.go b/cmd/ctrlc/root/api/delete/releasechannel/release-channel.go deleted file mode 100644 index 2b32400..0000000 --- a/cmd/ctrlc/root/api/delete/releasechannel/release-channel.go +++ /dev/null @@ -1,48 +0,0 @@ -package releasechannel - -import ( - "fmt" - - "github.com/MakeNowJust/heredoc/v2" - "github.com/ctrlplanedev/cli/internal/api" - "github.com/ctrlplanedev/cli/internal/cliutil" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func NewDeleteReleaseChannelCmd() *cobra.Command { - var deploymentId string - var name string - - cmd := &cobra.Command{ - Use: "release-channel [flags]", - Short: "Delete a release channel", - Long: `Delete a release channel by specifying a deployment ID and a name.`, - Example: heredoc.Doc(` - $ ctrlc delete release-channel --deployment 123e4567-e89b-12d3-a456-426614174000 --name mychannel - `), - RunE: func(cmd *cobra.Command, args []string) error { - if deploymentId == "" || name == "" { - return fmt.Errorf("deployment and name are required") - } - - apiURL := viper.GetString("url") - apiKey := viper.GetString("api-key") - client, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey) - if err != nil { - return fmt.Errorf("failed to create API client: %w", err) - } - resp, err := client.DeleteReleaseChannel(cmd.Context(), deploymentId, name) - if err != nil { - return fmt.Errorf("failed to delete release channel: %w", err) - } - - return cliutil.HandleResponseOutput(cmd, resp) - }, - } - - cmd.Flags().StringVar(&deploymentId, "deployment", "", "Deployment ID") - cmd.Flags().StringVar(&name, "name", "", "Release channel name") - - return cmd -} From 21926187a16c7d306bb3cb7ac37bccfbce50e33a Mon Sep 17 00:00:00 2001 From: Aditya Choudhari Date: Fri, 11 Jul 2025 19:54:50 -0400 Subject: [PATCH 3/4] more fix --- cmd/ctrlc/root/sync/aws/eks/eks.go | 8 +++++++- cmd/ctrlc/root/sync/aws/rds/rds.go | 8 +++++++- cmd/ctrlc/root/sync/azure/aks/aks.go | 8 +++++++- cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go | 8 +++++++- cmd/ctrlc/root/sync/google/gke/gke.go | 8 +++++++- cmd/ctrlc/root/sync/kubernetes/vcluster.go | 7 ++++++- 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/cmd/ctrlc/root/sync/aws/eks/eks.go b/cmd/ctrlc/root/sync/aws/eks/eks.go index 8a7a32b..38485a1 100644 --- a/cmd/ctrlc/root/sync/aws/eks/eks.go +++ b/cmd/ctrlc/root/sync/aws/eks/eks.go @@ -293,7 +293,13 @@ var relationshipRules = []api.CreateResourceRelationshipRule{ TargetVersion: "ctrlplane.dev/network/v1", TargetKind: "AmazonNetwork", - MetadataKeysMatches: &[]string{"aws/region", "network/name"}, + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: "aws/region", TargetKey: "aws/region"}, + {SourceKey: "network/name", TargetKey: "network/name"}, + }, }, } diff --git a/cmd/ctrlc/root/sync/aws/rds/rds.go b/cmd/ctrlc/root/sync/aws/rds/rds.go index 5585e88..d84dc69 100644 --- a/cmd/ctrlc/root/sync/aws/rds/rds.go +++ b/cmd/ctrlc/root/sync/aws/rds/rds.go @@ -468,7 +468,13 @@ var relationshipRules = []api.CreateResourceRelationshipRule{ TargetVersion: "ctrlplane.dev/network/v1", TargetKind: "AmazonNetwork", - MetadataKeysMatches: &[]string{"aws/region", "network/name"}, + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: "aws/region", TargetKey: "aws/region"}, + {SourceKey: "network/name", TargetKey: "network/name"}, + }, }, } diff --git a/cmd/ctrlc/root/sync/azure/aks/aks.go b/cmd/ctrlc/root/sync/azure/aks/aks.go index 9890010..611d38c 100644 --- a/cmd/ctrlc/root/sync/azure/aks/aks.go +++ b/cmd/ctrlc/root/sync/azure/aks/aks.go @@ -421,7 +421,13 @@ var relationshipRules = []api.CreateResourceRelationshipRule{ TargetVersion: "ctrlplane.dev/network/v1", TargetKind: "AzureNetwork", - MetadataKeysMatches: &[]string{"azure/subscription", "azure/resource-group"}, + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: "azure/subscription", TargetKey: "azure/subscription"}, + {SourceKey: "azure/resource-group", TargetKey: "azure/resource-group"}, + }, }, } diff --git a/cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go b/cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go index ece1b7d..e8a34d9 100644 --- a/cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go +++ b/cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go @@ -382,7 +382,13 @@ var relationshipRules = []api.CreateResourceRelationshipRule{ TargetVersion: "ctrlplane.dev/network/v1", TargetKind: "GoogleNetwork", - MetadataKeysMatches: &[]string{"google/project", "network/id"}, + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: "google/project", TargetKey: "google/project"}, + {SourceKey: "network/id", TargetKey: "network/id"}, + }, }, } diff --git a/cmd/ctrlc/root/sync/google/gke/gke.go b/cmd/ctrlc/root/sync/google/gke/gke.go index 1a1a2d4..93f26ec 100644 --- a/cmd/ctrlc/root/sync/google/gke/gke.go +++ b/cmd/ctrlc/root/sync/google/gke/gke.go @@ -389,7 +389,13 @@ var relationshipRules = []api.CreateResourceRelationshipRule{ TargetVersion: "ctrlplane.dev/network/v1", TargetKind: "GoogleNetwork", - MetadataKeysMatches: &[]string{"google/project", "network/id"}, + MetadataKeysMatches: &[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: "google/project", TargetKey: "google/project"}, + {SourceKey: "network/id", TargetKey: "network/id"}, + }, }, } diff --git a/cmd/ctrlc/root/sync/kubernetes/vcluster.go b/cmd/ctrlc/root/sync/kubernetes/vcluster.go index 67f36c4..cb9b7d6 100644 --- a/cmd/ctrlc/root/sync/kubernetes/vcluster.go +++ b/cmd/ctrlc/root/sync/kubernetes/vcluster.go @@ -163,7 +163,12 @@ func createResourceRelationshipRule(ctx context.Context, resourceProvider *api.R return fmt.Errorf("unsupported cluster kind: %s", clusterResource.Kind) } - metadataKeysMatches := []string{metadataKey} + metadataKeysMatches := []struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + }{ + {SourceKey: metadataKey, TargetKey: metadataKey}, + } resourceRelationshipRule := api.CreateResourceRelationshipRule{ DependencyType: api.ProvisionedIn, From a6e49f67c192a62e2ed271f7fe4185805eaf44f9 Mon Sep 17 00:00:00 2001 From: Aditya Choudhari Date: Fri, 11 Jul 2025 19:55:41 -0400 Subject: [PATCH 4/4] rabbit coment --- cmd/ctrlc/root/apply/relationships.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ctrlc/root/apply/relationships.go b/cmd/ctrlc/root/apply/relationships.go index 8be59be..f377e09 100644 --- a/cmd/ctrlc/root/apply/relationships.go +++ b/cmd/ctrlc/root/apply/relationships.go @@ -49,8 +49,8 @@ func createMetadataKeysMatch(match MetadataKeysMatch) (*struct { SourceKey string `json:"sourceKey"` TargetKey string `json:"targetKey"` }{ - SourceKey: *match.SourceKey, - TargetKey: *match.TargetKey, + SourceKey: *match.Key, + TargetKey: *match.Key, }, nil }