diff --git a/cmd/cloud/apps/bind_manifest.go b/cmd/cloud/apps/bind_manifest.go new file mode 100644 index 00000000..d415bdb8 --- /dev/null +++ b/cmd/cloud/apps/bind_manifest.go @@ -0,0 +1,80 @@ +package apps + +import ( + "fmt" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type BindManifest struct { + AppID string `json:"appId"` + ManifestID string `json:"manifestId"` +} + +type BindManifestCtrl struct { + store *BindManifest +} + +var _ fctl.Controller[*BindManifest] = (*BindManifestCtrl)(nil) + +func NewBindManifestCtrl() *BindManifestCtrl { + return &BindManifestCtrl{store: &BindManifest{}} +} + +func NewBindManifest() *cobra.Command { + return fctl.NewCommand("bind-manifest", + fctl.WithShortDescription("Bind a manifest to an app"), + fctl.WithStringFlag("app-id", "", "App ID"), + fctl.WithStringFlag("manifest-id", "", "Manifest ID to bind"), + fctl.WithController(NewBindManifestCtrl()), + ) +} + +func (c *BindManifestCtrl) GetStore() *BindManifest { return c.store } + +func (c *BindManifestCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + appID := fctl.GetString(cmd, "app-id") + if appID == "" { + return nil, fmt.Errorf("app-id is required") + } + manifestID := fctl.GetString(cmd, "manifest-id") + if manifestID == "" { + return nil, fmt.Errorf("manifest-id is required") + } + + if _, err := apiClient.AttachAppManifest(cmd.Context(), appID, components.AttachManifestRequest{ + ManifestID: manifestID, + }); err != nil { + return nil, err + } + + c.store.AppID = appID + c.store.ManifestID = manifestID + return c, nil +} + +func (c *BindManifestCtrl) Render(_ *cobra.Command, _ []string) error { + pterm.Success.Printfln("Manifest %s bound to app %s", c.store.ManifestID, c.store.AppID) + return nil +} diff --git a/cmd/cloud/apps/bind_manifest_test.go b/cmd/cloud/apps/bind_manifest_test.go new file mode 100644 index 00000000..740ca1e3 --- /dev/null +++ b/cmd/cloud/apps/bind_manifest_test.go @@ -0,0 +1,49 @@ +package apps + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func TestBindManifest_JSONOutput_LowercaseKeys(t *testing.T) { + store := &BindManifest{ + AppID: "app-abc", + ManifestID: "mnf-xyz", + } + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok) + require.Equal(t, "app-abc", data["appId"]) + require.Equal(t, "mnf-xyz", data["manifestId"]) + + for _, capitalized := range []string{"AppID", "ManifestID"} { + _, present := data[capitalized] + require.False(t, present, "must not surface Go-cased key %q", capitalized) + } +} + +func TestUnbindManifest_JSONOutput_LowercaseKeys(t *testing.T) { + store := &UnbindManifest{AppID: "app-abc"} + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok) + require.Equal(t, "app-abc", data["appId"]) + _, capitalized := data["AppID"] + require.False(t, capitalized) +} diff --git a/cmd/cloud/apps/create.go b/cmd/cloud/apps/create.go index d67f42fe..36ea7bf8 100644 --- a/cmd/cloud/apps/create.go +++ b/cmd/cloud/apps/create.go @@ -1,6 +1,8 @@ package apps import ( + "fmt" + "github.com/pterm/pterm" "github.com/spf13/cobra" @@ -34,6 +36,8 @@ func NewCreateCtrl() *CreateCtrl { func NewCreate() *cobra.Command { return fctl.NewCommand("create", fctl.WithShortDescription("Create an app"), + fctl.WithStringFlag("name", "", "App name"), + fctl.WithStringFlag("stack-id", "", "Optional existing stack ID to claim"), fctl.WithController(NewCreateCtrl()), ) } @@ -49,7 +53,7 @@ func (c *CreateCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error return nil, err } - organizationID, apiClient, err := fctl.NewAppDeployClientFromFlags( + _, apiClient, err := fctl.NewAppDeployClientFromFlags( cmd, relyingParty, fctl.NewPTermDialog(), @@ -59,9 +63,20 @@ func (c *CreateCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error if err != nil { return nil, err } - apps, err := apiClient.CreateApp(cmd.Context(), components.CreateAppRequest{ - OrganizationID: organizationID, - }) + + name := fctl.GetString(cmd, "name") + if name == "" { + return nil, fmt.Errorf("name is required") + } + + req := components.CreateAppRequest{ + Name: name, + } + if stackID := fctl.GetString(cmd, "stack-id"); stackID != "" { + req.StackID = &stackID + } + + apps, err := apiClient.CreateApp(cmd.Context(), req) if err != nil { return nil, err } diff --git a/cmd/cloud/apps/delete.go b/cmd/cloud/apps/delete.go index a622b71a..209f8fb8 100644 --- a/cmd/cloud/apps/delete.go +++ b/cmd/cloud/apps/delete.go @@ -10,7 +10,9 @@ import ( ) type Delete struct { - ID string + ID string `json:"id"` + DestroyDeploymentID *string `json:"destroyDeploymentId,omitempty"` + Waited bool `json:"waited"` } type DeleteCtrl struct { @@ -31,8 +33,9 @@ func NewDeleteCtrl() *DeleteCtrl { func NewDelete() *cobra.Command { return fctl.NewCommand("delete", - fctl.WithShortDescription("Delete an app"), + fctl.WithShortDescription("Soft-delete an app and enqueue a destroy deployment"), fctl.WithStringFlag("id", "", "App ID"), + fctl.WithBoolFlag("wait", false, "Block until the destroy deployment reaches a terminal status"), fctl.WithController(NewDeleteCtrl()), ) } @@ -61,17 +64,34 @@ func (c *DeleteCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, er if id == "" { return nil, fmt.Errorf("id is required") } - _, err = apiClient.DeleteApp(cmd.Context(), id) + + wait := fctl.GetBool(cmd, "wait") + resp, err := apiClient.DeleteApp(cmd.Context(), id, &wait) if err != nil { return nil, err } c.store.ID = id + c.store.Waited = wait + if resp.DeleteAppResponse != nil { + c.store.DestroyDeploymentID = resp.DeleteAppResponse.DestroyDeploymentID + } return c, nil } func (c *DeleteCtrl) Render(cmd *cobra.Command, args []string) error { - pterm.Success.Println("App deleted", c.store.ID) + switch { + case c.store.DestroyDeploymentID != nil && *c.store.DestroyDeploymentID != "": + if c.store.Waited { + pterm.Success.Printfln("App %s deleted (destroy deployment %s reached terminal status)", + c.store.ID, *c.store.DestroyDeploymentID) + } else { + pterm.Success.Printfln("App %s soft-deleted; destroy deployment %s enqueued (poll with `fctl cloud app deployments show --id %s`)", + c.store.ID, *c.store.DestroyDeploymentID, *c.store.DestroyDeploymentID) + } + default: + pterm.Success.Printfln("App %s deleted (no destroy deployment was needed)", c.store.ID) + } return nil } diff --git a/cmd/cloud/apps/deploy.go b/cmd/cloud/apps/deploy.go deleted file mode 100644 index f2e6aa7a..00000000 --- a/cmd/cloud/apps/deploy.go +++ /dev/null @@ -1,239 +0,0 @@ -package apps - -import ( - "fmt" - "io" - "os" - "path/filepath" - "time" - - "github.com/pterm/pterm" - "github.com/spf13/cobra" - - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" - - "github.com/formancehq/fctl/v3/cmd/cloud/apps/printer" - fctl "github.com/formancehq/fctl/v3/pkg" -) - -type Deploy struct { - *components.Run - logs []components.Log -} - -type DeployCtrl struct { - store *Deploy -} - -var _ fctl.Controller[*Deploy] = (*DeployCtrl)(nil) - -func newDeployStore() *Deploy { - return &Deploy{} -} - -func NewDeployCtrl() *DeployCtrl { - return &DeployCtrl{ - store: newDeployStore(), - } -} - -func NewDeploy() *cobra.Command { - return fctl.NewCommand("deploy", - fctl.WithShortDescription("Deploy an app"), - fctl.WithStringFlag("id", "", "App ID"), - fctl.WithStringFlag("path", "", "Path to the manifest file"), - fctl.WithBoolFlag("wait", true, "Wait for the deployment to complete"), - fctl.WithController(NewDeployCtrl()), - ) -} - -func (c *DeployCtrl) GetStore() *Deploy { - return c.store -} - -func (c *DeployCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { - _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) - if err != nil { - return nil, err - } - - _, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return nil, err - } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") - } - path := fctl.GetString(cmd, "path") - if path == "" { - return nil, fmt.Errorf("path is required") - } - data, err := os.ReadFile(filepath.Clean(path)) - if err != nil { - return nil, err - } - - cmd.SilenceUsage = true - deployment, err := apiClient.DeployAppConfigurationRaw(cmd.Context(), id, data) - if err != nil { - return nil, err - } - c.store.Run = &deployment.RunResponse.Data - - if fctl.GetBool(cmd, "wait") { - if err := c.waitRunCompletion(cmd); err != nil { - return nil, err - } - } - - return c, nil -} - -func (c *DeployCtrl) waitRunCompletion(cmd *cobra.Command) error { - - _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) - if err != nil { - return err - } - - _, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return err - } - spinner := &pterm.DefaultSpinner - - if s := fctl.GetString(cmd, "output"); s == "plain" { - var err error - spinner, err = spinner.Start("Waiting for deployment to complete...") - if err != nil { - return err - } - defer func() { - if err := spinner.Stop(); err != nil { - pterm.Error.Println(err) - } - }() - } else { - spinner.SetWriter(io.Discard) - } - defer func() { - _ = spinner.Stop() - }() - - waitFor := 0 * time.Second - for { - select { - case <-cmd.Context().Done(): - return cmd.Context().Err() - case <-time.After(waitFor): - waitFor = 2 * time.Second - r, err := apiClient.ReadRun(cmd.Context(), c.store.ID) - if err != nil { - return err - } - c.store.Run = &r.RunResponse.Data - - spinner.UpdateText(fmt.Sprintf("Deployment status: %s", r.RunResponse.Data.Status)) - switch r.RunResponse.Data.Status { - case "applied": - spinner.UpdateText("Deployment completed successfully") - return nil - case "planned_and_finished": - spinner.UpdateText("Deployment completed successfully, no changes to apply") - return nil - case "errored": - l, err := apiClient.ReadRunLogs(cmd.Context(), c.store.ID) - if err != nil { - return err - } - - c.store.logs = l.ReadLogsResponse.Data - - return nil - default: - continue - } - } - } -} - -func (c *DeployCtrl) Render(cmd *cobra.Command, args []string) error { - if c.store.Run.Status == "errored" { - if len(c.store.logs) > 0 { - if err := printer.RenderLogs(cmd.ErrOrStderr(), c.store.logs); err != nil { - return err - } - } - return fmt.Errorf("deployment failed: %s", c.store.ID) - } - - pterm.Info.Printfln("App deployment accepted with ID: %s", c.store.ID) - wait := fctl.GetBool(cmd, "wait") - if !wait { - return nil - } - if err := c.waitRunCompletion(cmd); err != nil { - return err - } - - cfg, err := fctl.LoadConfig(cmd) - if err != nil { - return err - } - - profile, profileName, err := fctl.LoadCurrentProfile(cmd, *cfg) - if err != nil { - return err - } - - relyingParty, err := fctl.GetAuthRelyingParty(cmd.Context(), fctl.GetHttpClient(cmd), profile.MembershipURI) - if err != nil { - return err - } - - organizationID, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return err - } - id := fctl.GetString(cmd, "id") - currentStateRes, err := apiClient.ReadAppCurrentStateVersion(cmd.Context(), id) - if err != nil { - return err - } - if state := currentStateRes.GetReadStateResponse().Data.Stack; state != nil { - - apiClient, err := fctl.NewMembershipClientForOrganization(cmd, relyingParty, fctl.NewPTermDialog(), profileName, *profile, organizationID) - if err != nil { - return err - } - - info, err := apiClient.GetServerInfo(cmd.Context()) - if err != nil { - return err - } - - if info.ServerInfo.ConsoleURL != nil { - pterm.Success.Printfln("View stack in console: %s/%s/%s?region=%s", *info.ServerInfo.ConsoleURL, organizationID, state["id"], state["region_id"]) - } - } - return nil -} diff --git a/cmd/cloud/apps/deployments/create.go b/cmd/cloud/apps/deployments/create.go new file mode 100644 index 00000000..635671b9 --- /dev/null +++ b/cmd/cloud/apps/deployments/create.go @@ -0,0 +1,281 @@ +package deployments + +import ( + "context" + "fmt" + "io" + "time" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" + + "github.com/formancehq/fctl/v3/cmd/cloud/apps/printer" + fctl "github.com/formancehq/fctl/v3/pkg" +) + +// Deployment status values polled by the wait loop. Mirrors the strings the +// deploy server emits — keep this list in sync with the server's status enum +// (terraform-hcp-proxy `internal/storage/models/deployment.go`). The server +// does not yet expose these as a typed enum in the OpenAPI spec; lift this +// block once it does so a rename produces a compile error instead of a +// silent polling deadlock. +const ( + statusApplied = "applied" + statusPlannedAndFinished = "planned_and_finished" + statusErrored = "errored" +) + +type Create struct { + *components.DeploymentResource + logs []components.Log +} + +type CreateCtrl struct { + store *Create +} + +var _ fctl.Controller[*Create] = (*CreateCtrl)(nil) + +func newCreateStore() *Create { + return &Create{} +} + +func NewCreateCtrl() *CreateCtrl { + return &CreateCtrl{ + store: newCreateStore(), + } +} + +func NewCreate() *cobra.Command { + return fctl.NewCommand("create", + fctl.WithShortDescription("Create a deployment (deploy an app)"), + fctl.WithStringFlag("app-id", "", "App ID"), + fctl.WithStringFlag("manifest-id", "", "Manifest ID to deploy"), + fctl.WithIntFlag("manifest-version", 0, "Manifest version to deploy (required, >= 1)"), + fctl.WithBoolFlag("wait", true, "Wait for the deployment to complete"), + fctl.WithStringFlag("wait-timeout", "30m", "Max duration to wait for the deployment when --wait is set"), + fctl.WithController(NewCreateCtrl()), + ) +} + +func (c *CreateCtrl) GetStore() *Create { + return c.store +} + +func (c *CreateCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + appID := fctl.GetString(cmd, "app-id") + if appID == "" { + return nil, fmt.Errorf("app-id is required") + } + manifestID := fctl.GetString(cmd, "manifest-id") + if manifestID == "" { + return nil, fmt.Errorf("manifest-id is required") + } + manifestVersion := fctl.GetInt(cmd, "manifest-version") + if manifestVersion <= 0 { + return nil, fmt.Errorf("manifest-version is required (>= 1)") + } + + req := components.CreateDeploymentRequest{ + AppID: appID, + ManifestID: manifestID, + ManifestVersion: int64(manifestVersion), + } + + cmd.SilenceUsage = true + deployment, err := apiClient.CreateDeployment(cmd.Context(), req) + if err != nil { + return nil, err + } + c.store.DeploymentResource = &deployment.DeploymentResponse.Data + + if fctl.GetBool(cmd, "wait") { + if err := c.waitDeploymentCompletion(cmd); err != nil { + return nil, err + } + } + + return c, nil +} + +func (c *CreateCtrl) waitDeploymentCompletion(cmd *cobra.Command) error { + + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return err + } + spinner := &pterm.DefaultSpinner + + if s := fctl.GetString(cmd, "output"); s == "plain" { + var err error + spinner, err = spinner.Start("Waiting for deployment to complete...") + if err != nil { + return err + } + defer func() { + if err := spinner.Stop(); err != nil { + pterm.Error.Println(err) + } + }() + } else { + spinner.SetWriter(io.Discard) + } + defer func() { + _ = spinner.Stop() + }() + + timeout := 30 * time.Minute + if v := fctl.GetString(cmd, "wait-timeout"); v != "" { + parsed, err := time.ParseDuration(v) + if err != nil { + return fmt.Errorf("invalid --wait-timeout: %w", err) + } + timeout = parsed + } + ctx, cancel := context.WithTimeout(cmd.Context(), timeout) + defer cancel() + + waitFor := 0 * time.Second + for { + select { + case <-ctx.Done(): + if ctx.Err() == context.DeadlineExceeded { + return fmt.Errorf("timed out after %s waiting for deployment %s (last status: %s)", + timeout, c.store.ID, c.store.DeploymentResource.Status) + } + return ctx.Err() + case <-time.After(waitFor): + // Backoff: 2s, 4s, 8s capped at 15s. A long-running terraform + // apply doesn't need sub-second polling. + if waitFor == 0 { + waitFor = 2 * time.Second + } else if waitFor < 15*time.Second { + waitFor *= 2 + if waitFor > 15*time.Second { + waitFor = 15 * time.Second + } + } + r, err := apiClient.ReadDeployment(ctx, c.store.ID, nil) + if err != nil { + return err + } + c.store.DeploymentResource = &r.DeploymentResponse.Data + + spinner.UpdateText(fmt.Sprintf("Deployment status: %s", r.DeploymentResponse.Data.Status)) + switch r.DeploymentResponse.Data.Status { + case statusApplied: + spinner.UpdateText("Deployment completed successfully") + return nil + case statusPlannedAndFinished: + spinner.UpdateText("Deployment completed successfully, no changes to apply") + return nil + case statusErrored: + l, err := apiClient.ReadDeploymentLogs(ctx, c.store.ID) + if err != nil { + return err + } + + c.store.logs = l.ReadLogsResponse.Data + + return nil + default: + continue + } + } + } +} + +func (c *CreateCtrl) Render(cmd *cobra.Command, args []string) error { + if c.store.DeploymentResource.Status == statusErrored { + if len(c.store.logs) > 0 { + if err := printer.RenderLogs(cmd.ErrOrStderr(), c.store.logs); err != nil { + return err + } + } + return fmt.Errorf("deployment failed: %s", c.store.ID) + } + + pterm.Info.Println("App Deployment accepted", c.store.ID) + wait := fctl.GetBool(cmd, "wait") + if !wait { + return nil + } + + cfg, err := fctl.LoadConfig(cmd) + if err != nil { + return err + } + + profile, profileName, err := fctl.LoadCurrentProfile(cmd, *cfg) + if err != nil { + return err + } + + relyingParty, err := fctl.GetAuthRelyingParty(cmd.Context(), fctl.GetHttpClient(cmd), profile.MembershipURI) + if err != nil { + return err + } + + organizationID, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return err + } + + appID := fctl.GetString(cmd, "app-id") + appResp, err := apiClient.ReadApp(cmd.Context(), appID, []operations.ReadAppInclude{operations.ReadAppIncludeState}) + if err != nil { + return err + } + + if state := appResp.AppResponse.Data.State; state != nil && state.Stack != nil { + membershipClient, err := fctl.NewMembershipClientForOrganization(cmd, relyingParty, fctl.NewPTermDialog(), profileName, *profile, organizationID) + if err != nil { + return err + } + + info, err := membershipClient.GetServerInfo(cmd.Context()) + if err != nil { + return err + } + + if info.ServerInfo.ConsoleURL != nil { + pterm.Success.Printfln("View stack in console: %s/%s/%s?region=%s", *info.ServerInfo.ConsoleURL, organizationID, state.Stack["id"], state.Stack["region_id"]) + } + } + return nil +} diff --git a/cmd/cloud/apps/deployments/create_test.go b/cmd/cloud/apps/deployments/create_test.go new file mode 100644 index 00000000..129869b4 --- /dev/null +++ b/cmd/cloud/apps/deployments/create_test.go @@ -0,0 +1,38 @@ +package deployments + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// TestNewCreate_RequiredFlags asserts the cobra command exposes the flags +// required by the new {appId, manifestId, manifestVersion} payload shape. +// Until d063441 landed on the server, the deploy endpoint accepted inline +// YAML and an optional manifest version. The new shape requires a +// manifest version >= 1 — the validation happens at Run() time, but the +// flag must at least exist on the command tree. +func TestNewCreate_RequiredFlags(t *testing.T) { + cmd := NewCreate() + for _, name := range []string{"app-id", "manifest-id", "manifest-version", "wait", "wait-timeout"} { + require.NotNil(t, cmd.Flags().Lookup(name), "flag %q must be defined", name) + } +} + +func TestNewCreate_WaitTimeoutDefault(t *testing.T) { + cmd := NewCreate() + f := cmd.Flags().Lookup("wait-timeout") + require.NotNil(t, f) + require.Equal(t, "30m", f.DefValue, + "a sensible default keeps the previous unbounded-poll behaviour from coming back") +} + +// Status constants must stay in sync with the server's deployment status +// enum (terraform-hcp-proxy `internal/storage/models/deployment.go`). +// Renaming any of these on the server without lifting the constants here +// would silently break the wait loop — these assertions are the canary. +func TestStatusConstants(t *testing.T) { + require.Equal(t, "applied", statusApplied) + require.Equal(t, "planned_and_finished", statusPlannedAndFinished) + require.Equal(t, "errored", statusErrored) +} diff --git a/cmd/cloud/apps/deployments/download.go b/cmd/cloud/apps/deployments/download.go new file mode 100644 index 00000000..56f37884 --- /dev/null +++ b/cmd/cloud/apps/deployments/download.go @@ -0,0 +1,82 @@ +package deployments + +import ( + "fmt" + "io" + "os" + + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func NewDownload() *cobra.Command { + return fctl.NewCommand("download", + fctl.WithShortDescription("Download a deployment's resolved manifest as YAML"), + fctl.WithStringFlag("id", "", "Deployment ID"), + fctl.WithStringFlag("out", "", "Output file path (defaults to stdout)"), + fctl.WithRunE(runDeploymentDownload), + ) +} + +func runDeploymentDownload(cmd *cobra.Command, _ []string) error { + id := fctl.GetString(cmd, "id") + if id == "" { + return fmt.Errorf("id is required") + } + + out := fctl.GetString(cmd, "out") + + cmd.SilenceUsage = true + + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return err + } + + resp, err := apiClient.ReadDeployment( + cmd.Context(), + id, + nil, + operations.WithAcceptHeaderOverride(operations.AcceptHeaderEnumApplicationYaml), + ) + if err != nil { + return err + } + + if resp.ResponseStream == nil { + return fmt.Errorf("server returned no YAML payload for deployment %s", id) + } + defer resp.ResponseStream.Close() + + if out == "" { + if _, err := io.Copy(cmd.OutOrStdout(), resp.ResponseStream); err != nil { + return fmt.Errorf("write deployment payload: %w", err) + } + return nil + } + + f, err := os.Create(out) // #nosec G304 -- user-specified output path on a CLI flag + if err != nil { + return fmt.Errorf("create output file: %w", err) + } + defer func() { _ = f.Close() }() + + if _, err := io.Copy(f, resp.ResponseStream); err != nil { + return fmt.Errorf("write deployment payload: %w", err) + } + return f.Close() +} diff --git a/cmd/cloud/apps/deployments/list.go b/cmd/cloud/apps/deployments/list.go new file mode 100644 index 00000000..ebee4e45 --- /dev/null +++ b/cmd/cloud/apps/deployments/list.go @@ -0,0 +1,123 @@ +package deployments + +import ( + "fmt" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "github.com/formancehq/go-libs/v4/pointer" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type List struct { + components.ListDeploymentsResponseCursor +} + +type ListCtrl struct { + store *List +} + +var _ fctl.Controller[*List] = (*ListCtrl)(nil) + +func newDefaultStore() *List { + return &List{ + ListDeploymentsResponseCursor: components.ListDeploymentsResponseCursor{}, + } +} + +func NewListCtrl() *ListCtrl { + return &ListCtrl{ + store: newDefaultStore(), + } +} + +func NewList() *cobra.Command { + return fctl.NewCommand("list", + fctl.WithAliases("ls"), + fctl.WithShortDescription("List deployments"), + fctl.WithStringFlag("app-id", "", "Filter by app ID"), + fctl.WithIntFlag("page-size", 100, "Page size"), + fctl.WithStringFlag("cursor", "", "Opaque cursor token for the next page"), + fctl.WithController(NewListCtrl()), + ) +} + +func (c *ListCtrl) GetStore() *List { + return c.store +} + +func (c *ListCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + var appID *string + if id := fctl.GetString(cmd, "app-id"); id != "" { + appID = &id + } + + var cursor *string + if v := fctl.GetString(cmd, "cursor"); v != "" { + cursor = &v + } + + deployments, err := apiClient.ListDeployments( + cmd.Context(), + appID, + pointer.For(int64(fctl.GetInt(cmd, "page-size"))), + cursor, + ) + if err != nil { + return nil, err + } + + c.store.ListDeploymentsResponseCursor = deployments.ListDeploymentsResponse.Cursor + + return c, nil +} + +func (c *ListCtrl) Render(cmd *cobra.Command, _ []string) error { + data := [][]string{ + {"ID", "App ID", "Status", "Manifest ID", "Created At"}, + } + + for _, d := range c.store.Data { + data = append(data, []string{ + d.ID, + d.AppID, + d.Status, + func() string { + if d.ManifestID != nil { + return *d.ManifestID + } + return "inline" + }(), + fmt.Sprint(d.CreatedAt), + }) + } + + if err := pterm. + DefaultTable. + WithHasHeader(). + WithWriter(cmd.OutOrStdout()). + WithData(data). + Render(); err != nil { + return err + } + return nil +} diff --git a/cmd/cloud/apps/runs/logs.go b/cmd/cloud/apps/deployments/logs.go similarity index 73% rename from cmd/cloud/apps/runs/logs.go rename to cmd/cloud/apps/deployments/logs.go index 190739c5..eb15d2dd 100644 --- a/cmd/cloud/apps/runs/logs.go +++ b/cmd/cloud/apps/deployments/logs.go @@ -1,4 +1,4 @@ -package runs +package deployments import ( "fmt" @@ -30,9 +30,8 @@ func NewLogsCtrl() *LogsCtrl { func NewLogs() *cobra.Command { return fctl.NewCommand("logs", - fctl.WithAliases("ls"), - fctl.WithShortDescription("Read logs related to an app run"), - fctl.WithStringFlag("id", "", "Run ID"), + fctl.WithShortDescription("Read logs for a deployment"), + fctl.WithStringFlag("id", "", "Deployment ID"), fctl.WithController(NewLogsCtrl()), ) } @@ -41,8 +40,7 @@ func (c *LogsCtrl) GetStore() Logs { return c.store } -func (c *LogsCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { - +func (c *LogsCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) if err != nil { return nil, err @@ -58,21 +56,22 @@ func (c *LogsCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, erro if err != nil { return nil, err } + id := fctl.GetString(cmd, "id") if id == "" { return nil, fmt.Errorf("id is required") } - logs, err := apiClient.ReadRunLogs(cmd.Context(), id) + + logs, err := apiClient.ReadDeploymentLogs(cmd.Context(), id) if err != nil { return nil, err } - s := Logs(logs.ReadLogsResponse.Data) - c.store = s + c.store = Logs(logs.ReadLogsResponse.Data) return c, nil } -func (c *LogsCtrl) Render(cmd *cobra.Command, args []string) error { +func (c *LogsCtrl) Render(cmd *cobra.Command, _ []string) error { return printer.RenderLogs(cmd.OutOrStdout(), c.store) } diff --git a/cmd/cloud/apps/runs/root.go b/cmd/cloud/apps/deployments/root.go similarity index 51% rename from cmd/cloud/apps/runs/root.go rename to cmd/cloud/apps/deployments/root.go index c85536a0..26b1a37a 100644 --- a/cmd/cloud/apps/runs/root.go +++ b/cmd/cloud/apps/deployments/root.go @@ -1,4 +1,4 @@ -package runs +package deployments import ( "github.com/spf13/cobra" @@ -7,13 +7,15 @@ import ( ) func NewCommand() *cobra.Command { - return fctl.NewCommand("runs", - fctl.WithShortDescription("Manage app runs"), + return fctl.NewCommand("deployments", + fctl.WithShortDescription("Manage deployments"), + fctl.WithAliases("deploy", "dep"), fctl.WithChildCommands( + NewCreate(), NewList(), NewShow(), NewLogs(), - // NewWait(), + NewDownload(), ), ) } diff --git a/cmd/cloud/apps/deployments/show.go b/cmd/cloud/apps/deployments/show.go new file mode 100644 index 00000000..57f028d3 --- /dev/null +++ b/cmd/cloud/apps/deployments/show.go @@ -0,0 +1,139 @@ +package deployments + +import ( + "fmt" + "sort" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Show struct { + components.DeploymentResource +} + +type ShowCtrl struct { + store *Show +} + +var _ fctl.Controller[*Show] = (*ShowCtrl)(nil) + +func newShowStore() *Show { + return &Show{} +} + +func NewShowCtrl() *ShowCtrl { + return &ShowCtrl{ + store: newShowStore(), + } +} + +func NewShow() *cobra.Command { + return fctl.NewCommand("show", + fctl.WithShortDescription("Show deployment details"), + fctl.WithStringFlag("id", "", "Deployment ID"), + fctl.WithBoolFlag("include-state", false, "Include Terraform state"), + fctl.WithController(NewShowCtrl()), + ) +} + +func (c *ShowCtrl) GetStore() *Show { + return c.store +} + +func (c *ShowCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + id := fctl.GetString(cmd, "id") + if id == "" { + return nil, fmt.Errorf("id is required") + } + + var includes []operations.ReadDeploymentInclude + if fctl.GetBool(cmd, "include-state") { + includes = append(includes, operations.ReadDeploymentIncludeState) + } + + deployment, err := apiClient.ReadDeployment(cmd.Context(), id, includes) + if err != nil { + return nil, err + } + + c.store.DeploymentResource = deployment.DeploymentResponse.Data + + return c, nil +} + +func (c *ShowCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.DefaultSection.Println("Deployment") + + items := []pterm.BulletListItem{ + {Level: 0, Text: fmt.Sprintf("ID: %s", c.store.ID)}, + {Level: 0, Text: fmt.Sprintf("App ID: %s", c.store.AppID)}, + {Level: 0, Text: fmt.Sprintf("Status: %s", c.store.Status)}, + {Level: 0, Text: fmt.Sprintf("Created At: %s", c.store.CreatedAt)}, + {Level: 0, Text: fmt.Sprintf("Updated At: %s", c.store.UpdatedAt)}, + } + + if c.store.ManifestID != nil { + items = append(items, pterm.BulletListItem{Level: 0, Text: fmt.Sprintf("Manifest ID: %s", *c.store.ManifestID)}) + } + if c.store.ManifestVersion != nil { + items = append(items, pterm.BulletListItem{Level: 0, Text: fmt.Sprintf("Manifest Version: %d", *c.store.ManifestVersion)}) + } + + if c.store.State != nil && len(c.store.State.Stack) > 0 { + items = append(items, pterm.BulletListItem{Level: 0, Text: "State"}) + items = append(items, renderStackItems(c.store.State.Stack)...) + } + + if err := pterm. + DefaultBulletList. + WithItems(items). + WithWriter(cmd.OutOrStdout()). + Render(); err != nil { + return err + } + + return nil +} + +func renderStackItems(stack map[string]any) []pterm.BulletListItem { + keys := make([]string, 0, len(stack)) + for k := range stack { + keys = append(keys, k) + } + sort.Strings(keys) + + items := make([]pterm.BulletListItem, 0, len(stack)) + for _, k := range keys { + v := stack[k] + if v == nil { + continue + } + items = append(items, pterm.BulletListItem{ + Level: 1, + Text: fmt.Sprintf("%s: %v", k, v), + }) + } + return items +} diff --git a/cmd/cloud/apps/list.go b/cmd/cloud/apps/list.go index a4c89045..b15e38e7 100644 --- a/cmd/cloud/apps/list.go +++ b/cmd/cloud/apps/list.go @@ -11,7 +11,7 @@ import ( ) type List struct { - components.ListAppsResponseData + components.ListAppsResponseCursor } type ListCtrl struct { @@ -22,7 +22,7 @@ var _ fctl.Controller[*List] = (*ListCtrl)(nil) func newDefaultStore() *List { return &List{ - ListAppsResponseData: components.ListAppsResponseData{}, + ListAppsResponseCursor: components.ListAppsResponseCursor{}, } } @@ -35,8 +35,8 @@ func NewListCtrl() *ListCtrl { func NewList() *cobra.Command { return fctl.NewCommand("list", fctl.WithAliases("ls"), - fctl.WithIntFlag("page", 1, "Page number"), fctl.WithIntFlag("page-size", 100, "Page size"), + fctl.WithStringFlag("cursor", "", "Opaque cursor token for the next page"), fctl.WithShortDescription("List apps"), fctl.WithController(NewListCtrl()), ) @@ -53,10 +53,7 @@ func (c *ListCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) return nil, err } - pageSize := fctl.GetInt(cmd, "page-size") - page := fctl.GetInt(cmd, "page") - - organizationID, apiClient, err := fctl.NewAppDeployClientFromFlags( + _, apiClient, err := fctl.NewAppDeployClientFromFlags( cmd, relyingParty, fctl.NewPTermDialog(), @@ -66,41 +63,40 @@ func (c *ListCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) if err != nil { return nil, err } + + var cursor *string + if v := fctl.GetString(cmd, "cursor"); v != "" { + cursor = &v + } + apps, err := apiClient.ListApps( cmd.Context(), - organizationID, - pointer.For(int64(page)), - pointer.For(int64(pageSize)), + pointer.For(int64(fctl.GetInt(cmd, "page-size"))), + cursor, ) if err != nil { return nil, err } - c.store.ListAppsResponseData = apps.ListAppsResponse.Data + c.store.ListAppsResponseCursor = apps.ListAppsResponse.Cursor return c, nil } func (c *ListCtrl) Render(cmd *cobra.Command, _ []string) error { data := [][]string{ - {"Name", "ID", "Run Status", "Has Configuration Version"}, + {"Name", "ID", "Stack ID"}, } - for _, w := range c.store.Items { + for _, w := range c.store.Data { data = append(data, []string{ w.Name, w.ID, func() string { - if w.CurrentRun == nil { - return "N/A" - } - return w.CurrentRun.Status - }(), - func() string { - if w.CurrentConfigurationVersion != nil { - return "Yes" + if w.StackID != nil { + return *w.StackID } - return "No" + return "N/A" }(), }) } diff --git a/cmd/cloud/apps/manifests/create.go b/cmd/cloud/apps/manifests/create.go new file mode 100644 index 00000000..a5ccab16 --- /dev/null +++ b/cmd/cloud/apps/manifests/create.go @@ -0,0 +1,96 @@ +package manifests + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Create struct { + ID string `json:"id"` + Name string `json:"name"` + Version int64 `json:"version"` +} + +type CreateCtrl struct { + store *Create +} + +var _ fctl.Controller[*Create] = (*CreateCtrl)(nil) + +func newCreateStore() *Create { + return &Create{} +} + +func NewCreateCtrl() *CreateCtrl { + return &CreateCtrl{ + store: newCreateStore(), + } +} + +func NewCreate() *cobra.Command { + return fctl.NewCommand("create", + fctl.WithShortDescription("Create a new manifest"), + fctl.WithStringFlag("name", "", "Manifest name"), + fctl.WithStringFlag("path", "", "Path to YAML manifest file"), + fctl.WithController(NewCreateCtrl()), + ) +} + +func (c *CreateCtrl) GetStore() *Create { + return c.store +} + +func (c *CreateCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + name := fctl.GetString(cmd, "name") + if name == "" { + return nil, fmt.Errorf("name is required") + } + + path := fctl.GetString(cmd, "path") + if path == "" { + return nil, fmt.Errorf("path is required") + } + + data, err := os.ReadFile(filepath.Clean(path)) + if err != nil { + return nil, err + } + + resp, err := apiClient.CreateManifestRaw(cmd.Context(), name, data) + if err != nil { + return nil, err + } + + c.store.ID = resp.CreateManifestResponse.Data.ID + c.store.Name = resp.CreateManifestResponse.Data.Name + c.store.Version = resp.CreateManifestResponse.Data.Version + + return c, nil +} + +func (c *CreateCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.Success.Printfln("Manifest created: %s (version %d)", c.store.ID, c.store.Version) + return nil +} diff --git a/cmd/cloud/apps/manifests/create_test.go b/cmd/cloud/apps/manifests/create_test.go new file mode 100644 index 00000000..0bfa61fb --- /dev/null +++ b/cmd/cloud/apps/manifests/create_test.go @@ -0,0 +1,43 @@ +package manifests + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +// TestCreate_JSONOutput_LowercaseKeys verifies the Create store serializes +// to JSON with lowercase, idiomatic keys (`id`, `name`, `version`) under +// `data`. Without explicit json tags Go marshals exported fields as-is +// (Go-cased), which would produce `{"data":{"ID":..., "Name":..., "Version":...}}` +// and break any consumer (script, dashboard) reading `.data.id`. The +// provision-example-apps.sh script tripped on this exact bug. +func TestCreate_JSONOutput_LowercaseKeys(t *testing.T) { + store := &Create{ + ID: "mnf-abc123", + Name: "my-manifest", + Version: 1, + } + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok, "data should be an object") + + require.Equal(t, "mnf-abc123", data["id"], "expected lowercase 'id' key") + require.Equal(t, "my-manifest", data["name"], "expected lowercase 'name' key") + require.EqualValues(t, 1, data["version"], "expected lowercase 'version' key") + + // Negative: capital aliases must NOT exist (would indicate missing tags). + for _, capitalized := range []string{"ID", "Name", "Version"} { + _, ok := data[capitalized] + require.False(t, ok, "JSON output should not contain Go-cased key %q", capitalized) + } +} diff --git a/cmd/cloud/apps/manifests/delete.go b/cmd/cloud/apps/manifests/delete.go new file mode 100644 index 00000000..dda23735 --- /dev/null +++ b/cmd/cloud/apps/manifests/delete.go @@ -0,0 +1,79 @@ +package manifests + +import ( + "fmt" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Delete struct { + ID string `json:"id"` +} + +type DeleteCtrl struct { + store *Delete +} + +var _ fctl.Controller[*Delete] = (*DeleteCtrl)(nil) + +func newDeleteStore() *Delete { + return &Delete{} +} + +func NewDeleteCtrl() *DeleteCtrl { + return &DeleteCtrl{ + store: newDeleteStore(), + } +} + +func NewDelete() *cobra.Command { + return fctl.NewCommand("delete", + fctl.WithShortDescription("Delete a manifest"), + fctl.WithStringFlag("id", "", "Manifest ID"), + fctl.WithController(NewDeleteCtrl()), + ) +} + +func (c *DeleteCtrl) GetStore() *Delete { + return c.store +} + +func (c *DeleteCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + id := fctl.GetString(cmd, "id") + if id == "" { + return nil, fmt.Errorf("id is required") + } + + _, err = apiClient.DeleteManifest(cmd.Context(), id) + if err != nil { + return nil, err + } + + c.store.ID = id + + return c, nil +} + +func (c *DeleteCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.Success.Println("Manifest deleted", c.store.ID) + return nil +} diff --git a/cmd/cloud/apps/manifests/delete_test.go b/cmd/cloud/apps/manifests/delete_test.go new file mode 100644 index 00000000..a1e2c865 --- /dev/null +++ b/cmd/cloud/apps/manifests/delete_test.go @@ -0,0 +1,26 @@ +package manifests + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func TestDelete_JSONOutput_LowercaseKeys(t *testing.T) { + store := &Delete{ID: "mnf-abc123"} + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok) + require.Equal(t, "mnf-abc123", data["id"]) + _, capitalized := data["ID"] + require.False(t, capitalized) +} diff --git a/cmd/cloud/apps/manifests/download.go b/cmd/cloud/apps/manifests/download.go new file mode 100644 index 00000000..572c8d63 --- /dev/null +++ b/cmd/cloud/apps/manifests/download.go @@ -0,0 +1,88 @@ +package manifests + +import ( + "fmt" + "io" + "os" + + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func NewDownload() *cobra.Command { + return fctl.NewCommand("download", + fctl.WithShortDescription("Download a manifest version's raw YAML content"), + fctl.WithStringFlag("id", "", "Manifest ID"), + fctl.WithStringFlag("version", "latest", "Version number or \"latest\""), + fctl.WithStringFlag("out", "", "Output file path (defaults to stdout)"), + fctl.WithRunE(runManifestDownload), + ) +} + +func runManifestDownload(cmd *cobra.Command, _ []string) error { + id := fctl.GetString(cmd, "id") + if id == "" { + return fmt.Errorf("id is required") + } + + version := fctl.GetString(cmd, "version") + if version == "" { + return fmt.Errorf("version is required") + } + + out := fctl.GetString(cmd, "out") + + cmd.SilenceUsage = true + + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return err + } + + resp, err := apiClient.ReadManifestVersion( + cmd.Context(), + id, + version, + operations.WithAcceptHeaderOverride(operations.AcceptHeaderEnumApplicationXYaml), + ) + if err != nil { + return err + } + + if resp.ResponseStream == nil { + return fmt.Errorf("server returned no YAML payload for manifest %s version %s", id, version) + } + defer resp.ResponseStream.Close() + + if out == "" { + if _, err := io.Copy(cmd.OutOrStdout(), resp.ResponseStream); err != nil { + return fmt.Errorf("write manifest payload: %w", err) + } + return nil + } + + f, err := os.Create(out) // #nosec G304 -- user-specified output path on a CLI flag + if err != nil { + return fmt.Errorf("create output file: %w", err) + } + defer func() { _ = f.Close() }() + + if _, err := io.Copy(f, resp.ResponseStream); err != nil { + return fmt.Errorf("write manifest payload: %w", err) + } + return f.Close() +} diff --git a/cmd/cloud/apps/runs/list.go b/cmd/cloud/apps/manifests/list.go similarity index 59% rename from cmd/cloud/apps/runs/list.go rename to cmd/cloud/apps/manifests/list.go index 7d67191f..2aa0b7cd 100644 --- a/cmd/cloud/apps/runs/list.go +++ b/cmd/cloud/apps/manifests/list.go @@ -1,7 +1,8 @@ -package runs +package manifests import ( "fmt" + "strconv" "github.com/pterm/pterm" "github.com/spf13/cobra" @@ -13,7 +14,7 @@ import ( ) type List struct { - components.ListRunsResponseData + components.ListManifestsResponseCursor } type ListCtrl struct { @@ -24,7 +25,7 @@ var _ fctl.Controller[*List] = (*ListCtrl)(nil) func newDefaultStore() *List { return &List{ - ListRunsResponseData: components.ListRunsResponseData{}, + ListManifestsResponseCursor: components.ListManifestsResponseCursor{}, } } @@ -37,10 +38,9 @@ func NewListCtrl() *ListCtrl { func NewList() *cobra.Command { return fctl.NewCommand("list", fctl.WithAliases("ls"), - fctl.WithShortDescription("List runs for an app"), - fctl.WithStringFlag("id", "", "App ID"), - fctl.WithIntFlag("page", 1, "Page number"), + fctl.WithShortDescription("List manifests"), fctl.WithIntFlag("page-size", 100, "Page size"), + fctl.WithStringFlag("cursor", "", "Opaque cursor token for the next page"), fctl.WithController(NewListCtrl()), ) } @@ -49,8 +49,7 @@ func (c *ListCtrl) GetStore() *List { return c.store } -func (c *ListCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { - +func (c *ListCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) if err != nil { return nil, err @@ -66,34 +65,40 @@ func (c *ListCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, erro if err != nil { return nil, err } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") + + var cursor *string + if v := fctl.GetString(cmd, "cursor"); v != "" { + cursor = &v } - runs, err := apiClient.ReadAppRuns(cmd.Context(), id, pointer.For(int64(fctl.GetInt(cmd, "page"))), pointer.For(int64(fctl.GetInt(cmd, "page-size")))) + + manifests, err := apiClient.ListManifests( + cmd.Context(), + pointer.For(int64(fctl.GetInt(cmd, "page-size"))), + cursor, + ) if err != nil { return nil, err } - c.store.ListRunsResponseData = runs.ListRunsResponse.Data + c.store.ListManifestsResponseCursor = manifests.ListManifestsResponse.Cursor return c, nil } -func (c *ListCtrl) Render(cmd *cobra.Command, args []string) error { +func (c *ListCtrl) Render(cmd *cobra.Command, _ []string) error { data := [][]string{ - {"Created At", "ID", "Configuration Id", "Status", "Message"}, + {"ID", "Name", "Latest Version", "Created At"}, } - for _, run := range c.store.Items { + for _, m := range c.store.Data { data = append(data, []string{ - run.CreatedAt.String(), - run.ID, - run.ConfigurationVersion.ID, - run.Status, - run.Message, + m.ID, + m.Name, + strconv.FormatInt(m.LatestVersion, 10), + fmt.Sprint(m.CreatedAt), }) } + if err := pterm. DefaultTable. WithHasHeader(). diff --git a/cmd/cloud/apps/manifests/root.go b/cmd/cloud/apps/manifests/root.go new file mode 100644 index 00000000..1f70d504 --- /dev/null +++ b/cmd/cloud/apps/manifests/root.go @@ -0,0 +1,24 @@ +package manifests + +import ( + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/v3/cmd/cloud/apps/manifests/versions" + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func NewCommand() *cobra.Command { + return fctl.NewCommand("manifests", + fctl.WithShortDescription("Manage manifests"), + fctl.WithAliases("manifest", "mf"), + fctl.WithChildCommands( + NewList(), + NewShow(), + NewCreate(), + NewDelete(), + NewUpdate(), + NewDownload(), + versions.NewCommand(), + ), + ) +} diff --git a/cmd/cloud/apps/runs/show.go b/cmd/cloud/apps/manifests/show.go similarity index 64% rename from cmd/cloud/apps/runs/show.go rename to cmd/cloud/apps/manifests/show.go index 53865833..f382b984 100644 --- a/cmd/cloud/apps/runs/show.go +++ b/cmd/cloud/apps/manifests/show.go @@ -1,4 +1,4 @@ -package runs +package manifests import ( "fmt" @@ -12,7 +12,7 @@ import ( ) type Show struct { - components.Run + components.Manifest } type ShowCtrl struct { @@ -22,9 +22,7 @@ type ShowCtrl struct { var _ fctl.Controller[*Show] = (*ShowCtrl)(nil) func newShowStore() *Show { - return &Show{ - Run: components.Run{}, - } + return &Show{} } func NewShowCtrl() *ShowCtrl { @@ -35,8 +33,8 @@ func NewShowCtrl() *ShowCtrl { func NewShow() *cobra.Command { return fctl.NewCommand("show", - fctl.WithShortDescription("Show a run"), - fctl.WithStringFlag("id", "", "Run ID"), + fctl.WithShortDescription("Show manifest details"), + fctl.WithStringFlag("id", "", "Manifest ID"), fctl.WithController(NewShowCtrl()), ) } @@ -61,29 +59,31 @@ func (c *ShowCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) if err != nil { return nil, err } + id := fctl.GetString(cmd, "id") if id == "" { return nil, fmt.Errorf("id is required") } - app, err := apiClient.ReadRun(cmd.Context(), id) + + manifest, err := apiClient.ReadManifest(cmd.Context(), id, nil) if err != nil { return nil, err } - c.store.Run = app.RunResponse.Data + c.store.Manifest = manifest.ManifestResponse.Data return c, nil } -func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { - pterm.DefaultSection.Println("Run") +func (c *ShowCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.DefaultSection.Println("Manifest") items := []pterm.BulletListItem{ - {Level: 0, Text: fmt.Sprintf("Created At: %s", c.store.Run.CreatedAt)}, - {Level: 0, Text: fmt.Sprintf("Id: %s", c.store.Run.ID)}, - {Level: 0, Text: fmt.Sprintf("Configuration Id: %s", c.store.Run.ConfigurationVersion.ID)}, - {Level: 0, Text: fmt.Sprintf("Status: %s", c.store.Run.Status)}, - {Level: 0, Text: fmt.Sprintf("Message: %s", c.store.Run.Message)}, + {Level: 0, Text: fmt.Sprintf("ID: %s", c.store.ID)}, + {Level: 0, Text: fmt.Sprintf("Name: %s", c.store.Name)}, + {Level: 0, Text: fmt.Sprintf("Latest Version: %d", c.store.LatestVersion)}, + {Level: 0, Text: fmt.Sprintf("Created At: %s", c.store.CreatedAt)}, + {Level: 0, Text: fmt.Sprintf("Updated At: %s", c.store.UpdatedAt)}, } if err := pterm. @@ -93,5 +93,6 @@ func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { Render(); err != nil { return err } + return nil } diff --git a/cmd/cloud/apps/manifests/update.go b/cmd/cloud/apps/manifests/update.go new file mode 100644 index 00000000..3d0beb76 --- /dev/null +++ b/cmd/cloud/apps/manifests/update.go @@ -0,0 +1,89 @@ +package manifests + +import ( + "fmt" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Update struct { + components.Manifest +} + +type UpdateCtrl struct { + store *Update +} + +var _ fctl.Controller[*Update] = (*UpdateCtrl)(nil) + +func newUpdateStore() *Update { + return &Update{} +} + +func NewUpdateCtrl() *UpdateCtrl { + return &UpdateCtrl{ + store: newUpdateStore(), + } +} + +func NewUpdate() *cobra.Command { + return fctl.NewCommand("update", + fctl.WithShortDescription("Update manifest metadata"), + fctl.WithStringFlag("id", "", "Manifest ID"), + fctl.WithStringFlag("name", "", "New name for the manifest"), + fctl.WithController(NewUpdateCtrl()), + ) +} + +func (c *UpdateCtrl) GetStore() *Update { + return c.store +} + +func (c *UpdateCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + id := fctl.GetString(cmd, "id") + if id == "" { + return nil, fmt.Errorf("id is required") + } + + name := fctl.GetString(cmd, "name") + if name == "" { + return nil, fmt.Errorf("name is required") + } + + resp, err := apiClient.UpdateManifest(cmd.Context(), id, components.UpdateManifestRequest{ + Name: name, + }) + if err != nil { + return nil, err + } + + c.store.Manifest = resp.ManifestResponse.Data + + return c, nil +} + +func (c *UpdateCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.Success.Printfln("Manifest updated: %s", c.store.ID) + return nil +} diff --git a/cmd/cloud/apps/versions/list.go b/cmd/cloud/apps/manifests/versions/list.go similarity index 55% rename from cmd/cloud/apps/versions/list.go rename to cmd/cloud/apps/manifests/versions/list.go index da3b079f..fa1108dc 100644 --- a/cmd/cloud/apps/versions/list.go +++ b/cmd/cloud/apps/manifests/versions/list.go @@ -14,7 +14,7 @@ import ( ) type List struct { - components.ListVersionsResponseData + components.ListManifestVersionsResponseCursor } type ListCtrl struct { @@ -25,7 +25,7 @@ var _ fctl.Controller[*List] = (*ListCtrl)(nil) func newDefaultStore() *List { return &List{ - ListVersionsResponseData: components.ListVersionsResponseData{}, + ListManifestVersionsResponseCursor: components.ListManifestVersionsResponseCursor{}, } } @@ -38,10 +38,10 @@ func NewListCtrl() *ListCtrl { func NewList() *cobra.Command { return fctl.NewCommand("list", fctl.WithAliases("ls"), - fctl.WithShortDescription("List versions for an app"), - fctl.WithStringFlag("id", "", "App ID"), - fctl.WithIntFlag("page", 1, "Page number"), + fctl.WithShortDescription("List manifest versions"), + fctl.WithStringFlag("manifest-id", "", "Manifest ID"), fctl.WithIntFlag("page-size", 100, "Page size"), + fctl.WithStringFlag("cursor", "", "Opaque cursor token for the next page"), fctl.WithController(NewListCtrl()), ) } @@ -50,7 +50,7 @@ func (c *ListCtrl) GetStore() *List { return c.store } -func (c *ListCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { +func (c *ListCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) if err != nil { return nil, err @@ -66,35 +66,45 @@ func (c *ListCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, erro if err != nil { return nil, err } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") + + manifestID := fctl.GetString(cmd, "manifest-id") + if manifestID == "" { + return nil, fmt.Errorf("manifest-id is required") + } + + var cursor *string + if v := fctl.GetString(cmd, "cursor"); v != "" { + cursor = &v } - versions, err := apiClient.ReadAppVersions(cmd.Context(), id, pointer.For(int64(fctl.GetInt(cmd, "page"))), pointer.For(int64(fctl.GetInt(cmd, "page-size")))) + versions, err := apiClient.ListManifestVersions( + cmd.Context(), + manifestID, + pointer.For(int64(fctl.GetInt(cmd, "page-size"))), + cursor, + ) if err != nil { return nil, err } - c.store.ListVersionsResponseData = versions.ListVersionsResponse.Data + c.store.ListManifestVersionsResponseCursor = versions.ListManifestVersionsResponse.Cursor return c, nil } -func (c *ListCtrl) Render(cmd *cobra.Command, args []string) error { +func (c *ListCtrl) Render(cmd *cobra.Command, _ []string) error { data := [][]string{ - {"ID", "AutoRunQueue", "Error", "ErrorMessage", "Status"}, + {"Manifest ID", "Version", "Created At"}, } - for _, version := range c.store.Items { + for _, v := range c.store.Data { data = append(data, []string{ - string(version.ID), - strconv.FormatBool(version.AutoQueueRuns), - version.Error, - version.ErrorMessage, - string(version.Status), + v.ManifestID, + strconv.FormatInt(v.Version, 10), + fmt.Sprint(v.CreatedAt), }) } + if err := pterm. DefaultTable. WithHasHeader(). diff --git a/cmd/cloud/apps/manifests/versions/push.go b/cmd/cloud/apps/manifests/versions/push.go new file mode 100644 index 00000000..2838d8bb --- /dev/null +++ b/cmd/cloud/apps/manifests/versions/push.go @@ -0,0 +1,94 @@ +package versions + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Push struct { + ManifestID string `json:"manifestId"` + Version int64 `json:"version"` +} + +type PushCtrl struct { + store *Push +} + +var _ fctl.Controller[*Push] = (*PushCtrl)(nil) + +func newPushStore() *Push { + return &Push{} +} + +func NewPushCtrl() *PushCtrl { + return &PushCtrl{ + store: newPushStore(), + } +} + +func NewPush() *cobra.Command { + return fctl.NewCommand("push", + fctl.WithShortDescription("Push a new version of a manifest"), + fctl.WithStringFlag("manifest-id", "", "Manifest ID"), + fctl.WithStringFlag("path", "", "Path to YAML manifest file"), + fctl.WithController(NewPushCtrl()), + ) +} + +func (c *PushCtrl) GetStore() *Push { + return c.store +} + +func (c *PushCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + manifestID := fctl.GetString(cmd, "manifest-id") + if manifestID == "" { + return nil, fmt.Errorf("manifest-id is required") + } + + path := fctl.GetString(cmd, "path") + if path == "" { + return nil, fmt.Errorf("path is required") + } + + data, err := os.ReadFile(filepath.Clean(path)) + if err != nil { + return nil, err + } + + resp, err := apiClient.PushManifestVersionRaw(cmd.Context(), manifestID, data) + if err != nil { + return nil, err + } + + c.store.ManifestID = resp.ManifestVersionResponse.Data.ManifestID + c.store.Version = resp.ManifestVersionResponse.Data.Version + + return c, nil +} + +func (c *PushCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.Success.Printfln("Manifest version %d pushed for %s", c.store.Version, c.store.ManifestID) + return nil +} diff --git a/cmd/cloud/apps/manifests/versions/push_test.go b/cmd/cloud/apps/manifests/versions/push_test.go new file mode 100644 index 00000000..66522b16 --- /dev/null +++ b/cmd/cloud/apps/manifests/versions/push_test.go @@ -0,0 +1,30 @@ +package versions + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func TestPush_JSONOutput_LowercaseKeys(t *testing.T) { + store := &Push{ManifestID: "mnf-abc", Version: 4} + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok) + require.Equal(t, "mnf-abc", data["manifestId"]) + require.EqualValues(t, 4, data["version"]) + + for _, capitalized := range []string{"ManifestID", "Version"} { + _, present := data[capitalized] + require.False(t, present, "must not surface Go-cased key %q", capitalized) + } +} diff --git a/cmd/cloud/apps/versions/root.go b/cmd/cloud/apps/manifests/versions/root.go similarity index 69% rename from cmd/cloud/apps/versions/root.go rename to cmd/cloud/apps/manifests/versions/root.go index 6d6fccb8..fb949d0b 100644 --- a/cmd/cloud/apps/versions/root.go +++ b/cmd/cloud/apps/manifests/versions/root.go @@ -8,12 +8,12 @@ import ( func NewCommand() *cobra.Command { return fctl.NewCommand("versions", - fctl.WithShortDescription("Manage app versions"), + fctl.WithShortDescription("Manage manifest versions"), + fctl.WithAliases("ver", "v"), fctl.WithChildCommands( NewList(), NewShow(), - NewArchive(), - NewManifest(), + NewPush(), ), ) } diff --git a/cmd/cloud/apps/manifests/versions/show.go b/cmd/cloud/apps/manifests/versions/show.go new file mode 100644 index 00000000..2ac45b20 --- /dev/null +++ b/cmd/cloud/apps/manifests/versions/show.go @@ -0,0 +1,112 @@ +package versions + +import ( + "encoding/base64" + "fmt" + "strconv" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type Show struct { + components.ManifestVersion +} + +type ShowCtrl struct { + store *Show +} + +var _ fctl.Controller[*Show] = (*ShowCtrl)(nil) + +func newShowStore() *Show { + return &Show{} +} + +func NewShowCtrl() *ShowCtrl { + return &ShowCtrl{ + store: newShowStore(), + } +} + +func NewShow() *cobra.Command { + return fctl.NewCommand("show", + fctl.WithShortDescription("Show a specific manifest version"), + fctl.WithStringFlag("manifest-id", "", "Manifest ID"), + fctl.WithStringFlag("version", "latest", "Version number or 'latest'"), + fctl.WithController(NewShowCtrl()), + ) +} + +func (c *ShowCtrl) GetStore() *Show { + return c.store +} + +func (c *ShowCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + manifestID := fctl.GetString(cmd, "manifest-id") + if manifestID == "" { + return nil, fmt.Errorf("manifest-id is required") + } + + version := fctl.GetString(cmd, "version") + + resp, err := apiClient.ReadManifestVersion(cmd.Context(), manifestID, version) + if err != nil { + return nil, err + } + + c.store.ManifestVersion = resp.ManifestVersionResponse.Data + + return c, nil +} + +func (c *ShowCtrl) Render(cmd *cobra.Command, _ []string) error { + pterm.DefaultSection.Println("Manifest Version") + + items := []pterm.BulletListItem{ + {Level: 0, Text: fmt.Sprintf("Manifest ID: %s", c.store.ManifestID)}, + {Level: 0, Text: fmt.Sprintf("Version: %s", strconv.FormatInt(c.store.Version, 10))}, + {Level: 0, Text: fmt.Sprintf("Created At: %s", c.store.CreatedAt)}, + } + + if err := pterm. + DefaultBulletList. + WithItems(items). + WithWriter(cmd.OutOrStdout()). + Render(); err != nil { + return err + } + + if c.store.Content != nil { + pterm.DefaultSection.WithWriter(cmd.OutOrStdout()).Println("Content") + + decoded, err := base64.StdEncoding.DecodeString(*c.store.Content) + if err != nil { + fmt.Fprintln(cmd.OutOrStdout(), *c.store.Content) + } else { + fmt.Fprintln(cmd.OutOrStdout(), string(decoded)) + } + } + + return nil +} diff --git a/cmd/cloud/apps/root.go b/cmd/cloud/apps/root.go index 208b9d13..b98403f9 100644 --- a/cmd/cloud/apps/root.go +++ b/cmd/cloud/apps/root.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/formancehq/fctl/v3/cmd/cloud/apps/runs" + "github.com/formancehq/fctl/v3/cmd/cloud/apps/deployments" + "github.com/formancehq/fctl/v3/cmd/cloud/apps/manifests" "github.com/formancehq/fctl/v3/cmd/cloud/apps/variables" - "github.com/formancehq/fctl/v3/cmd/cloud/apps/versions" fctl "github.com/formancehq/fctl/v3/pkg" ) @@ -16,6 +16,7 @@ func NewCommand() *cobra.Command { fctl.WithShortDescription("Manage app manifests"), fctl.WithPersistentBoolFlag("experimental", false, "Enable experimental commands"), fctl.WithPersistentStringFlag(fctl.FrameworkURIFlag, "https://deploy.formance.cloud", "Framework URI"), + fctl.WithPersistentStringFlag(fctl.DeployAppAliasFlag, fctl.DefaultDeployAppAlias, "Membership application alias used to authenticate against the deploy server"), fctl.WithPersistentPreRunE(func(cmd *cobra.Command, args []string) error { ok, err := cmd.Flags().GetBool("experimental") if err != nil { @@ -34,9 +35,10 @@ func NewCommand() *cobra.Command { NewCreate(), NewDelete(), NewShow(), - NewDeploy(), - runs.NewCommand(), - versions.NewCommand(), + NewBindManifest(), + NewUnbindManifest(), + deployments.NewCommand(), + manifests.NewCommand(), variables.NewCommand(), ), ) diff --git a/cmd/cloud/apps/show.go b/cmd/cloud/apps/show.go index dfb29b40..510df228 100644 --- a/cmd/cloud/apps/show.go +++ b/cmd/cloud/apps/show.go @@ -9,13 +9,28 @@ import ( "github.com/spf13/cobra" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" fctl "github.com/formancehq/fctl/v3/pkg" ) +func divergenceHint(k components.Kind) string { + switch k { + case components.KindUndeployed: + return "manifest bound but no successful deployment yet" + case components.KindSynced: + return "deployed (manifestId, version) matches the bound manifest's latest version" + case components.KindBehind: + return "deployed manifest matches the bound manifest but on an older version" + case components.KindRebound: + return "the app was rebound; deployed manifest is a different manifest" + default: + return "" + } +} + type Show struct { components.App - State components.State } type ShowCtrl struct { @@ -26,8 +41,7 @@ var _ fctl.Controller[*Show] = (*ShowCtrl)(nil) func newShowStore() *Show { return &Show{ - App: components.App{}, - State: components.State{}, + App: components.App{}, } } @@ -69,23 +83,19 @@ func (c *ShowCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, erro if id == "" { return nil, fmt.Errorf("id is required") } - app, err := apiClient.ReadApp(cmd.Context(), id) + + app, err := apiClient.ReadApp(cmd.Context(), id, []operations.ReadAppInclude{operations.ReadAppIncludeState}) if err != nil { return nil, err } c.store.App = app.AppResponse.Data - stateVersion, err := apiClient.ReadAppCurrentStateVersion(cmd.Context(), id) - if err == nil { - c.store.State = stateVersion.ReadStateResponse.Data - } - return c, nil } func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { - if c.store.State.Stack != nil { + if c.store.App.State != nil && c.store.App.State.Stack != nil { _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) if err != nil { return err @@ -101,7 +111,7 @@ func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { } if consoleURL := info.GetConsoleURL(); consoleURL != nil { - pterm.Info.Printfln("View stack in console: %s/%s/%s?region=%s", *consoleURL, organizationID, c.store.State.Stack["id"], c.store.State.Stack["region_id"]) + pterm.Info.Printfln("View stack in console: %s/%s/%s?region=%s", *consoleURL, organizationID, c.store.App.State.Stack["id"], c.store.App.State.Stack["region_id"]) } } @@ -110,12 +120,10 @@ func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { items := []pterm.BulletListItem{ {Level: 0, Text: fmt.Sprintf("ID: %s", c.store.App.ID)}, {Level: 0, Text: fmt.Sprintf("Name: %s", c.store.App.Name)}, - {Level: 0, Text: fmt.Sprintf("Run Status: %s", func() string { - if c.store.App.CurrentRun == nil { - return "N/A" - } - return c.store.App.CurrentRun.Status - }())}, + } + + if c.store.App.StackID != nil { + items = append(items, pterm.BulletListItem{Level: 0, Text: fmt.Sprintf("Stack ID: %s", *c.store.App.StackID)}) } if err := pterm. @@ -126,24 +134,62 @@ func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { return err } - if c.store.State.Stack != nil { + if cm := c.store.App.CurrentManifest; cm != nil { + pterm.DefaultSection.Println("Manifest") + manifestItems := []pterm.BulletListItem{ + {Level: 0, Text: fmt.Sprintf("ID: %s", cm.ID)}, + {Level: 0, Text: fmt.Sprintf("Name: %s", cm.Name)}, + {Level: 0, Text: fmt.Sprintf("Latest Version: %d", cm.LatestVersion)}, + } + if d := cm.Divergence; d != nil { + manifestItems = append(manifestItems, pterm.BulletListItem{ + Level: 0, + Text: fmt.Sprintf("Status: %s — %s", d.Kind, divergenceHint(d.Kind)), + }) + if d.DeployedManifestID != nil { + manifestItems = append(manifestItems, pterm.BulletListItem{ + Level: 1, + Text: fmt.Sprintf("Deployed manifest: %s", *d.DeployedManifestID), + }) + } + if d.DeployedVersion != nil { + manifestItems = append(manifestItems, pterm.BulletListItem{ + Level: 1, + Text: fmt.Sprintf("Deployed version: %d", *d.DeployedVersion), + }) + } + manifestItems = append(manifestItems, pterm.BulletListItem{ + Level: 1, + Text: fmt.Sprintf("Latest version: %d", d.LatestVersion), + }) + } + if err := pterm. + DefaultBulletList. + WithItems(manifestItems). + WithWriter(cmd.OutOrStdout()). + Render(); err != nil { + return err + } + } + + if c.store.App.State != nil && c.store.App.State.Stack != nil { pterm.DefaultSection.Println("State") - items = []pterm.BulletListItem{} + stateItems := []pterm.BulletListItem{} - for k, v := range c.store.State.Stack { + for k, v := range c.store.App.State.Stack { if v == nil { continue } - items = append(items, pterm.BulletListItem{Level: 0, Text: fmt.Sprintf("%s: %s", k, v)}) + stateItems = append(stateItems, pterm.BulletListItem{Level: 0, Text: fmt.Sprintf("%s: %s", k, v)}) } - slices.SortFunc(items, func(a, b pterm.BulletListItem) int { + slices.SortFunc(stateItems, func(a, b pterm.BulletListItem) int { return strings.Compare(a.Text, b.Text) }) if err := pterm. DefaultBulletList. - WithItems(items). + WithItems(stateItems). WithWriter(cmd.OutOrStdout()). Render(); err != nil { return err diff --git a/cmd/cloud/apps/show_test.go b/cmd/cloud/apps/show_test.go new file mode 100644 index 00000000..64d682d4 --- /dev/null +++ b/cmd/cloud/apps/show_test.go @@ -0,0 +1,149 @@ +package apps + +import ( + "bytes" + "encoding/json" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" + + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +func TestShow_JSONOutput_PreservesSDKShape(t *testing.T) { + stackID := "stk-abc" + deployedManifestID := "mnf-old" + deployedVersion := int64(1) + + store := &Show{ + App: components.App{ + ID: "app-abc", + Name: "my-app", + StackID: &stackID, + CurrentManifest: &components.AppCurrentManifest{ + ID: "mnf-new", + Name: "my-manifest", + LatestVersion: 3, + Divergence: &components.AppManifestDivergence{ + Kind: components.KindRebound, + DeployedManifestID: &deployedManifestID, + DeployedVersion: &deployedVersion, + LatestVersion: 3, + }, + }, + }, + } + + out, err := json.Marshal(fctl.ExportedData{Data: store}) + require.NoError(t, err) + + var raw map[string]any + require.NoError(t, json.Unmarshal(out, &raw)) + + data, ok := raw["data"].(map[string]any) + require.True(t, ok) + require.Equal(t, "app-abc", data["id"]) + require.Equal(t, "stk-abc", data["stackId"]) + + cm, ok := data["currentManifest"].(map[string]any) + require.True(t, ok, "currentManifest must be present and named lowercase") + require.Equal(t, "mnf-new", cm["id"]) + require.EqualValues(t, 3, cm["latestVersion"]) + + div, ok := cm["divergence"].(map[string]any) + require.True(t, ok, "divergence must be present") + require.Equal(t, "rebound", div["kind"]) + require.Equal(t, "mnf-old", div["deployedManifestId"]) + require.EqualValues(t, 1, div["deployedVersion"]) +} + +func TestShow_PlainRender_IncludesDivergenceSection(t *testing.T) { + deployedManifestID := "mnf-old" + deployedVersion := int64(1) + + c := NewShowCtrl() + c.store.App = components.App{ + ID: "app-abc", + Name: "my-app", + CurrentManifest: &components.AppCurrentManifest{ + ID: "mnf-new", + Name: "my-manifest", + LatestVersion: 3, + Divergence: &components.AppManifestDivergence{ + Kind: components.KindBehind, + DeployedManifestID: &deployedManifestID, + DeployedVersion: &deployedVersion, + LatestVersion: 3, + }, + }, + } + + cmd := &cobra.Command{} + buf := &bytes.Buffer{} + cmd.SetOut(buf) + + require.NoError(t, c.Render(cmd, nil)) + + // pterm.DefaultSection writes to os.Stdout directly; only the bullet + // list goes through cmd.Out. So we assert on bullet content, not the + // section header. + got := stripANSI(buf.String()) + require.Contains(t, got, "ID: mnf-new", "should print bound manifest id") + require.Contains(t, got, "Name: my-manifest", "should print bound manifest name") + require.Contains(t, got, "Latest Version: 3", "should print latest version of bound manifest") + require.Contains(t, got, "behind", "should print divergence kind") + require.Contains(t, got, "Deployed manifest: mnf-old") + require.Contains(t, got, "Deployed version: 1") + require.Contains(t, got, "Latest version: 3") +} + +func TestShow_PlainRender_OmitsDivergenceWhenAbsent(t *testing.T) { + c := NewShowCtrl() + c.store.App = components.App{ID: "app-abc", Name: "my-app"} + + cmd := &cobra.Command{} + buf := &bytes.Buffer{} + cmd.SetOut(buf) + + require.NoError(t, c.Render(cmd, nil)) + + got := stripANSI(buf.String()) + require.NotContains(t, got, "rebound") + require.NotContains(t, got, "Deployed manifest") +} + +func TestDivergenceHint_CoversAllKinds(t *testing.T) { + for _, k := range []components.Kind{ + components.KindUndeployed, + components.KindSynced, + components.KindBehind, + components.KindRebound, + } { + require.NotEmpty(t, divergenceHint(k), "missing hint for kind %q", k) + } + require.Empty(t, divergenceHint(components.Kind("unknown"))) +} + +// stripANSI removes pterm color/escape sequences so assertions can match on +// the raw text content without coupling to terminal formatting. +func stripANSI(s string) string { + var b strings.Builder + inEsc := false + for _, r := range s { + switch { + case r == 0x1b: + inEsc = true + case inEsc && (r == 'm' || r == 'K' || r == 'A' || r == 'B' || r == 'C' || r == 'D'): + inEsc = false + case inEsc: + // swallow CSI body + default: + b.WriteRune(r) + } + } + return b.String() +} diff --git a/cmd/cloud/apps/unbind_manifest.go b/cmd/cloud/apps/unbind_manifest.go new file mode 100644 index 00000000..7607e5eb --- /dev/null +++ b/cmd/cloud/apps/unbind_manifest.go @@ -0,0 +1,69 @@ +package apps + +import ( + "fmt" + + "github.com/pterm/pterm" + "github.com/spf13/cobra" + + fctl "github.com/formancehq/fctl/v3/pkg" +) + +type UnbindManifest struct { + AppID string `json:"appId"` +} + +type UnbindManifestCtrl struct { + store *UnbindManifest +} + +var _ fctl.Controller[*UnbindManifest] = (*UnbindManifestCtrl)(nil) + +func NewUnbindManifestCtrl() *UnbindManifestCtrl { + return &UnbindManifestCtrl{store: &UnbindManifest{}} +} + +func NewUnbindManifest() *cobra.Command { + return fctl.NewCommand("unbind-manifest", + fctl.WithShortDescription("Unbind the manifest from an app"), + fctl.WithStringFlag("app-id", "", "App ID"), + fctl.WithController(NewUnbindManifestCtrl()), + ) +} + +func (c *UnbindManifestCtrl) GetStore() *UnbindManifest { return c.store } + +func (c *UnbindManifestCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { + _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) + if err != nil { + return nil, err + } + + _, apiClient, err := fctl.NewAppDeployClientFromFlags( + cmd, + relyingParty, + fctl.NewPTermDialog(), + profileName, + *profile, + ) + if err != nil { + return nil, err + } + + appID := fctl.GetString(cmd, "app-id") + if appID == "" { + return nil, fmt.Errorf("app-id is required") + } + + if _, err := apiClient.DetachAppManifest(cmd.Context(), appID); err != nil { + return nil, err + } + + c.store.AppID = appID + return c, nil +} + +func (c *UnbindManifestCtrl) Render(_ *cobra.Command, _ []string) error { + pterm.Success.Printfln("Manifest unbound from app %s", c.store.AppID) + return nil +} diff --git a/cmd/cloud/apps/variables/create.go b/cmd/cloud/apps/variables/create.go index 33f7bf62..90f81213 100644 --- a/cmd/cloud/apps/variables/create.go +++ b/cmd/cloud/apps/variables/create.go @@ -40,8 +40,6 @@ func NewCreate() *cobra.Command { fctl.WithStringFlag("key", "", "Variable key"), fctl.WithStringFlag("value", "", "Variable value"), fctl.WithStringFlag("description", "", "Variable description"), - fctl.WithBoolFlag("sensitive", true, "Mark the variable as sensitive"), - fctl.WithStringFlag("category", "", "Variable category (env or terraform)"), fctl.WithController(NewCreateCtrl()), ) } @@ -71,7 +69,6 @@ func (c *CreateCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error Key: fctl.GetString(cmd, "key"), Value: fctl.GetString(cmd, "value"), Description: func() *string { s := fctl.GetString(cmd, "description"); return &s }(), - Sensitive: fctl.GetBool(cmd, "sensitive"), }, }) if err != nil { @@ -89,12 +86,7 @@ func (c *CreateCtrl) Render(cmd *cobra.Command, args []string) error { items := []pterm.BulletListItem{ {Level: 0, Text: fmt.Sprintf("ID: %s", c.store.Variable.ID)}, {Level: 0, Text: fmt.Sprintf("Key: %s", c.store.Variable.Key)}, - {Level: 0, Text: fmt.Sprintf("Value: %s", func() string { - if c.store.Variable.Sensitive { - return "****" - } - return c.store.Variable.Value - }())}, + {Level: 0, Text: fmt.Sprintf("Value: %s", c.store.Variable.Value)}, {Level: 0, Text: fmt.Sprintf("Description: %s", func() string { if c.store.Variable.Description == nil { return "N/A" diff --git a/cmd/cloud/apps/variables/list.go b/cmd/cloud/apps/variables/list.go index fecc1f37..01afe831 100644 --- a/cmd/cloud/apps/variables/list.go +++ b/cmd/cloud/apps/variables/list.go @@ -13,7 +13,7 @@ import ( ) type List struct { - components.ReadVariablesResponseData + components.ReadVariablesResponseCursor } type ListCtrl struct { @@ -24,7 +24,7 @@ var _ fctl.Controller[*List] = (*ListCtrl)(nil) func newDefaultStore() *List { return &List{ - ReadVariablesResponseData: components.ReadVariablesResponseData{}, + ReadVariablesResponseCursor: components.ReadVariablesResponseCursor{}, } } @@ -39,8 +39,8 @@ func NewList() *cobra.Command { fctl.WithAliases("ls"), fctl.WithShortDescription("List variables for an app"), fctl.WithStringFlag("id", "", "App ID"), - fctl.WithIntFlag("page", 1, "Page number"), fctl.WithIntFlag("page-size", 100, "Page size"), + fctl.WithStringFlag("cursor", "", "Opaque cursor token for the next page"), fctl.WithController(NewListCtrl()), ) } @@ -70,12 +70,22 @@ func (c *ListCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, erro return nil, fmt.Errorf("id is required") } - vars, err := apiClient.ReadAppVariables(cmd.Context(), id, pointer.For(int64(fctl.GetInt(cmd, "page"))), pointer.For(int64(fctl.GetInt(cmd, "page-size")))) + var cursor *string + if v := fctl.GetString(cmd, "cursor"); v != "" { + cursor = &v + } + + vars, err := apiClient.ReadAppVariables( + cmd.Context(), + id, + pointer.For(int64(fctl.GetInt(cmd, "page-size"))), + cursor, + ) if err != nil { return nil, err } - c.store.ReadVariablesResponseData = vars.ReadVariablesResponse.Data + c.store.ReadVariablesResponseCursor = vars.ReadVariablesResponse.Cursor return c, nil } @@ -85,16 +95,11 @@ func (c *ListCtrl) Render(cmd *cobra.Command, args []string) error { {"Id", "Key", "Value", "Description"}, } - for _, variable := range c.store.ReadVariablesResponseData.Items { + for _, variable := range c.store.Data { data = append(data, []string{ variable.ID, variable.Key, - func() string { - if variable.Sensitive { - return "****" - } - return variable.Value - }(), + variable.Value, func() string { if variable.Description == nil { return "" diff --git a/cmd/cloud/apps/versions/archive.go b/cmd/cloud/apps/versions/archive.go deleted file mode 100644 index 1685f543..00000000 --- a/cmd/cloud/apps/versions/archive.go +++ /dev/null @@ -1,81 +0,0 @@ -package versions - -import ( - "fmt" - "io" - - "github.com/spf13/cobra" - - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" - - fctl "github.com/formancehq/fctl/v3/pkg" -) - -type Archive []byte - -type ArchiveCtrl struct { - store Archive -} - -var _ fctl.Controller[Archive] = (*ArchiveCtrl)(nil) - -func newArchiveStore() Archive { - return []byte{} -} - -func NewArchiveCtrl() *ArchiveCtrl { - return &ArchiveCtrl{ - store: newArchiveStore(), - } -} - -func NewArchive() *cobra.Command { - return fctl.NewCommand("show-archive", - fctl.WithShortDescription("Archive versions for an app"), - fctl.WithStringFlag("id", "", "App ID"), - fctl.WithController(NewArchiveCtrl()), - ) -} - -func (c *ArchiveCtrl) GetStore() Archive { - return c.store -} - -func (c *ArchiveCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { - _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) - if err != nil { - return nil, err - } - - _, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return nil, err - } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") - } - versions, err := apiClient.ReadVersion(cmd.Context(), id, operations.WithAcceptHeaderOverride(operations.AcceptHeaderEnumApplicationGzip)) - if err != nil { - return nil, err - } - defer versions.TwoHundredApplicationGzipResponseStream.Close() - - data, err := io.ReadAll(versions.TwoHundredApplicationGzipResponseStream) - if err != nil { - return nil, err - } - c.store = data - return c, nil -} - -func (c *ArchiveCtrl) Render(cmd *cobra.Command, args []string) error { - fmt.Println(string(c.store)) - return nil -} diff --git a/cmd/cloud/apps/versions/manifest.go b/cmd/cloud/apps/versions/manifest.go deleted file mode 100644 index 6bc411c7..00000000 --- a/cmd/cloud/apps/versions/manifest.go +++ /dev/null @@ -1,75 +0,0 @@ -package versions - -import ( - "fmt" - "io" - - "github.com/spf13/cobra" - - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" - - fctl "github.com/formancehq/fctl/v3/pkg" -) - -type ManifestCtrl struct { - store any -} - -var _ fctl.Controller[any] = (*ManifestCtrl)(nil) - -func NewManifestCtrl() *ManifestCtrl { - return &ManifestCtrl{ - store: nil, - } -} - -func NewManifest() *cobra.Command { - return fctl.NewCommand("show-manifest", - fctl.WithShortDescription("Show the manifest for an app version"), - fctl.WithStringFlag("id", "", "App ID"), - fctl.WithController(NewManifestCtrl()), - ) -} - -func (c *ManifestCtrl) GetStore() any { - return c.store -} - -func (c *ManifestCtrl) Run(cmd *cobra.Command, args []string) (fctl.Renderable, error) { - _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) - if err != nil { - return nil, err - } - - _, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return nil, err - } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") - } - versions, err := apiClient.ReadVersion(cmd.Context(), id, operations.WithAcceptHeaderOverride(operations.AcceptHeaderEnumApplicationYaml)) - if err != nil { - return nil, err - } - defer versions.TwoHundredApplicationYamlResponseStream.Close() - data, err := io.ReadAll(versions.TwoHundredApplicationYamlResponseStream) - if err != nil { - return nil, err - } - - c.store = string(data) - return c, nil -} - -func (c *ManifestCtrl) Render(cmd *cobra.Command, args []string) error { - fmt.Println(c.store) - return nil -} diff --git a/cmd/cloud/apps/versions/show.go b/cmd/cloud/apps/versions/show.go deleted file mode 100644 index cb0782c4..00000000 --- a/cmd/cloud/apps/versions/show.go +++ /dev/null @@ -1,97 +0,0 @@ -package versions - -import ( - "fmt" - - "github.com/pterm/pterm" - "github.com/spf13/cobra" - - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" - - fctl "github.com/formancehq/fctl/v3/pkg" -) - -type Show struct { - components.ConfigurationVersion -} - -type ShowCtrl struct { - store *Show -} - -var _ fctl.Controller[*Show] = (*ShowCtrl)(nil) - -func newShowStore() *Show { - return &Show{ - ConfigurationVersion: components.ConfigurationVersion{}, - } -} - -func NewShowCtrl() *ShowCtrl { - return &ShowCtrl{ - store: newShowStore(), - } -} - -func NewShow() *cobra.Command { - return fctl.NewCommand("show", - fctl.WithShortDescription("Show a version"), - fctl.WithStringFlag("id", "", "Version ID"), - fctl.WithController(NewShowCtrl()), - ) -} - -func (c *ShowCtrl) GetStore() *Show { - return c.store -} - -func (c *ShowCtrl) Run(cmd *cobra.Command, _ []string) (fctl.Renderable, error) { - _, profile, profileName, relyingParty, err := fctl.LoadAndAuthenticateCurrentProfile(cmd) - if err != nil { - return nil, err - } - - _, apiClient, err := fctl.NewAppDeployClientFromFlags( - cmd, - relyingParty, - fctl.NewPTermDialog(), - profileName, - *profile, - ) - if err != nil { - return nil, err - } - id := fctl.GetString(cmd, "id") - if id == "" { - return nil, fmt.Errorf("id is required") - } - version, err := apiClient.ReadVersion(cmd.Context(), id) - if err != nil { - return nil, err - } - - c.store.ConfigurationVersion = version.AppVersionResponse.Data - - return c, nil -} - -func (c *ShowCtrl) Render(cmd *cobra.Command, args []string) error { - pterm.DefaultSection.Println("Version") - - items := []pterm.BulletListItem{ - {Level: 0, Text: fmt.Sprintf("Id: %s", c.store.ConfigurationVersion.ID)}, - {Level: 0, Text: fmt.Sprintf("AutoRunQueue: %t", c.store.ConfigurationVersion.AutoQueueRuns)}, - {Level: 0, Text: fmt.Sprintf("Status: %s", c.store.ConfigurationVersion.Status)}, - {Level: 0, Text: fmt.Sprintf("Error: %s", c.store.ConfigurationVersion.Error)}, - {Level: 0, Text: fmt.Sprintf("ErrorMessage: %s", c.store.ConfigurationVersion.ErrorMessage)}, - } - - if err := pterm. - DefaultBulletList. - WithItems(items). - WithWriter(cmd.OutOrStdout()). - Render(); err != nil { - return err - } - return nil -} diff --git a/go.mod b/go.mod index 2b0f11bc..5846a83e 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/pterm/pterm v0.12.83 github.com/segmentio/ksuid v1.0.4 github.com/spf13/cobra v1.10.2 + github.com/stretchr/testify v1.11.1 github.com/zitadel/oidc/v2 v2.12.2 golang.org/x/mod v0.35.0 golang.org/x/oauth2 v0.36.0 @@ -72,7 +73,6 @@ require ( github.com/sergi/go-diff v1.4.0 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/spf13/pflag v1.0.10 // indirect - github.com/stretchr/testify v1.11.1 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/uptrace/bun v1.2.18 // indirect github.com/uptrace/opentelemetry-go-extra/otellogrus v0.3.2 // indirect diff --git a/internal/deployserverclient/.speakeasy/gen.lock b/internal/deployserverclient/.speakeasy/gen.lock index 4cde509a..501008b0 100644 --- a/internal/deployserverclient/.speakeasy/gen.lock +++ b/internal/deployserverclient/.speakeasy/gen.lock @@ -1,31 +1,32 @@ lockVersion: 2.0.0 id: 12df0dd4-09cf-49f5-8116-53c77b28ba01 management: - docChecksum: c7e98d8b5bc9be6f81f0eeed1f3a5870 + docChecksum: f5ce490c03f43321db414fea57886595 docVersion: 0.1.0 speakeasyVersion: 1.759.2 generationVersion: 2.869.23 - releaseVersion: 0.0.1 - configChecksum: ba58a7e3622a973527bb800387385db5 + releaseVersion: 0.1.1 + configChecksum: 65bf761ed2e45c2edc12016a208c0bb8 persistentEdits: - generation_id: 401ab3a5-1eee-4de9-afad-3bc82ced2790 - pristine_commit_hash: 292db5daa074a2c97f651a9e43b687cc06b80421 - pristine_tree_hash: e1516d32bb2dec50c5ed668f769e5c9dd3bfa3e2 + generation_id: b3a2b883-5a65-4d6c-a4b5-556694ac6c6f + pristine_commit_hash: 4f83752b6bdadd241de4f921e43b7d20bd710f30 + pristine_tree_hash: 68f3c94c2dd7651a10d38ce1c8a8c6955473b25a features: go: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 - additionalProperties: 0.1.2 + constsAndDefaults: 0.1.14 core: 3.13.40 defaultEnabledRetries: 0.2.0 devContainers: 2.90.0 downloadStreams: 0.1.2 envVarSecurityUsage: 0.3.2 flattening: 2.81.2 + globalSecurity: 2.82.13 globalSecurityCallbacks: 0.1.0 + globalSecurityFlattening: 0.1.0 globalServerURLs: 2.83.1 intellisenseMarkdownSupport: 0.1.0 - nullables: 0.2.1 responseFormat: 0.1.2 retries: 2.84.2 sdkHooks: 0.3.0 @@ -49,40 +50,48 @@ trackedFiles: pristine_git_object: e6a994416d0f527912d2d272e2583458f4fc9bcb USAGE.md: id: 3aed33ce6e6f - last_write_checksum: sha1:68c17e008e2e932f050412061e71c13887f3166a - pristine_git_object: 7d5b93003c9a9960e3c73c77e63485c123735ae2 + last_write_checksum: sha1:e64f0c797a0a08e9f7d1cf3de0b5462343d21394 + pristine_git_object: 5e9db16f4c1c967289b654d79c909291e1e52e8f deployserver.go: id: 4e88cb1c88d3 - last_write_checksum: sha1:6355e1c2c6bbd4571b16db47b164221f81abd033 - pristine_git_object: 053900e8b2c72794c7e28cc7288b1ab1f8ec3d40 + last_write_checksum: sha1:6a002f47279489f88f6276eee8ef47bb1e92a12c + pristine_git_object: 9212799b25b650560a7385357fbe56fdd6b8a05f + docs/models/apierrors/error.md: + id: 7c6e7719d689 + last_write_checksum: sha1:e3115a5a7de0780066dc4a2256c42f7c0976447b + pristine_git_object: 5450343d4870b85f53cb47ab9190928cf72fb86f docs/models/components/app.md: id: a31b0d7743a7 - last_write_checksum: sha1:809583baf0442c12bf75572352cf971c9829cd36 - pristine_git_object: a22cba38ec4d6ac643c4d992ee809f8b80d3eaaf - docs/models/components/application.md: - id: eaa211cc7a8e - last_write_checksum: sha1:970bd87a5ca3b063e55ebc0125238be29681412e - pristine_git_object: ff0d66292a48d55b546a2fd83224b81477ab4524 + last_write_checksum: sha1:002bd53acd9a8208b9aedb5e6ae368fbc8c8851f + pristine_git_object: c77eac6a3543a43397427958811562bf754f65fc + docs/models/components/appcurrentmanifest.md: + id: 2dd2ef03f47d + last_write_checksum: sha1:59effaf340c7928d5de891115eed2d5fd9a292af + pristine_git_object: 8d2c8375985e46c50c132fad56f699f663f60736 + docs/models/components/appmanifestdivergence.md: + id: a0580427f5bb + last_write_checksum: sha1:afe31b7e636c6293e67149addf9062b140e6d7c2 + pristine_git_object: 92ae72e8ef09024eb6d1175e07fb8107a563602a docs/models/components/appresponse.md: id: d91756763bd8 last_write_checksum: sha1:bc1cb4578672a35de623e2c851eb3cd7ac1ef282 pristine_git_object: 4b41a7e872fa8e853f9b1121498b03f2c9ff7484 - docs/models/components/appversionresponse.md: - id: a7fbfee5e7e9 - last_write_checksum: sha1:f2afe00b929df2f3a047fe3eebfb4aa395fe7979 - pristine_git_object: 0d1545831463f0e6b819cb572b7295f7a2480d1f - docs/models/components/configurationversion.md: - id: fbbe6f7ab145 - last_write_checksum: sha1:c9af04b6508edc467b37187a8eb88d3d80f9a133 - pristine_git_object: 66bd7ff689c656d1350c4cbf6e435c830b5dbccf - docs/models/components/connector.md: - id: c3e2692bb99b - last_write_checksum: sha1:98399c6cd09c8dc96792d5ee2e5cd9b6119658d5 - pristine_git_object: fce666c8269bac8aaa679179fe1d5045651eced2 + docs/models/components/attachmanifestrequest.md: + id: cb3dfde05df4 + last_write_checksum: sha1:2a6c296c5ebb62b3ceee718540389ff4e0229ac4 + pristine_git_object: b1ecb225ac6534877f822476b25b56d539234523 docs/models/components/createapprequest.md: id: f64ccea218c9 - last_write_checksum: sha1:2d8488fa5d6828d6d95b56f769cf76fe4b70cb9d - pristine_git_object: 5bc2c5c9efedb243ffebdcf592aec214fee2db6a + last_write_checksum: sha1:8281f54cb47b92d3af4f645c6029dd2941ea7572 + pristine_git_object: 8d2ae919f0a7e732719ebf8ed5b29c959c68a54b + docs/models/components/createdeploymentrequest.md: + id: f4fbf8bda1d8 + last_write_checksum: sha1:676927d3710e088975778a88a91cb14d534e2453 + pristine_git_object: 03f669ebc8fbefa0a3d544e4ec3d4daca2c828ad + docs/models/components/createmanifestresponse.md: + id: 2a7b75671c99 + last_write_checksum: sha1:1d8e04b9cf3d114a7663311c9f167ff750a130bb + pristine_git_object: c686febb6d115bc4c25f8727ed39b6d75eb18fb6 docs/models/components/createvariablerequest.md: id: 1656d1204270 last_write_checksum: sha1:650be824e43882247b0beb008425e05b8182f946 @@ -91,14 +100,26 @@ trackedFiles: id: 77cc5c4876b1 last_write_checksum: sha1:6f884cdcec2003eaa5bf016cc521b269869a0628 pristine_git_object: 82ba7c122ddd49378c9e1880cde26477645bb5ae + docs/models/components/data.md: + id: 3f89c52c2b17 + last_write_checksum: sha1:e578e08fe6a5e194a0292de6f85a28c328774c52 + pristine_git_object: f17677259850f82838a1bd8112b6c42f6fec5deb + docs/models/components/deleteappresponse.md: + id: f57e1423f086 + last_write_checksum: sha1:7e55b75abfc7d75c181f5712f19696bba389dbbc + pristine_git_object: 0d8b766a83b8979e46cd756ef04bb06821f92e2f + docs/models/components/deploymentresource.md: + id: cdd39d4f1853 + last_write_checksum: sha1:a41756777d1668bcfa7059800ae31b9b1972ecec + pristine_git_object: 4bf3d77b919ee372715c9a8ad9ed93be1eeade72 + docs/models/components/deploymentresponse.md: + id: 30bd20db7b83 + last_write_checksum: sha1:5a7aab41fc5ad3264cc5ecc0a7a4e32d5fd3b2e3 + pristine_git_object: e5a1bb0f3398f1826e9712997c145579c6151784 docs/models/components/diagnostic.md: id: 201e27a8a975 last_write_checksum: sha1:317229cc87d1448ed825e407aca88c0adb7442b6 pristine_git_object: 0d90d8be9c298a731d3f1fa6e5866ce0430960a3 - docs/models/components/dotself.md: - id: 90400d31ccf5 - last_write_checksum: sha1:5794f003e20bfcab4f50501881214e2dae5c24e7 - pristine_git_object: c0862a7dfec62cc61cce31ea3e3f54ea6f94df90 docs/models/components/error.md: id: 8ccbea40d025 last_write_checksum: sha1:e3115a5a7de0780066dc4a2256c42f7c0976447b @@ -107,134 +128,106 @@ trackedFiles: id: 728948c70168 last_write_checksum: sha1:7c40945dac218ce5e5e11e7c907d27a3ea14c417 pristine_git_object: df1fdd59f3c85e4ba70573ff7954b12ac1d33d08 - docs/models/components/ledger.md: - id: caca547955cc - last_write_checksum: sha1:1fcc81fee7ae6662ca8d4c5dfcc491c79835d6a0 - pristine_git_object: cc0f331e8da83acf62f3ad9a79efd9f37b2896e9 + docs/models/components/kind.md: + id: 72cd1832e8b4 + last_write_checksum: sha1:e6a4325929adae5d5be88ccaa35a2fdb6b50bb38 + pristine_git_object: 983f988a4d90a4549a108b3f8852e39af4447cfe docs/models/components/listappsresponse.md: id: e0c61f1197fc - last_write_checksum: sha1:913aa9678e2c21b99e8623583272fbde0e36325d - pristine_git_object: 60800496ea21b54d93baf476e7be18db3d702608 - docs/models/components/listappsresponsedata.md: - id: d692cd2a8694 - last_write_checksum: sha1:f78fc9143a13813cd301a43b30cac5ac1bad5095 - pristine_git_object: 8a07dd0a615eb99b8df520e59dea77b5e263989d - docs/models/components/listrunsresponse.md: - id: 1d029776d9f4 - last_write_checksum: sha1:8a1513e66b60fa351cabba727d7638fcc6d9f4cc - pristine_git_object: 8751277e4328128453533c5fd45dccd6bed80cc6 - docs/models/components/listrunsresponsedata.md: - id: 60b6cc35e1ad - last_write_checksum: sha1:a13d5fe6858bb00a9409cc3d98ec441b658d77ed - pristine_git_object: d29d6c4d5315b117030b5e945f2ed4c772817262 - docs/models/components/listversionsresponse.md: - id: f82b651e7159 - last_write_checksum: sha1:328a745f8ee1ec2021efe8ded9354bd89aaf3af7 - pristine_git_object: 5c0505ae4e68e4ffe89c25493a0b31559f210f5d - docs/models/components/listversionsresponsedata.md: - id: 5719195cbd31 - last_write_checksum: sha1:9766c7f1ce51bd6b361baaf7e4acb8e02cccf290 - pristine_git_object: 4da3b6ad8eff4c783448eae89eb654226ce45fc5 + last_write_checksum: sha1:6a0d42593e1c1ecf470c3ed54dca3273f4a210b6 + pristine_git_object: 99147c1aed8ae0711c2c68230aa21934460e2888 + docs/models/components/listappsresponsecursor.md: + id: 6bc6b6706743 + last_write_checksum: sha1:ce39f99729035c93417553c89025f974d69cac26 + pristine_git_object: 93de14540768e09f9bee9a114f80b5ff78f9ef7b + docs/models/components/listdeploymentsresponse.md: + id: bd1553c8e405 + last_write_checksum: sha1:fe988a5676822ca0550ec89afdc02c32ab867252 + pristine_git_object: 2ce25a3965f00243b4af688c24a3c4acf21b68a9 + docs/models/components/listdeploymentsresponsecursor.md: + id: 72a23d339d69 + last_write_checksum: sha1:fbc76ed2adafb8ae4f140f558f0ed1d9365c3f89 + pristine_git_object: 2baeeaa9e59e018cae19f3e683c5a938c1eaddab + docs/models/components/listmanifestsresponse.md: + id: e34a1d20941d + last_write_checksum: sha1:9b080300659d61a4927c24d10824c823f3c32e25 + pristine_git_object: 74d925c603f701c322d13f61da8bac323fbfda61 + docs/models/components/listmanifestsresponsecursor.md: + id: 1c38804b29ff + last_write_checksum: sha1:9c5ccbc84020bab1fa2bdb5243d88a218bfb142e + pristine_git_object: 1c70dee747ef15947f1e33ff8acf6089470f5060 + docs/models/components/listmanifestversionsresponse.md: + id: b038781da9cd + last_write_checksum: sha1:b3307e20a493086cdee8fa6c93f02c1182bc96dd + pristine_git_object: cdfc28ea12871d16b7795ce8c9ec6ea1f7aa81d5 + docs/models/components/listmanifestversionsresponsecursor.md: + id: fb3a70cef30c + last_write_checksum: sha1:2fb9f2d85a37294b80c7fdeefaf42f16cb0f99b4 + pristine_git_object: 3f829a1ddada5fe4626b51a0f0996ba0affe69ce docs/models/components/log.md: id: e1037d748e03 last_write_checksum: sha1:dad2f73e07553382b0ee972eebdb04229160e357 pristine_git_object: 79e08b9c5265af867fa20da18fcdfdf66565238a - docs/models/components/payments.md: - id: 0f85d60a19d0 - last_write_checksum: sha1:70e1b495f105bee819b57e4c02d92dcc5a00581e - pristine_git_object: 2f9fcb618fa0deb1d19b04fe336f528887aff47d - docs/models/components/pool.md: - id: 4b21215a5609 - last_write_checksum: sha1:0ae7cd84b0b077eaf9c6cb779afe88b9d74b740f - pristine_git_object: d9dc49148747feb8c9749b333ce44d6b3eae66fa + docs/models/components/manifest.md: + id: ab82543dfdb2 + last_write_checksum: sha1:4d67f726b6ade8e4aa1882b7881076d1dc7b063d + pristine_git_object: 407cb57380e88a7dc6eda8458d3227847bfaa880 + docs/models/components/manifestresponse.md: + id: 7599449e468c + last_write_checksum: sha1:80cd053266a1bfea9c64302b2bc5aafdbd2b7ea2 + pristine_git_object: 30a0ca2dbd06afc370502ab1d5d4b59d04fbe884 + docs/models/components/manifestversion.md: + id: 2e7a2a66eda5 + last_write_checksum: sha1:642d679209158616f7ddac2023dcddfbea3b9533 + pristine_git_object: 608ea35c773d2b382929c84bd41e199b18c73624 + docs/models/components/manifestversionresponse.md: + id: eb5b04b5ffcd + last_write_checksum: sha1:ab09b1be64e1f96be13d52b60d95cd13c306199d + pristine_git_object: fe14fcbdf85fca4009fceff944c4a6e8899ecbf8 docs/models/components/readlogsresponse.md: id: ec725d9b453a last_write_checksum: sha1:e057941f9e846b32c1f3b7292f0d7ac7f2584d3f pristine_git_object: 01c385db354d9b90ea38b029551a3bbe27ba6415 - docs/models/components/readstateresponse.md: - id: 99c7113e1f4c - last_write_checksum: sha1:921c94e96eca43c892c9990e3e6d29eb46ce388d - pristine_git_object: 9562394d8ff7d2b0aff07a8c5303153ff17d306e docs/models/components/readvariablesresponse.md: id: 9f63356b6b86 - last_write_checksum: sha1:c67b43d758ecd9e97bd4340a2ca74cebded4dd87 - pristine_git_object: dca4b95b3909ea793fc2b288c69e57171bda4224 - docs/models/components/readvariablesresponsedata.md: - id: 40c212b90527 - last_write_checksum: sha1:9a6983e9988c7be9bd5a855648c1562e9f154e0b - pristine_git_object: a8e3d430bcfa588e9f4969e8a8f1ffd24a320a10 - docs/models/components/reconciliation.md: - id: b25325e5d84b - last_write_checksum: sha1:27a055002407b877bb0708ce659d6a248522db08 - pristine_git_object: 2dd49f918f2bc346fdb4ba62022dbe8f578badc1 - docs/models/components/reconciliationledger.md: - id: c9321f8d14a1 - last_write_checksum: sha1:f9a982b46b5c2c95ea6485eaaf3281c663921cf1 - pristine_git_object: 9533b09c1adb569df0a5dcd80e72d4ce6b4abb76 - docs/models/components/reconciliationpolicy.md: - id: 548b47bcf09f - last_write_checksum: sha1:4762e2da2a31d7f533e0fbbf8b06ef2b6679ce96 - pristine_git_object: f27b97c341c1d586b95ba561c7e4c9a4f28ce9fc - docs/models/components/regionselector.md: - id: 9fb20e1b21b3 - last_write_checksum: sha1:077dfd13cc012e65b1c9ffd0b804ab2a2704378f - pristine_git_object: f139fa7441b1a4cbaf814a40a0d0f0211840094a - docs/models/components/run.md: - id: 1e2245374c1c - last_write_checksum: sha1:666fd46a159b439b81770d8cb58d6dc077c052c7 - pristine_git_object: b54edaa2bd58dfff4aeaebdd624f19618ad10699 - docs/models/components/runresponse.md: - id: 8e9357e78010 - last_write_checksum: sha1:5224699dc1b74970f9ab18749048d4f0e00e90a8 - pristine_git_object: cf19aff0640d8665feb362684cbd14dd30c9a377 - docs/models/components/stack.md: - id: 18f72a519773 - last_write_checksum: sha1:35802e911e51cb65f04c564c895b20df0642c991 - pristine_git_object: eba39fffa213e676bb7c5bb994cde0a88956d743 + last_write_checksum: sha1:026fa015644e4bd39562870e963228d7d107da4e + pristine_git_object: 56f1ad49a3904e5588b917c40103f53cb67a0f7e + docs/models/components/readvariablesresponsecursor.md: + id: c616d7701ed2 + last_write_checksum: sha1:d2e6762d758029e501287c6c1b5bbacea874faa3 + pristine_git_object: cc317df08105c5c792ff8f3cd67b5bb1f485bf51 + docs/models/components/security.md: + id: 54906b49ea28 + last_write_checksum: sha1:3d20d8f28e0ecfee6550ce09129b5ec06e25c24d + pristine_git_object: c15c11e5000d4802bfc26a199e249e734ad2b549 docs/models/components/state.md: id: 441de3ea6229 - last_write_checksum: sha1:0ee3cca8c7a402fc1aa36f5e3f8f75d277acc38c - pristine_git_object: 1cf3a814d7870e07ddc02391e6be7ce0c29762c2 - docs/models/components/status.md: - id: e26b2fe7f53e - last_write_checksum: sha1:23037d5370fd37594359b6bc4cbd229ebb6e835c - pristine_git_object: 9ae23ca0fd85cdd4dcf724015cb81376a8fbd990 + last_write_checksum: sha1:2ee342b694271c882a14006f561ea81fc4c7ff3a + pristine_git_object: 4e5096c4a66891a9695900b59c559baeb773d4c1 docs/models/components/updateapprequest.md: id: 405074ca5d37 - last_write_checksum: sha1:879ca1e57318e56d07bb0fbe4cc492a149eb2c63 - pristine_git_object: c5cfdb62650f5deb3940dd5faada77367026b092 - docs/models/components/v2chartaccountmetadata.md: - id: 30177efb9960 - last_write_checksum: sha1:bc449c550971b691e6dbff590bc2e5bb7c2f0b07 - pristine_git_object: 2c764179ae9a1d4b4b247d1d61b22e77cd70842d - docs/models/components/v2chartaccountrules.md: - id: daae4f8233b5 - last_write_checksum: sha1:d169735f4e3fc2f0c9ffbda8814db15a9a255507 - pristine_git_object: b79d01a9c3275be88cd13a8c2a0234a1d138f4dd - docs/models/components/v2chartsegment.md: - id: 2d79094ea76c - last_write_checksum: sha1:bad8f31997ce2908f164c00383facfde50e3ebe2 - pristine_git_object: 7358c3d3eecb1958741aba8f741b56925827bc37 - docs/models/components/v2schemadata.md: - id: 0d905b454527 - last_write_checksum: sha1:3225f89bbe8a8bf5d280132150c2a42dc1186ea4 - pristine_git_object: ace0af48b25768eef6b9580dfbff650cb26c0366 - docs/models/components/v2transactiontemplate.md: - id: cd0d1d22daaa - last_write_checksum: sha1:864fed96d500e443f0cd1bd2e2b8a9ef10ea66be - pristine_git_object: a11f6f3bfb7e38c3310affa8868a461e0a47c2f4 + last_write_checksum: sha1:d184f58db2351ccc0fa24f7a7606d63ec53984d4 + pristine_git_object: 61637f46a88b8bfa9bea421bbfab25668bfa47ea + docs/models/components/updatemanifestrequest.md: + id: 0ba0a64236c1 + last_write_checksum: sha1:ade50162ea19a7b5b5f609cf35b9abe6ccde6823 + pristine_git_object: 2df4cefaf6f3c0196b30afce2d6e1b54f58ea3c8 docs/models/components/variable.md: id: 106f069148a0 - last_write_checksum: sha1:d276aea6e652e1f698b6e21029c0fc0d98874e83 - pristine_git_object: 6fc3df29f3b82591684ed73e4c26c5d0b5c89304 + last_write_checksum: sha1:de4bd21c2646d76e8b1038a16f0d9f6bfa5d6173 + pristine_git_object: 3f697c8284a53ec8c399d5523bf6ccabf68d40c8 docs/models/components/variabledata.md: id: 41fd2f11ae57 - last_write_checksum: sha1:33a510fe028f18cde19f69ada0334cddfdf263a1 - pristine_git_object: e6528690bf3b5e499bccc351abb0657dc36f7b35 - docs/models/components/webhook.md: - id: a698fffd6586 - last_write_checksum: sha1:5f5755013ec2719e06342ff03a4e9fc5edbb6437 - pristine_git_object: 32e7fd8559f5ee52aef65d094b49044d3b813715 + last_write_checksum: sha1:3bee0384908c2d2164659d7f4a4b803c0c65cf43 + pristine_git_object: 42c414ca2c7efc9262ce82ee3bc8950191300beb + docs/models/operations/attachappmanifestrequest.md: + id: accaf996506a + last_write_checksum: sha1:e0fa8acf1f13cca121733c69619da7ecf6e00611 + pristine_git_object: 9a803bad8e5ea48b6f6ab281ff6ab182cd44f3cd + docs/models/operations/attachappmanifestresponse.md: + id: 60fe275da864 + last_write_checksum: sha1:545bf3c1ccba5638f97fc59967750e54ae3d85a5 + pristine_git_object: 58ad5c5b9c63d7332f56b467e26199517bccefce docs/models/operations/createappresponse.md: id: 06821c964f8b last_write_checksum: sha1:357317e66e4b7703f26de3777fc0e3438b520cf6 @@ -247,14 +240,38 @@ trackedFiles: id: c22ab459449d last_write_checksum: sha1:2997e3902e9b95ad72de1a228b189e7e4256801c pristine_git_object: 07452bcd2cc549c56e03ecc0d7cb3331351df8f9 + docs/models/operations/createdeploymentresponse.md: + id: 0ca0d30ebb83 + last_write_checksum: sha1:02db410d2fb68c69402305bc027eab8144a2652a + pristine_git_object: d6be343012c94546e5b4c47fe8a3820c0b71a52a + docs/models/operations/createmanifestrawrequest.md: + id: 9c0f7a9c45fc + last_write_checksum: sha1:732932b84bc2d28c88611a5d7ed9381cebeaa2f2 + pristine_git_object: dc7c3123dab32b7844747a39751fa55d43ed89fc + docs/models/operations/createmanifestrawresponse.md: + id: 9f74a7d48f44 + last_write_checksum: sha1:f19aecd730aa1dd6c522ef982d39767ee80014d0 + pristine_git_object: 3e8b398ef51b79f60250ec70fea3fcd418fa90fd + docs/models/operations/createmanifestrequest.md: + id: 00ac20b869e1 + last_write_checksum: sha1:2e580919ecea521706c39ee6ce9aae20adb7f5f9 + pristine_git_object: 319e78b7389b1fe271cf69793eb1c49ef82cfabf + docs/models/operations/createmanifestrequestbody.md: + id: be4690911b9f + last_write_checksum: sha1:a28556106cd526daf14d0784468bd8deefca9c40 + pristine_git_object: 6089e69cc8f0bacf3e67cc1de9cd7227122bb7fa + docs/models/operations/createmanifestresponse.md: + id: a7e3bf8362e6 + last_write_checksum: sha1:9de86374ce0bfe849f090c0ed0c309554ce7ce3f + pristine_git_object: ea064c638fde2204a9e737ad9cb60f93390fe312 docs/models/operations/deleteapprequest.md: id: 2514a7504692 - last_write_checksum: sha1:6cb69f5042032d8061fa797e849c73f8945fe8ca - pristine_git_object: 316a4d8dd4455343e4551aecfc3deb24f8f80dcb + last_write_checksum: sha1:67156c64d8b1f95a5d59d8cf8bcab03ea82a423c + pristine_git_object: 63b4b8ba5e61e302f3b4a340752b7eb529257a65 docs/models/operations/deleteappresponse.md: id: e16e7da4c1e7 - last_write_checksum: sha1:27ad8ba2d9831e1ee63c2bc391225189ee55be88 - pristine_git_object: 5363fdba467d79ec2878085f05a04b9606522471 + last_write_checksum: sha1:bc431ecccceaf41b362bbaccda94309ddce19a49 + pristine_git_object: 41ecd5c7e2d96668e50cd25dbcb3bbd45bbf58b3 docs/models/operations/deleteappvariablerequest.md: id: 43f868ba1805 last_write_checksum: sha1:1cdd03262fe383836802771ed64728f8a2992a0a @@ -263,126 +280,134 @@ trackedFiles: id: dcb2ef841938 last_write_checksum: sha1:d0801eb3f8fb163d540d5bffb917a9942ce707e2 pristine_git_object: 6a2eb11056337dcb97c23a79ae38149d6e85fab8 - docs/models/operations/deployappconfigurationrawrequest.md: - id: cd0d8954ada3 - last_write_checksum: sha1:0cd7533d820573cb290f91ae4b557bee5756e49f - pristine_git_object: 1fff1b332771b40a0fccb646bec5dd89ce4e5537 - docs/models/operations/deployappconfigurationrawresponse.md: - id: 4914a94f8820 - last_write_checksum: sha1:3a0247f3bc8058126adc6d3adfc1e2e821b6d329 - pristine_git_object: 904ecb0a001344fae56640750d1747f0d90b1431 - docs/models/operations/deployappconfigurationrequest.md: - id: ffb4a188e86d - last_write_checksum: sha1:d1e37c37b0786473a7905cde2bfd14470336fa02 - pristine_git_object: ed26f2936fcbd5bd8d5fe221f2f29dad1c8dad8d - docs/models/operations/deployappconfigurationresponse.md: - id: 5e79df6fc3f3 - last_write_checksum: sha1:c0a96e35ec668fd1a50e00b5a71b150365e377d2 - pristine_git_object: 46edd9bcfcd05a6f1a3e3c6e2915f858f6c6bd63 - docs/models/operations/from.md: - id: b0ad40ce8637 - last_write_checksum: sha1:fdec59c47c541cc589e85734bfa5fe690e4e3db8 - pristine_git_object: c334a966500e44a574bb1b4c729ea2186b9295f7 + docs/models/operations/deletemanifestrequest.md: + id: b942f2d5560f + last_write_checksum: sha1:183ec89c4a6143c58cf43fe71043102c4d379a21 + pristine_git_object: 26341ed15996027d533febb5984e8a67263a4379 + docs/models/operations/deletemanifestresponse.md: + id: 7b9e8dfc4e3e + last_write_checksum: sha1:aec0c2e4f2c0be4ebedd4a65d1ae968b9fb4f753 + pristine_git_object: e8a81fae4aab84de1a75fff7223f70da5d88c2d9 + docs/models/operations/detachappmanifestrequest.md: + id: da916e1cfe7c + last_write_checksum: sha1:87897e24e0e18511163a5fb3594b795f16e54d57 + pristine_git_object: d11d0dba181909c1e06c00f4e1b2e32a5b592ba9 + docs/models/operations/detachappmanifestresponse.md: + id: eb6aafbf031b + last_write_checksum: sha1:6c93f0e8f124c89d0d547e20bc157302362f0a78 + pristine_git_object: fbbd1f5af2d20d35ab0340f38e562d06e7535de5 docs/models/operations/listappsrequest.md: id: 5efe8d3cde07 - last_write_checksum: sha1:caace7e250df2baa4ba49427a303601c7316f1dd - pristine_git_object: 3316363e3d0cd6ceb212b81c611cf03bf12d7f67 + last_write_checksum: sha1:49ea7178bb417c38ef42fff76eadaf3b7c6196af + pristine_git_object: 11c97674a4850750238e4289aa0123be54e62e41 docs/models/operations/listappsresponse.md: id: 2c4aaa805a52 last_write_checksum: sha1:54f047b67d567b402899316ba8dc2bae26889df4 pristine_git_object: 4da0499356a0ebed5078ddfcfb4d5541fb92b223 + docs/models/operations/listdeploymentsrequest.md: + id: 854523666c28 + last_write_checksum: sha1:2c10dfce2cef861a1f47529ecfcfef2a0f6705c7 + pristine_git_object: 2ee05d5a47d284e7b92a7f5461535d6443667497 + docs/models/operations/listdeploymentsresponse.md: + id: b3b1e4f8a3b8 + last_write_checksum: sha1:cfcd3928517093a37efd9602f83e8f7020a69599 + pristine_git_object: cc0444002ab9aa126d0cb3dc0eba3c4484128915 + docs/models/operations/listmanifestsrequest.md: + id: 62d8ae59d357 + last_write_checksum: sha1:3b0bfaa2615048d562d456c5a68b1e8421a97126 + pristine_git_object: 115e9ccbd785dd20b080b0de6c4d50f5b8452c08 + docs/models/operations/listmanifestsresponse.md: + id: 44929c2f905b + last_write_checksum: sha1:c6302e89d1e353c091cde1af1e9c2dabb23565c1 + pristine_git_object: 7bb7f793707b0d54e26d1747901606391fb28594 + docs/models/operations/listmanifestversionsrequest.md: + id: 533cb7d27434 + last_write_checksum: sha1:c204e7d33a6d5a69ea2a02fe0a3ffac4c49cb8fb + pristine_git_object: 7200d26c456ccd8efdb814af8f6c4853281d26c8 + docs/models/operations/listmanifestversionsresponse.md: + id: dc6be6e3c23d + last_write_checksum: sha1:d6a291ff40460b4d23cf3a7f68f5c2fb564db1ca + pristine_git_object: 0349721934edc32307e5285695b66d17c340872f docs/models/operations/option.md: id: 2ac1bd52a5fb - last_write_checksum: sha1:bcfbc3cd4a67cf8c276f1508b8ffee0ee5bb45ad - pristine_git_object: fe22ef08c679fa6cf8f70c453405db97a3e73c80 - docs/models/operations/readappcurrentstateversionrequest.md: - id: ec5736e4b230 - last_write_checksum: sha1:32e4deb3613cd9d1335ca4550012fa166ae4ce14 - pristine_git_object: d505e3a111d79bc8dd96f7ce86a92de4b02e7638 - docs/models/operations/readappcurrentstateversionresponse.md: - id: 7f46e9d1315e - last_write_checksum: sha1:d67508acd7fc69f8ed14ce8a06516abb6abe7bb5 - pristine_git_object: f2b7ce5e4cc8909de15d85e3f3eb249beeb34434 + last_write_checksum: sha1:793ef6714c6322eff196c44264b5308c9964083a + pristine_git_object: c511959bfd8c5137c45a023323a0bb6774d6dc5e + docs/models/operations/pushmanifestversionrawrequest.md: + id: fc1c2faac987 + last_write_checksum: sha1:f404defcc70c8b6dcb819dfbb63cadaf5dbc4809 + pristine_git_object: a21204cf28b22c88657a4fdabd6d2c1849a7550b + docs/models/operations/pushmanifestversionrawresponse.md: + id: 8e19d2bbdebe + last_write_checksum: sha1:42c73736637c6253ea33c10626d81a9d8f19868c + pristine_git_object: 0985bb7c163ae85312c2176af9982e25729649fc + docs/models/operations/pushmanifestversionrequest.md: + id: 0e437a001784 + last_write_checksum: sha1:10b1465859520d840ff12e567f335fae3d33568f + pristine_git_object: dd1aab9d8253114ab284118c8357803585af63a0 + docs/models/operations/pushmanifestversionrequestbody.md: + id: 529bf30dc215 + last_write_checksum: sha1:4098dfb2722b817a742dc8333b495b98314b9248 + pristine_git_object: 520019e88698de4b25bd9771b104c24bb6e550bb + docs/models/operations/pushmanifestversionresponse.md: + id: 6d1d879fcf12 + last_write_checksum: sha1:27da301023e0c55b1316194a4d94dfbe23be4e61 + pristine_git_object: f1e2e08b597fa4fd9248907d8f63e4fd0bcee1ec + docs/models/operations/readappinclude.md: + id: 666467dbec9f + last_write_checksum: sha1:73d9cf6affda33099b60084d2bb8fde31e13360e + pristine_git_object: 5f20740f220a8cd1fef84fb55deffc75635e0028 docs/models/operations/readapprequest.md: id: 87dd15e3966c - last_write_checksum: sha1:f4680b3cbb6e1110d079c97bddd428ea7d7191c5 - pristine_git_object: 7469fa0524b7317076cc1bc88f6e053cbce9feed + last_write_checksum: sha1:f06192b275e2605eed7e8a9cfc5a4936cb3e9a57 + pristine_git_object: c7041dc275a848564191df13f13b66dab150df88 docs/models/operations/readappresponse.md: id: 516dad5c8317 last_write_checksum: sha1:40f059afc4ded4284b1318ea86c9d6ed9d281d25 pristine_git_object: b82b6c789db1b0f67fd3770e7d9c8c8b0ff4d41f - docs/models/operations/readapprunsrequest.md: - id: eaed81d4d43b - last_write_checksum: sha1:31ca3b7a8cc9b55a9a569f8457a8933f9dc51207 - pristine_git_object: 9dfaf1fee1ef62bef1d46faefcd2058851498554 - docs/models/operations/readapprunsresponse.md: - id: 5e7acaae3161 - last_write_checksum: sha1:79ae975345fc9538c6c1d09e299dd743a7f60398 - pristine_git_object: 05a91a03bfc133a3a18a96c4624aa0291268bf7c docs/models/operations/readappvariablesrequest.md: id: da8db5c99ce3 - last_write_checksum: sha1:97fa68ea5d6123afe24cb000390c8c062ac9fb24 - pristine_git_object: 997f2a80d7aff419cd28e0b40c9fe53696dd43e5 + last_write_checksum: sha1:766d739b4937a12f7a7000a5642fc70bc56ca823 + pristine_git_object: 369da6d9afadac57f1464c55735b4bc37ece2644 docs/models/operations/readappvariablesresponse.md: id: cd4942c5e28a last_write_checksum: sha1:3a9135c3914273ff65e2771e62c72eb0d2702d4a pristine_git_object: 4a2ae584cc7fc046ea3eead91bf6bcfcb2bed3e0 - docs/models/operations/readappversionsrequest.md: - id: bd385dc662eb - last_write_checksum: sha1:cadaac5bfb90ffe103c49e0ea6ca53ff7c5d6d62 - pristine_git_object: 0f9658ff5492f6e9354e6fde1ba1a55b7ddb1ce4 - docs/models/operations/readappversionsresponse.md: - id: 8fe77b5a5bb2 - last_write_checksum: sha1:aeceb78d90617cb7fa775051feb5cfc44569cf9f - pristine_git_object: 6ed33516e7cb048e9279a8073f1b25128070d7fa - docs/models/operations/readcurrentappversionrequest.md: - id: f7bd5b77f296 - last_write_checksum: sha1:3faa1a021b786eaec214c45c2ab0dd4f30eec2aa - pristine_git_object: 21483ef36d7aac60265162643f4ac754a21c8aaf - docs/models/operations/readcurrentappversionresponse.md: - id: cd1a671347dd - last_write_checksum: sha1:9ca5f7e157cd6f76725ac45549de2f05a48c0150 - pristine_git_object: beb7ed138889336f7545f2f93def8ea6e0ef4835 - docs/models/operations/readcurrentrunlogsrequest.md: - id: 981e24d0a502 - last_write_checksum: sha1:7ec962d5a3d71473202ed5de0ac8ec4e23f6dd96 - pristine_git_object: db1a51bf1e72e755c637fa12087db89d46e74226 - docs/models/operations/readcurrentrunlogsresponse.md: - id: 0a2865b9ad10 - last_write_checksum: sha1:c278e8dbfddb9a2220af33436551d2d05cc72a77 - pristine_git_object: 5bd0e6e8ffb3954e3d0d8a6b1af66ef1c62877f9 - docs/models/operations/readcurrentrunrequest.md: - id: 60f964a0a446 - last_write_checksum: sha1:63a01df943dd195ec462ed25e5b91eb4a2e9cd85 - pristine_git_object: 70e92fc2cbbaed3c988b7e5cd5d9167fb472f971 - docs/models/operations/readcurrentrunresponse.md: - id: 83ad8dead255 - last_write_checksum: sha1:ef7881e6c7df498fc6d352870ff34565696bc3fa - pristine_git_object: f7baf2fd2fcff15eea7d6ed2cdba94f7b2f8c1f8 - docs/models/operations/readrunlogsrequest.md: - id: db04c3bed80c - last_write_checksum: sha1:51b4f59c18598a6fab9c9652c9f4844b79e5f50c - pristine_git_object: 38e600c061aafb0e03d5dbc4c14d2bd703912216 - docs/models/operations/readrunlogsresponse.md: - id: 65ad7202de96 - last_write_checksum: sha1:8dcbc1c3a959365ef03495f9e3245b0589acd0c3 - pristine_git_object: bfe621a3db828b6666480e45116d47e9e3dbd195 - docs/models/operations/readrunrequest.md: - id: d5c426ed1f09 - last_write_checksum: sha1:12f7cd2c696a18ab75d909b69fa4e76a0211e4c5 - pristine_git_object: 70575144f3b6e1c15fbfaa1da5f66ffaaf70e138 - docs/models/operations/readrunresponse.md: - id: d38daacb1f09 - last_write_checksum: sha1:8a9336fdf077798032f8dff0f6c9a7550858542e - pristine_git_object: dda5599544bf8b4a35a9f9cc9f831a424c11a100 - docs/models/operations/readversionrequest.md: - id: 4861c19d0c9e - last_write_checksum: sha1:61bc360b2a5a9d5b6c3e44d635860029848c0a21 - pristine_git_object: 30c9ea77d620b87d1228a45fa1aa3f9ccba1ef6e - docs/models/operations/readversionresponse.md: - id: e9a7ce2fd847 - last_write_checksum: sha1:f4ef97789ad28df757c8181b43e22c326f6415c7 - pristine_git_object: af15e4fc987c0cfb6f41fc0d6cb509e180918338 + docs/models/operations/readdeploymentinclude.md: + id: 39b2bf052792 + last_write_checksum: sha1:ea03ce02fe35923c87f3253b0136137259b437b2 + pristine_git_object: 9f5f178921aeaadbe2f04e95347bf6ab8db0ca3e + docs/models/operations/readdeploymentlogsrequest.md: + id: 5ee7d0e5cf67 + last_write_checksum: sha1:d1a47b6ad4adf2c026faa535d14c024d67a29da1 + pristine_git_object: f028eaba2b067fac8e59bf80366fc37d0b94494e + docs/models/operations/readdeploymentlogsresponse.md: + id: 12268f3fcdce + last_write_checksum: sha1:968b5d645086cd919249dcc7400e82fa673d2447 + pristine_git_object: 1388ac812646ffadd823d1bb11cfc4c2228b4499 + docs/models/operations/readdeploymentrequest.md: + id: 5b96618f6491 + last_write_checksum: sha1:f932ac8efa6ab8c6e94b7c7259db7f2e6bc21ccb + pristine_git_object: 52c58dbb080c6b57f9f934b3b9f1b5246dae8a12 + docs/models/operations/readdeploymentresponse.md: + id: 9d554c8b4f05 + last_write_checksum: sha1:f8d04a1190c995c546fdb31768af93a57352cb8a + pristine_git_object: d63d2c3b071efcc7abec7d59dc28efb0e872e16c + docs/models/operations/readmanifestrequest.md: + id: 91ea98d58795 + last_write_checksum: sha1:16551ee11c5cc18db61ef5bace565840261c9273 + pristine_git_object: d785ed1deea75440082ca954b41e068c5ceaa1d8 + docs/models/operations/readmanifestresponse.md: + id: e1d36c0ae15b + last_write_checksum: sha1:b064540fc256982901c12ef85b9ed8f31e16a7ff + pristine_git_object: f6626bd62e5da14e7dcb72b103e323163fa701f0 + docs/models/operations/readmanifestversionrequest.md: + id: fc96d48d85b9 + last_write_checksum: sha1:00bbd804dbee924382ff97c7f7322961cc51e081 + pristine_git_object: f917413f9384e49e31c840f4921d7ca1b7febe6c + docs/models/operations/readmanifestversionresponse.md: + id: ef7853e4d9d6 + last_write_checksum: sha1:8d353448be94ec6c8c03eb021d351ef4d7dffcca + pristine_git_object: 616ab664638b0561a50a445ac7e012b863a8bf93 docs/models/operations/updateapprequest.md: id: 8a75849387c1 last_write_checksum: sha1:7783b8e18a82e7c2ff9fb2a6ee76b3d125cbab59 @@ -391,18 +416,26 @@ trackedFiles: id: 7b8b6323a779 last_write_checksum: sha1:7d2496e58922053f42abccddb3059ab263e527cc pristine_git_object: bd285862f57bdb86d2b5b56fc222a50516ae07cf + docs/models/operations/updatemanifestrequest.md: + id: f6bf88efcf70 + last_write_checksum: sha1:ab86b7f6b4de5139ec8c707cab821f7c5b56ae4a + pristine_git_object: 0d35f2859440fe6172137d10e6f98833e47ee089 + docs/models/operations/updatemanifestresponse.md: + id: f12a75675f76 + last_write_checksum: sha1:5effe289f872924e6ad0b6c32651c1fdd28acd31 + pristine_git_object: f8b0e9ef7ee64c5c8ade8601fac272aa7909171e docs/sdks/deployserver/README.md: id: 7bbb48696892 - last_write_checksum: sha1:bcecd7f77afaf4734638b474791a0e3ce18ed641 - pristine_git_object: a0e239dc86da0b4cb1ff2e8af7f68d405c19e98e + last_write_checksum: sha1:4962abdafa3760f7c2297262c42de8a81b81df50 + pristine_git_object: 38b6bb51ec82a6ebea63740d05b607e4e0a166d1 go.mod: id: c47645c391ad last_write_checksum: sha1:ccfac949478bd60fae3010350a17ef6c9e8580bf pristine_git_object: 3189bf069eaf8dfb9018c4b403d2ff4a7e33e9c6 internal/config/sdkconfiguration.go: id: 33b8bfac5265 - last_write_checksum: sha1:78dca4bf8f1816129071559aa9e304c5331f3e19 - pristine_git_object: e0e5bebf73a006dfe3891faac24c6321653b1011 + last_write_checksum: sha1:5148d0658d626b9af95c22141725e94da07f0f47 + pristine_git_object: dd5ad42c3fbdc6e1e0178a0ab23baccf18594caf internal/hooks/hooks.go: id: 336be70ed5c0 last_write_checksum: sha1:93d4659d008e4af51582e5407bae6307cdfa6cc5 @@ -463,30 +496,42 @@ trackedFiles: id: 4cecf27a5a54 last_write_checksum: sha1:381f21ea747ea015453c234c9489aca812e139f2 pristine_git_object: 7974d2a957da853ba871dec5f8b55062e1b6debf + models/apierrors/error.go: + id: 4b4731adf85f + last_write_checksum: sha1:7c904184238189b67c0dc9d852485fa69c993179 + pristine_git_object: 3216263c45c4b5e21766a1f164f0c0a94e1ca931 models/components/app.go: id: 9c69c824fb8f - last_write_checksum: sha1:e4560a1b1c9d492ff4f972d0e8846c1026b80198 - pristine_git_object: f3a2dfe0e05f0521834208de00d6f5df1a7361b8 - models/components/application.go: - id: d580034bf8ac - last_write_checksum: sha1:588ec17f546bb3b2a64ddafaabc67c7389317f6a - pristine_git_object: f930a1c1f6b105437c5da087e0fc71663ce04ad0 + last_write_checksum: sha1:19773356001a79743a8aaa9c42fcfc9e283763cb + pristine_git_object: c56bdf01391c69b0faeac68369ed73192c7c2ff6 + models/components/appcurrentmanifest.go: + id: 8052b72ab148 + last_write_checksum: sha1:886ddb12506c04280fe6a959e701be6dbd0190d9 + pristine_git_object: e7de2cd99ecf7a2c3451a510da437df6284366bc + models/components/appmanifestdivergence.go: + id: f3524b0e65be + last_write_checksum: sha1:6820083fcaa959ea751921818eb136fb78401bc6 + pristine_git_object: c9e0e72241330906811efd220382e376424ab2ce models/components/appresponse.go: id: b25e95988f98 last_write_checksum: sha1:1bfd097001d33ab7ee59f46af273f580d59d1c58 pristine_git_object: 33edf7fbf66a033955dd4f47651babc06bb5426e - models/components/appversionresponse.go: - id: 2ce94b612933 - last_write_checksum: sha1:cd9055e06058113484b8bef88cde2f54c3b55ff1 - pristine_git_object: 8f5e9ef5424dcb4545a28a12d5fc72431353af4f - models/components/configurationversion.go: - id: a3c0a1673901 - last_write_checksum: sha1:3aa5ffea828eea3e96d799bfb779327001d7b7de - pristine_git_object: 6656d87459dcc258acedfd1584d54f9a06e16d26 + models/components/attachmanifestrequest.go: + id: 2175c8772b17 + last_write_checksum: sha1:f32d443b94b064b6ffe062b31e15175b9e88039b + pristine_git_object: 5cab118b3eaae9365d6aa54a3c59795298d1af6f models/components/createapprequest.go: id: 0af34a35e29f - last_write_checksum: sha1:0216d9edfcaf7adeee62ec15bef1c7e81fa899aa - pristine_git_object: b79eeb0c171af1cd1e68c1c1dd10fe071fd314ae + last_write_checksum: sha1:40d84c521b00da93908a60a88a094512e2e41518 + pristine_git_object: f8efe94841634e24768fea038a35454ac212c0b9 + models/components/createdeploymentrequest.go: + id: 22e94762a36e + last_write_checksum: sha1:0ee39822c8c00037ef6b5dc67a942cd021b667c1 + pristine_git_object: 9b4eaf86f0894bae0c59ec8ab1e0e5a649704373 + models/components/createmanifestresponse.go: + id: 8a09822d66c1 + last_write_checksum: sha1:8e149a11b813c92ff2bba317811620710212b73c + pristine_git_object: 4b428503db65fec8cab6373f85846d706290af18 models/components/createvariablerequest.go: id: 488ed9ed73b4 last_write_checksum: sha1:6dad11fecda3f9df54a90dc5bda33496c7ee5904 @@ -495,10 +540,18 @@ trackedFiles: id: 00d4e6ccb333 last_write_checksum: sha1:5ebf70f308832820ee08a1e7085a783eab30424b pristine_git_object: 8486f09e0ef6802ab6c10d0d0e2d0f2642166964 - models/components/dotself.go: - id: 2870397074a5 - last_write_checksum: sha1:8c6f6c7178872661af9a3908b4e413917c1dab8b - pristine_git_object: 9df4ab4af760098baa5f452b73d9099229473d1f + models/components/deleteappresponse.go: + id: 0868463bc266 + last_write_checksum: sha1:2ad3379899c1656abc7825ce3f4c5f9b036577b4 + pristine_git_object: 4d77c78bc89cf176ec99686845a78ddc8fb5ca09 + models/components/deploymentresource.go: + id: 07bccccda991 + last_write_checksum: sha1:136b0d400ed8449c2f2262aae284c64cff09dec1 + pristine_git_object: eae7f8194e8ba50afe273f2887f7d7ea65c32c7b + models/components/deploymentresponse.go: + id: cec4476a3fd8 + last_write_checksum: sha1:3873e3a69107cbb82efbb1ea5f8a0fa5d3f6ac53 + pristine_git_object: e3b7e32d22573b892fcaf72e3512de9b7b0633b5 models/components/error.go: id: 101a721ad2e7 last_write_checksum: sha1:8a2878902488471c0f5886173385bd1762127780 @@ -507,114 +560,78 @@ trackedFiles: id: 790bad4a7abb last_write_checksum: sha1:0198fe52c644528e0ca265e95166b296b70632b4 pristine_git_object: 49b58c940ad027f8d35deb3d19a3f3ba60176296 - models/components/ledger.go: - id: 1ca559704974 - last_write_checksum: sha1:66bc8e24f5e8de909858722988f8332b0c65a1b6 - pristine_git_object: b5768087b0289314bee2c605be653e7eaae32933 models/components/listappsresponse.go: id: be17d7d20579 - last_write_checksum: sha1:a5cdc883a1b98de7a257180c85edf40eee182832 - pristine_git_object: d91d6e67015ebe40d2d954db984479c2a8957e40 - models/components/listrunsresponse.go: - id: b3658a3c6330 - last_write_checksum: sha1:e88064f4458ce157a6256cf65a8c286aa02cadc7 - pristine_git_object: 820942867f6ed998d7d33767ca888525bb067fae - models/components/listversionsresponse.go: - id: 02d59f99a3a6 - last_write_checksum: sha1:90b23facbd89f0865eef2d70ce8e46b9a4a9fc85 - pristine_git_object: db62864a451f20bd800172f1ab31c305ee78ff33 + last_write_checksum: sha1:c8bb7e6297ff5f98a24d11a4c9d6f6e675f761b1 + pristine_git_object: b8eb4b25a70be893ef001bab31edbcea8f76a0b9 + models/components/listdeploymentsresponse.go: + id: c81969fa6fd8 + last_write_checksum: sha1:7f06de75b63c0bf64f6b8f3ae2a8fc5bc7377a7f + pristine_git_object: e6a145155b7c09fe9bc7673c7442ca5958803f0b + models/components/listmanifestsresponse.go: + id: 8ed2ba8f477d + last_write_checksum: sha1:cdedc173f1a1e1b78fd80bfaa543972fd92acd4e + pristine_git_object: 2911e50d8636088d2ec723eefe60d3e6b0d15a3b + models/components/listmanifestversionsresponse.go: + id: a74974d4f433 + last_write_checksum: sha1:3ca1a53dd15f4a29113cfb40ea3e4172dcb03547 + pristine_git_object: 6d02f172080fe8850c0ee12fb742387e54c84838 models/components/log.go: id: "076958063552" last_write_checksum: sha1:08f93eab2190052f9affb791dbc491700485388a pristine_git_object: 014faaf92105efcd6b6f480bbeeaa978cd0f7523 - models/components/payments.go: - id: ab1f954b82e7 - last_write_checksum: sha1:afee9eb6d1f645ff7b515b33b5a93f75d17e88ea - pristine_git_object: 7d1b67c94e0c6956220d907a618ddcf496053889 - models/components/pool.go: - id: 69c6fc9f4f70 - last_write_checksum: sha1:ed9a147447d691e540acaaef188515f7ca5ab9ea - pristine_git_object: 46ae746be9782f84e2a2a5a0b7ee28ec8c452818 + models/components/manifest.go: + id: dc929f032587 + last_write_checksum: sha1:71633d7a4eeb86321447026ea3c0d19c81cbdbcb + pristine_git_object: 5057e76370454b97d069e8facc3c5ae2c10a7cdf + models/components/manifestresponse.go: + id: 826d316fa365 + last_write_checksum: sha1:3772dc6ac0335e105bb5c2c3cb798e7aec4e5869 + pristine_git_object: 9e92054721ca35d11dc54993d7e0282fb5e24d7e + models/components/manifestversion.go: + id: ebe526a37dd8 + last_write_checksum: sha1:d2cfcd1b2bf002488b3e38e3f12fa6bfc872c5e7 + pristine_git_object: 0344b172778559a0c1161794d0923b6ef9c955e7 + models/components/manifestversionresponse.go: + id: 30f8a7e13cc2 + last_write_checksum: sha1:6241b4f37a61256bda363111b331e36afc1e0d8f + pristine_git_object: 80e366ca2043ac7158c75269942f9da54943f81c models/components/readlogsresponse.go: id: 90e15a603a44 last_write_checksum: sha1:3cdcbe5ac1e537507ccdc81ec71bef53b0384af0 pristine_git_object: f2d84592e4c2946e92abf391eb06ac2b96015e88 - models/components/readstateresponse.go: - id: ea64d8eddf42 - last_write_checksum: sha1:ffe869d24398ffac7d912a5afddd0e5c82c41231 - pristine_git_object: 06c746db256bf6b78b34ff83cdfd312e192bf116 models/components/readvariablesresponse.go: id: 4b628607f38f - last_write_checksum: sha1:50bba846aa0abff0cb644aa6ed9b740100682056 - pristine_git_object: f9f233b9b95f0afdaed6dd01a365a53d08592beb - models/components/reconciliation.go: - id: 2c4e0d680f89 - last_write_checksum: sha1:f1d084830097699c8fc24e30a3f579ecdbf512c7 - pristine_git_object: c14e11f6892e1de548af7da7f209ae22c62ecf6b - models/components/reconciliationledger.go: - id: c241d7b93183 - last_write_checksum: sha1:45cd258615b495465c4fe1816b0dd9fc8241e91f - pristine_git_object: 2d622c1a0503c10b0262e26fad4cf7baedce94f6 - models/components/reconciliationpolicy.go: - id: 6d3725c7413c - last_write_checksum: sha1:8280ec6c56c69e241ddf36a252341759f08945b8 - pristine_git_object: b8151f03f6d912769917c905544541c456651ed9 - models/components/regionselector.go: - id: 872366f5702f - last_write_checksum: sha1:d8aad9a68637751cb99dea0be39b0d591b8a76ba - pristine_git_object: 063b9bf2b7412eada2b5c8371afd85018090b088 - models/components/run.go: - id: fba5506d7291 - last_write_checksum: sha1:c9b714f833faefeb359edd275cdad799c69ceda5 - pristine_git_object: 8ecf58a560b63bed0ac54fe73d66f2542bb587d1 - models/components/runresponse.go: - id: 827c0fdb42de - last_write_checksum: sha1:dcdfbfec91d8e01065dd22b851b657ddea4404e6 - pristine_git_object: fd89b6396527c112b4a9bb20cf8d901f6d18e719 - models/components/stack.go: - id: 6a5465dead58 - last_write_checksum: sha1:ecbd1fc7e87484150938d58e50d1b456cfc03e47 - pristine_git_object: 002a18dba3348c8d9286feb9b8b1ae35744a6a25 + last_write_checksum: sha1:6cc3d29087b54bfc47bd5646b81892b0fee333ec + pristine_git_object: c707e31ef6e66e4dc88bc89d753d4bb528ae90d3 + models/components/security.go: + id: 3a5eba5fe9e0 + last_write_checksum: sha1:9a146f6b93f07556ac125224448fd06ecdb5cea6 + pristine_git_object: 5f41eea61eac2527fff133f9516135b8ff70fda8 models/components/state.go: id: cb569493a6e4 - last_write_checksum: sha1:2960474737e42f46e1f67bcec0a98270babbeaaf - pristine_git_object: 36d6cfe58680824e3652028111ecb28913a98af2 + last_write_checksum: sha1:c332a3b170a8c5876f68a10dc91a0f973077e5a6 + pristine_git_object: 4a14aefd93ad5cea5b2179c40422db51de1dc8d5 models/components/updateapprequest.go: id: 02e323c36bcb - last_write_checksum: sha1:041547ffed28841a99b7e6bfdea8526f1d220209 - pristine_git_object: c7a05a2d23d7aac465ef93ecfd2b54df73c5c357 - models/components/v2chartaccountmetadata.go: - id: f16fa72ee560 - last_write_checksum: sha1:cb34c9960bf8c40aeb11ecf84f53c4b032117b4a - pristine_git_object: 86a7afa2b5a12868fbc20ae2c6979a2d39dcc38a - models/components/v2chartaccountrules.go: - id: eac3f974ccff - last_write_checksum: sha1:cfc0ba427e8c195af03757ccc72b4342b39b9b78 - pristine_git_object: 76ccec55ba08e20262e9e152475e4a8019b7a7bf - models/components/v2chartsegment.go: - id: 24b4ec7ee8ba - last_write_checksum: sha1:2a33bc69f1d7931f0e0f8ca57b2b06d946f7b7f9 - pristine_git_object: 5ea894482e16dddccf721148c52ec2ec91f8ce1d - models/components/v2schemadata.go: - id: b831e5ad9a8d - last_write_checksum: sha1:d05f8ef7fca18bd4b9ec40d2be549142583c0b22 - pristine_git_object: 7568060234562456795dfa8eee587f6c4e20ecf6 - models/components/v2transactiontemplate.go: - id: e60dda03c1e6 - last_write_checksum: sha1:6aa4488434b226a98b6d6a644002f4802060771d - pristine_git_object: 7222da99066bb531d3f2f477cf21fa3e596454b4 + last_write_checksum: sha1:ef3cc70fe08244f4ebb38742e2086444ac1a67ba + pristine_git_object: 7045a1fba0e3d8531d9773aab4ed0f4689360ee7 + models/components/updatemanifestrequest.go: + id: 2528e271ad88 + last_write_checksum: sha1:86c356f8e623c2092f1788a28e6e963199e5dd08 + pristine_git_object: 8cd2a3858debf89dd5f196c2e7b9750f612f743f models/components/variable.go: id: 37684cf48fa4 - last_write_checksum: sha1:716bdab940d9e74422327c676089410b483b134b - pristine_git_object: 839f2ea73f0755547ba0b11174f7263e98ba0b87 + last_write_checksum: sha1:9ce7b2c7c01aca7fd5c98eca565bac207df545dc + pristine_git_object: b0a97d2aff52f8d3699740708cac0ca873d2884b models/components/variabledata.go: id: c47e6d6b22e2 - last_write_checksum: sha1:f18eaccc07eb9c59c6ac2b573d680b09115ec673 - pristine_git_object: 9ca7263b061adcb74269a1b7e1738febe66142dc - models/components/webhook.go: - id: d10a35a35a34 - last_write_checksum: sha1:1ceedf3aba089fed66daf2adb66e290951f52cb5 - pristine_git_object: 7e4989592ee33f5f18577a0268fcedbe3143e596 + last_write_checksum: sha1:0fb69cbceb89a1528bf9ad2168bb6045ebcc8f58 + pristine_git_object: b1cfac06d51033bfc683bf8f720d08bd6a8418e2 + models/operations/attachappmanifest.go: + id: 1b3eab4170c4 + last_write_checksum: sha1:b608954727c46e4af9e438e30b82a3b17733dda6 + pristine_git_object: 5833ba6a813271ecc395ee3fd5b76d353b122df2 models/operations/createapp.go: id: 5854dfd707b5 last_write_checksum: sha1:662f38efed6fcd5a485f124d983815d71c5b0aae @@ -623,78 +640,94 @@ trackedFiles: id: 23dce5a300a7 last_write_checksum: sha1:7f18af8d0b93a268b6a831856e01c8a892825da3 pristine_git_object: 6e6b587c8a8a6f6381df8bd34c06a9fd11d7578f + models/operations/createdeployment.go: + id: fc879f2c4bd0 + last_write_checksum: sha1:c8fdc9478563ada2a8a538ffcd1a4b7cd1b50272 + pristine_git_object: 03c8cee8787f64dccddca03e2ca5c161e3129ab7 + models/operations/createmanifest.go: + id: a6767be7cb3c + last_write_checksum: sha1:c67f6b38302c9aff1cfa32bbbb57d20114399365 + pristine_git_object: 8640b8525cf083f6d0415389ba5eb195ca989229 + models/operations/createmanifestraw.go: + id: 1cb46a50dbc7 + last_write_checksum: sha1:28f1ad690efe6b573e63a5bc6a8ba08c8f04e6cb + pristine_git_object: 8aad3fd7619ce9d7cc93f75cc6eb022be9416426 models/operations/deleteapp.go: id: 16ffc0588ffa - last_write_checksum: sha1:ad8037d95b7d56984167b1e03b0ec31ce82765b8 - pristine_git_object: ebfdb3190b0740fdc5b0f967af0a432b402e86b4 + last_write_checksum: sha1:fc3736ab52cf7e9c24a38f157288d76665d6b897 + pristine_git_object: c6a72d8bc198551bb8e709d2c703ae4e9b943559 models/operations/deleteappvariable.go: id: a1a35df253e4 last_write_checksum: sha1:e7adcc4d853d2866a7559bf5f0c08d533e0debd8 pristine_git_object: ad5019fede49c81723ca34e1a2bf474752aea945 - models/operations/deployappconfiguration.go: - id: 92230d011e2e - last_write_checksum: sha1:9adfe49e193c12cea89979fb681be6a9b351d42c - pristine_git_object: 35c6066d02a6a8fe132500566c13ffa95d5c0d48 - models/operations/deployappconfigurationraw.go: - id: 63b981dcaa57 - last_write_checksum: sha1:d35f32a9277a6ada51e6ea9f81f19ec9afd16e9f - pristine_git_object: 4e9796f48c416688155972689f7cb7854fa7c519 + models/operations/deletemanifest.go: + id: a9e05f283389 + last_write_checksum: sha1:d9b5b22243bad0bb985c474d9e666147ec8554e2 + pristine_git_object: 06b43a2ff341f3eef670d9e1981915fab88b3613 + models/operations/detachappmanifest.go: + id: 83007b2db814 + last_write_checksum: sha1:26a49783675474a6f4de06ce9b8dddea7c480099 + pristine_git_object: dfa94ca5125eeae7e5aed22535f33ff0359e694a models/operations/listapps.go: id: 73fbcbeab28f - last_write_checksum: sha1:e1769f9f62b690185f0f72d1ae5b5171df0b5fcb - pristine_git_object: cffd13ece0a73ca2c92ba2154ad28574b3325f22 + last_write_checksum: sha1:2affae7cd897b025cf1865449c9d6abe32e3c452 + pristine_git_object: 35573e662a5a59a07076f0fe7929a76bec02c17a + models/operations/listdeployments.go: + id: 0241618e0c69 + last_write_checksum: sha1:de2fc1094e438ec56519207846856c4c9cba8d09 + pristine_git_object: 6c51c65b2209681869a451c5260a7a29385d75e7 + models/operations/listmanifests.go: + id: c8df7087082a + last_write_checksum: sha1:05da46939ab67ddb81b5ce1ef87ae6836a2ab15e + pristine_git_object: fb5f4953f26ec4aeb74839bcb8674b88f93c0ef4 + models/operations/listmanifestversions.go: + id: c3d6a0006b82 + last_write_checksum: sha1:fb9346db18b793a25baf81b45a2abb26b2a9de88 + pristine_git_object: 383a02ecd2db96c47e7691af304ca63386b551b9 models/operations/options.go: id: d20dd4db9865 - last_write_checksum: sha1:2f6c1cc5afac268afc3fd2d667a82c81441f48fb - pristine_git_object: 42fca769d914dc3bb60bd33f893b15e1fe8ba0cd + last_write_checksum: sha1:63bf566497cff1c15f022c5ef1e088614b458825 + pristine_git_object: 6c56bd901e7e6cdd8f3053cddca0b7bb577bc090 + models/operations/pushmanifestversion.go: + id: 103d3cd7154c + last_write_checksum: sha1:1e79c961001d02886374474081b2f444092bad78 + pristine_git_object: d8c0578c883f8c5b9099bf95a10aa8689760954e + models/operations/pushmanifestversionraw.go: + id: 4407558a1706 + last_write_checksum: sha1:9ce5959e88ad074e86ae993b66b9057fd6e25ca8 + pristine_git_object: 03411e7c0ab6606e466a50ee95861384dab8e0d1 models/operations/readapp.go: id: 5ffcd917de05 - last_write_checksum: sha1:01bca85c3994d2794be2eb34eea64c776e39f881 - pristine_git_object: c0da89ffd5225907b28d7a5246a7a8aeb4f8ec52 - models/operations/readappcurrentstateversion.go: - id: a3205982713f - last_write_checksum: sha1:a43fe8b0b6b98d4af16990c221f92b10a328b23f - pristine_git_object: 25aa5b88b0c81996dccb6590e856ce4fdcbddf66 - models/operations/readappruns.go: - id: 1ebe888ea9e2 - last_write_checksum: sha1:91b805db92d5232b481d3ddf298f725cb8e790c4 - pristine_git_object: 8f5ff67e12113cfb4bc86720899ac194d6a79082 + last_write_checksum: sha1:5997868fdbb48083cfae50f1e990eafc952834a4 + pristine_git_object: fdaf235b8e0f5f4355a3b7f25152bc95267648f1 models/operations/readappvariables.go: id: 3c029298a72b - last_write_checksum: sha1:42b249b334f33657dd22a96047018ed05094490d - pristine_git_object: f642a034afb0cef123f3eeba201c9aad7134907c - models/operations/readappversions.go: - id: fe3c6439a5a9 - last_write_checksum: sha1:ddf8135ae02cb566e70045f35f876096d5ecfcb6 - pristine_git_object: 5a47d8d16e6945e4fce5daf6a55b1197d53fb43f - models/operations/readcurrentappversion.go: - id: 4cb29afb2b5e - last_write_checksum: sha1:71fa8ba76d9d0c13757309cfce5522f4aa5773ac - pristine_git_object: 5d01da8e3a943abcec7301ddd76381d6266f78f0 - models/operations/readcurrentrun.go: - id: b69915a418ee - last_write_checksum: sha1:58cbe2cdd6f514e99febd0644a5fccfcb6f79494 - pristine_git_object: ab1d0c30be0fda3c7706edbff7a2035913a3e75b - models/operations/readcurrentrunlogs.go: - id: 7e0d537fb0ad - last_write_checksum: sha1:cff758b7e3b9896efad8fb6e724971d61941a25c - pristine_git_object: 7c9fda3ffc5aebf6e4230a200e97f6d35133d356 - models/operations/readrun.go: - id: b4c286732b39 - last_write_checksum: sha1:174977f7e657795821948de25b3c5b1bdc478846 - pristine_git_object: 2970dc1ea1ef9513b20bfbf5aebc798ab093ae1f - models/operations/readrunlogs.go: - id: be3e6748f214 - last_write_checksum: sha1:76b4abe9f35472f464babd26bc42a0336fe3a529 - pristine_git_object: 431dd2ca9bd293492e0076a610491ea8ee0e9955 - models/operations/readversion.go: - id: 482e6ca480a0 - last_write_checksum: sha1:04f9980983a3ec3c2acb3884643914d16e75de8c - pristine_git_object: 9dcc7bc3971b27b70e3432a8d60a7a1ce2b2865c + last_write_checksum: sha1:2ebe235e100ef10034b5f8579dea0126c4e9e9a9 + pristine_git_object: b273ef6b05ce4df4d48877c6546b07b202d019a3 + models/operations/readdeployment.go: + id: 91ac6c44d1bd + last_write_checksum: sha1:835b9dedfd9742db8e350b3ced4a99e5c75acd3f + pristine_git_object: 43788bebcf2233fca353e13d67c6453f0f172d25 + models/operations/readdeploymentlogs.go: + id: 33138b5f3516 + last_write_checksum: sha1:50ac57766820913a5b2874e706f060d7960f2126 + pristine_git_object: 0ac0a7172e2154a2bf949f88dc8cf506b961d86e + models/operations/readmanifest.go: + id: 9724390accda + last_write_checksum: sha1:4230961090fe0df4302b5dcaed96f39fe666ae0d + pristine_git_object: da0a84d40b5eb3e16bca40e650c9e58671007222 + models/operations/readmanifestversion.go: + id: 6d717792910c + last_write_checksum: sha1:8c5b0e35b09d98b466e65664f39f4490ebd8ee5e + pristine_git_object: 586511fc2e9efab59cef96a965f108748bb81297 models/operations/updateapp.go: id: d3f1951d5c54 last_write_checksum: sha1:719d31225d99a895e93220742ac70812869b204b pristine_git_object: e0aa500334cedfc25ef02b5d46a340c376904c0d + models/operations/updatemanifest.go: + id: b0676a872835 + last_write_checksum: sha1:38ed2a5a9906f5127af079bd489c45a674456162 + pristine_git_object: 3b64059f09e9cae116efb9f9d8d58ef8bf0a21e2 optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d65954ba9be9e724bae40a5d2d09b052ed65628e @@ -731,13 +764,13 @@ examples: organizationId: "" responses: "200": - application/json: {"data": {"items": []}} + application/json: {"cursor": {"hasMore": true, "data": [{"id": "", "name": ""}]}} default: application/json: {"errorCode": ""} createApp: speakeasy-default-create-app: requestBody: - application/json: {"organizationId": ""} + application/json: {"name": ""} responses: "201": application/json: {"data": {"id": "", "name": ""}} @@ -749,7 +782,7 @@ examples: path: id: "" requestBody: - application/json: {} + application/json: {"name": ""} responses: default: application/json: {"errorCode": ""} @@ -768,9 +801,13 @@ examples: parameters: path: id: "" + query: + wait: false responses: default: application/json: {"errorCode": ""} + "202": + application/json: {} readAppCurrentStateVersion: speakeasy-default-read-app-current-state-version: parameters: @@ -788,7 +825,7 @@ examples: id: "" responses: "200": - application/json: {"data": {}} + application/json: {"cursor": {"hasMore": true, "data": []}} default: application/json: {"errorCode": ""} createAppVariable: @@ -797,10 +834,10 @@ examples: path: id: "" requestBody: - application/json: {"variable": {"key": "", "value": "", "sensitive": false}} + application/json: {"variable": {"key": "", "value": ""}} responses: "201": - application/json: {"data": {"key": "", "value": "", "sensitive": false, "id": ""}} + application/json: {"data": {"key": "", "value": "", "id": ""}} default: application/json: {"errorCode": ""} deleteAppVariable: @@ -919,5 +956,179 @@ examples: application/yaml: "x-file: example.file" default: application/json: {"errorCode": ""} + createManifest: + speakeasy-default-create-manifest-raw: + parameters: + query: + name: "" + requestBody: + application/yaml: "x-file: example.file" + responses: + "201": + application/json: {"data": {"id": "", "version": 342622, "name": "", "createdAt": "2026-06-07T23:43:24.174Z"}} + default: + application/json: {"errorCode": ""} + speakeasy-default-create-manifest: + parameters: + query: + name: "" + requestBody: + application/json: {} + responses: + "201": + application/json: {"data": {"id": "", "version": 342622, "name": "", "createdAt": "2026-06-07T23:43:24.174Z"}} + default: + application/json: {"errorCode": ""} + listManifests: + speakeasy-default-list-manifests: + responses: + "200": + application/json: {"cursor": {"hasMore": true, "data": []}} + default: + application/json: {"errorCode": ""} + readManifest: + speakeasy-default-read-manifest: + parameters: + path: + manifestId: "" + responses: + "200": + application/json: {"data": {"id": "", "name": "", "latestVersion": 449356, "createdAt": "2025-01-13T21:01:06.775Z", "updatedAt": "2026-12-07T01:47:24.857Z"}} + application/gzip: "x-file: example.file" + default: + application/json: {"errorCode": ""} + updateManifest: + speakeasy-default-update-manifest: + parameters: + path: + manifestId: "" + requestBody: + application/json: {"name": ""} + responses: + "200": + application/json: {"data": {"id": "", "name": "", "latestVersion": 797309, "createdAt": "2026-04-09T21:16:18.941Z", "updatedAt": "2026-09-02T19:43:33.178Z"}} + default: + application/json: {"errorCode": ""} + deleteManifest: + speakeasy-default-delete-manifest: + parameters: + path: + manifestId: "" + responses: + "409": + application/json: {"errorCode": ""} + default: + application/json: {"errorCode": ""} + pushManifestVersion: + speakeasy-default-push-manifest-version-raw: + parameters: + path: + manifestId: "" + requestBody: + application/yaml: "x-file: example.file" + responses: + "201": + application/json: {"data": {"manifestId": "", "version": 836923, "createdAt": "2024-10-29T19:28:36.110Z"}} + default: + application/json: {"errorCode": ""} + speakeasy-default-push-manifest-version: + parameters: + path: + manifestId: "" + requestBody: + application/json: {} + responses: + "201": + application/json: {"data": {"manifestId": "", "version": 836923, "createdAt": "2024-10-29T19:28:36.110Z"}} + default: + application/json: {"errorCode": ""} + listManifestVersions: + speakeasy-default-list-manifest-versions: + parameters: + path: + manifestId: "" + responses: + "200": + application/json: {"cursor": {"hasMore": false, "data": []}} + default: + application/json: {"errorCode": ""} + readManifestVersion: + speakeasy-default-read-manifest-version: + parameters: + path: + manifestId: "" + version: "" + responses: + "200": + application/json: {"data": {"manifestId": "", "version": 291553, "createdAt": "2024-12-09T16:22:04.214Z"}} + application/x-yaml: "x-file: example.file" + default: + application/json: {"errorCode": ""} + createDeployment: + speakeasy-default-create-deployment: + requestBody: + application/json: {"appId": "", "manifestId": "", "manifestVersion": 5649} + responses: + "201": + application/json: {"data": {"id": "", "appId": "", "status": "", "createdAt": "2024-01-07T04:35:31.471Z", "updatedAt": "2025-12-16T01:27:14.812Z"}} + default: + application/json: {"errorCode": ""} + speakeasy-default-create-deployment-raw: + requestBody: + application/yaml: "x-file: example.file" + responses: + "201": + application/json: {"data": {"id": "", "appId": "", "status": "", "createdAt": "2024-01-07T04:35:31.471Z", "updatedAt": "2025-12-16T01:27:14.812Z"}} + default: + application/json: {"errorCode": ""} + listDeployments: + speakeasy-default-list-deployments: + responses: + "200": + application/json: {"cursor": {"hasMore": false, "data": [{"id": "", "appId": "", "status": "", "createdAt": "2024-05-13T18:10:51.662Z", "updatedAt": "2025-08-14T19:55:10.264Z"}]}} + default: + application/json: {"errorCode": ""} + readDeployment: + speakeasy-default-read-deployment: + parameters: + path: + deploymentId: "" + responses: + "200": + application/json: {"data": {"id": "", "appId": "", "status": "", "createdAt": "2025-06-20T10:16:58.267Z", "updatedAt": "2025-04-30T01:36:03.827Z"}} + application/gzip: "x-file: example.file" + application/yaml: "x-file: example.file" + default: + application/json: {"errorCode": ""} + readDeploymentLogs: + speakeasy-default-read-deployment-logs: + parameters: + path: + deploymentId: "" + responses: + "200": + application/json: {} + default: + application/json: {"errorCode": ""} + attachAppManifest: + speakeasy-default-attach-app-manifest: + parameters: + path: + id: "" + requestBody: + application/json: {"manifestId": ""} + responses: + "400": + application/json: {"errorCode": ""} + default: + application/json: {"errorCode": ""} + detachAppManifest: + speakeasy-default-detach-app-manifest: + parameters: + path: + id: "" + responses: + default: + application/json: {"errorCode": ""} examplesVersion: 1.0.2 generatedTests: {} diff --git a/internal/deployserverclient/.speakeasy/gen.yaml b/internal/deployserverclient/.speakeasy/gen.yaml index b92b44b7..9fb731ae 100644 --- a/internal/deployserverclient/.speakeasy/gen.yaml +++ b/internal/deployserverclient/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false go: - version: 0.0.1 + version: 0.1.1 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: DeployServerError diff --git a/internal/deployserverclient/.speakeasy/workflow.lock b/internal/deployserverclient/.speakeasy/workflow.lock index 56f7a3e5..e9a3235a 100644 --- a/internal/deployserverclient/.speakeasy/workflow.lock +++ b/internal/deployserverclient/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.759.2 sources: Terraform HCP Proxy API: sourceNamespace: terraform-hcp-proxy-api - sourceRevisionDigest: sha256:10ee0ae3168b95a47c78a3128b465abd28a4beb6b99ab2e27735455138465b20 - sourceBlobDigest: sha256:4e4bf80a183fb2ae17d4ae27d2a6de867db0654fe28483c80ec25e9530e3a967 + sourceRevisionDigest: sha256:d54ede8b0d8f74daea2fc161cf13846dd4a7084f96941f68356d8307bfa92186 + sourceBlobDigest: sha256:8564cde40781c471d4f17f1781a0c92fcf0ddc26ca20fbb3a2cc2a39d0c22f70 tags: - latest - 0.1.0 @@ -11,8 +11,8 @@ targets: deploy-server: source: Terraform HCP Proxy API sourceNamespace: terraform-hcp-proxy-api - sourceRevisionDigest: sha256:10ee0ae3168b95a47c78a3128b465abd28a4beb6b99ab2e27735455138465b20 - sourceBlobDigest: sha256:4e4bf80a183fb2ae17d4ae27d2a6de867db0654fe28483c80ec25e9530e3a967 + sourceRevisionDigest: sha256:d54ede8b0d8f74daea2fc161cf13846dd4a7084f96941f68356d8307bfa92186 + sourceBlobDigest: sha256:8564cde40781c471d4f17f1781a0c92fcf0ddc26ca20fbb3a2cc2a39d0c22f70 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.759.2 diff --git a/internal/deployserverclient/README.md b/internal/deployserverclient/README.md index dac472ae..55a8f66a 100644 --- a/internal/deployserverclient/README.md +++ b/internal/deployserverclient/README.md @@ -26,6 +26,7 @@ Developer-friendly & type-safe Go SDK specifically catered to leverage *github.c * [github.com/formancehq/fctl/internal/deployserverclient](#githubcomformancehqfctlinternaldeployserverclient) * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) + * [Authentication](#authentication) * [Available Resources and Operations](#available-resources-and-operations) * [Retries](#retries) * [Error Handling](#error-handling) @@ -58,14 +59,17 @@ import ( "context" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" + "os" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } @@ -77,6 +81,47 @@ func main() { ``` + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | Environment Variable | +| ------------ | ---- | ----------- | -------------------------- | +| `BearerAuth` | http | HTTP Bearer | `DEPLOYSERVER_BEARER_AUTH` | + +You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example: +```go +package main + +import ( + "context" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "log" + "os" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.ListApps(ctx, nil, nil) + if err != nil { + log.Fatal(err) + } + if res.ListAppsResponse != nil { + // handle response + } +} + +``` + + ## Available Resources and Operations @@ -90,20 +135,25 @@ func main() { * [UpdateApp](docs/sdks/deployserver/README.md#updateapp) - Update an app * [ReadApp](docs/sdks/deployserver/README.md#readapp) - read app details * [DeleteApp](docs/sdks/deployserver/README.md#deleteapp) - Delete an app -* [ReadAppCurrentStateVersion](docs/sdks/deployserver/README.md#readappcurrentstateversion) - Get the current state version of an app +* [AttachAppManifest](docs/sdks/deployserver/README.md#attachappmanifest) - Bind an app to a manifest +* [DetachAppManifest](docs/sdks/deployserver/README.md#detachappmanifest) - Unbind an app from its manifest * [ReadAppVariables](docs/sdks/deployserver/README.md#readappvariables) - Get all variables of an app * [CreateAppVariable](docs/sdks/deployserver/README.md#createappvariable) - Create variable for an app * [DeleteAppVariable](docs/sdks/deployserver/README.md#deleteappvariable) - Delete a variable from an app -* [ReadAppRuns](docs/sdks/deployserver/README.md#readappruns) - Get runs of an app -* [ReadAppVersions](docs/sdks/deployserver/README.md#readappversions) - Get versions of an app -* [DeployAppConfigurationRaw](docs/sdks/deployserver/README.md#deployappconfigurationraw) - Deploy a new configuration for an app -* [DeployAppConfiguration](docs/sdks/deployserver/README.md#deployappconfiguration) - Deploy a new configuration for an app -* [ReadCurrentRun](docs/sdks/deployserver/README.md#readcurrentrun) - Get the current run of an app -* [ReadVersion](docs/sdks/deployserver/README.md#readversion) - Get a specific version -* [ReadRun](docs/sdks/deployserver/README.md#readrun) - Get the run of a version -* [ReadRunLogs](docs/sdks/deployserver/README.md#readrunlogs) - Get logs of a run by its ID -* [ReadCurrentRunLogs](docs/sdks/deployserver/README.md#readcurrentrunlogs) - Get logs of the current run of an app -* [ReadCurrentAppVersion](docs/sdks/deployserver/README.md#readcurrentappversion) - Get the current version of an app +* [CreateManifestRaw](docs/sdks/deployserver/README.md#createmanifestraw) - Create a new manifest +* [CreateManifest](docs/sdks/deployserver/README.md#createmanifest) - Create a new manifest +* [ListManifests](docs/sdks/deployserver/README.md#listmanifests) - List manifests in the organization +* [ReadManifest](docs/sdks/deployserver/README.md#readmanifest) - Read a manifest +* [UpdateManifest](docs/sdks/deployserver/README.md#updatemanifest) - Update manifest metadata +* [DeleteManifest](docs/sdks/deployserver/README.md#deletemanifest) - Delete a manifest and all its versions +* [PushManifestVersionRaw](docs/sdks/deployserver/README.md#pushmanifestversionraw) - Push a new version of a manifest +* [PushManifestVersion](docs/sdks/deployserver/README.md#pushmanifestversion) - Push a new version of a manifest +* [ListManifestVersions](docs/sdks/deployserver/README.md#listmanifestversions) - List versions of a manifest +* [ReadManifestVersion](docs/sdks/deployserver/README.md#readmanifestversion) - Get a specific manifest version with content +* [CreateDeployment](docs/sdks/deployserver/README.md#createdeployment) - Create a deployment (triggers a run) +* [ListDeployments](docs/sdks/deployserver/README.md#listdeployments) - List deployments +* [ReadDeployment](docs/sdks/deployserver/README.md#readdeployment) - Get a single deployment +* [ReadDeploymentLogs](docs/sdks/deployserver/README.md#readdeploymentlogs) - Get run logs for a deployment @@ -123,14 +173,17 @@ import ( "github.com/formancehq/fctl/internal/deployserverclient/v3/retry" "log" "models/operations" + "os" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ListApps(ctx, "", nil, nil, operations.WithRetries( + res, err := s.ListApps(ctx, nil, nil, operations.WithRetries( retry.Config{ Strategy: "backoff", Backoff: &retry.BackoffStrategy{ @@ -160,6 +213,7 @@ import ( deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "github.com/formancehq/fctl/internal/deployserverclient/v3/retry" "log" + "os" ) func main() { @@ -177,9 +231,10 @@ func main() { }, RetryConnectionErrors: false, }), + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } @@ -198,11 +253,12 @@ Handling errors in this SDK should largely match your expectations. All operatio By Default, an API error will return `apierrors.APIError`. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. -For example, the `ListApps` function may return the following errors: +For example, the `AttachAppManifest` function may return the following errors: -| Error Type | Status Code | Content Type | -| ------------------ | ----------- | ------------ | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ----------- | ---------------- | +| apierrors.Error | 400, 404 | application/json | +| apierrors.APIError | 4XX, 5XX | \*/\* | ### Example @@ -214,17 +270,29 @@ import ( "errors" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/apierrors" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" + "os" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.AttachAppManifest(ctx, "", components.AttachManifestRequest{ + ManifestID: "", + }) if err != nil { + var e *apierrors.Error + if errors.As(err, &e) { + // handle error + log.Fatal(e.Error()) + } + var e *apierrors.APIError if errors.As(err, &e) { // handle error @@ -258,6 +326,7 @@ import ( "context" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" + "os" ) func main() { @@ -265,9 +334,10 @@ func main() { s := deployserverclient.New( deployserverclient.WithServerIndex(0), + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } @@ -288,6 +358,7 @@ import ( "context" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" + "os" ) func main() { @@ -295,9 +366,10 @@ func main() { s := deployserverclient.New( deployserverclient.WithServerURL("http://localhost:8080"), + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } diff --git a/internal/deployserverclient/USAGE.md b/internal/deployserverclient/USAGE.md index 7d5b9300..5e9db16f 100644 --- a/internal/deployserverclient/USAGE.md +++ b/internal/deployserverclient/USAGE.md @@ -6,14 +6,17 @@ import ( "context" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" + "os" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } diff --git a/internal/deployserverclient/deployserver.go b/internal/deployserverclient/deployserver.go index 053900e8..9212799b 100644 --- a/internal/deployserverclient/deployserver.go +++ b/internal/deployserverclient/deployserver.go @@ -102,6 +102,23 @@ func WithClient(client HTTPClient) SDKOption { } } +// WithSecurity configures the SDK to use the provided security details +func WithSecurity(bearerAuth string) SDKOption { + return func(sdk *DeployServer) { + security := components.Security{BearerAuth: &bearerAuth} + sdk.sdkConfiguration.Security = utils.AsSecuritySource(&security) + } +} + +// WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication +func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption { + return func(sdk *DeployServer) { + sdk.sdkConfiguration.Security = func(ctx context.Context) (interface{}, error) { + return security(ctx) + } + } +} + func WithRetryConfig(retryConfig retry.Config) SDKOption { return func(sdk *DeployServer) { sdk.sdkConfiguration.RetryConfig = &retryConfig @@ -118,9 +135,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *DeployServer { sdk := &DeployServer{ - SDKVersion: "0.0.1", + SDKVersion: "0.1.1", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.0.1 2.869.23 0.1.0 github.com/formancehq/fctl/internal/deployserverclient/v3", + UserAgent: "speakeasy-sdk/go 0.1.1 2.869.23 0.1.0 github.com/formancehq/fctl/internal/deployserverclient/v3", ServerList: ServerList, }, hooks: hooks.New(), @@ -129,6 +146,13 @@ func New(opts ...SDKOption) *DeployServer { opt(sdk) } + if sdk.sdkConfiguration.Security == nil { + var envVarSecurity components.Security + if utils.PopulateSecurityFromEnv(&envVarSecurity) { + sdk.sdkConfiguration.Security = utils.AsSecuritySource(envVarSecurity) + } + } + // Use WithClient to override the default client if you would like to customize the timeout if sdk.sdkConfiguration.Client == nil { sdk.sdkConfiguration.Client = &http.Client{Timeout: 60 * time.Second} @@ -140,11 +164,10 @@ func New(opts ...SDKOption) *DeployServer { } // ListApps - List organization apps -func (s *DeployServer) ListApps(ctx context.Context, organizationID string, pageNumber *int64, pageSize *int64, opts ...operations.Option) (*operations.ListAppsResponse, error) { +func (s *DeployServer) ListApps(ctx context.Context, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.ListAppsResponse, error) { request := operations.ListAppsRequest{ - OrganizationID: organizationID, - PageNumber: pageNumber, - PageSize: pageSize, + PageSize: pageSize, + Cursor: cursor, } o := operations.Options{} @@ -177,7 +200,7 @@ func (s *DeployServer) ListApps(ctx context.Context, organizationID string, page Context: ctx, OperationID: "listApps", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -202,6 +225,10 @@ func (s *DeployServer) ListApps(ctx context.Context, organizationID string, page return nil, fmt.Errorf("error populating query params: %w", err) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -397,7 +424,7 @@ func (s *DeployServer) CreateApp(ctx context.Context, request components.CreateA Context: ctx, OperationID: "createApp", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { @@ -425,6 +452,10 @@ func (s *DeployServer) CreateApp(ctx context.Context, request components.CreateA req.Header.Set("Content-Type", reqContentType) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -625,7 +656,7 @@ func (s *DeployServer) UpdateApp(ctx context.Context, id string, updateAppReques Context: ctx, OperationID: "updateApp", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateAppRequest", "json", `request:"mediaType=application/json"`) if err != nil { @@ -653,6 +684,10 @@ func (s *DeployServer) UpdateApp(ctx context.Context, id string, updateAppReques req.Header.Set("Content-Type", reqContentType) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -798,9 +833,10 @@ func (s *DeployServer) UpdateApp(ctx context.Context, id string, updateAppReques } // ReadApp - read app details -func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadAppResponse, error) { +func (s *DeployServer) ReadApp(ctx context.Context, id string, include []operations.ReadAppInclude, opts ...operations.Option) (*operations.ReadAppResponse, error) { request := operations.ReadAppRequest{ - ID: id, + ID: id, + Include: include, } o := operations.Options{} @@ -833,7 +869,1155 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation Context: ctx, OperationID: "readApp", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ReadAppResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.AppResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AppResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil + +} + +// DeleteApp - Delete an app +// Soft-deletes the app immediately and enqueues a destroy deployment to +// clean up the app's resources on Formance Cloud via the openapi +// reconciler's tear-down path. The app becomes invisible to all +// subsequent reads. The destroy runs through the normal worker +// pipeline; once it reaches a successful terminal status the worker +// hard-deletes the app row. +// +// By default this returns 202 Accepted as soon as the destroy is +// enqueued (or 202 with no body if no destroy was needed). Pass +// `?wait=true` to block until the destroy reaches a terminal status. +func (s *DeployServer) DeleteApp(ctx context.Context, id string, wait *bool, opts ...operations.Option) (*operations.DeleteAppResponse, error) { + request := operations.DeleteAppRequest{ + ID: id, + Wait: wait, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteApp", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteAppResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 202: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.DeleteAppResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.DeleteAppResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 204: + utils.DrainBody(httpRes) + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil + +} + +// AttachAppManifest - Bind an app to a manifest +// Updates the app's `manifest_id` pointer. Idempotent — re-binding to the +// same id is a no-op; rebinding to a different id moves the pointer. +func (s *DeployServer) AttachAppManifest(ctx context.Context, id string, attachManifestRequest components.AttachManifestRequest, opts ...operations.Option) (*operations.AttachAppManifestResponse, error) { + request := operations.AttachAppManifestRequest{ + ID: id, + AttachManifestRequest: attachManifestRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/manifest", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "attachAppManifest", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "AttachManifestRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AttachAppManifestResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 204: + utils.DrainBody(httpRes) + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil + +} + +// DetachAppManifest - Unbind an app from its manifest +// Clears the app's `manifest_id` pointer. Idempotent. +func (s *DeployServer) DetachAppManifest(ctx context.Context, id string, opts ...operations.Option) (*operations.DetachAppManifestResponse, error) { + request := operations.DetachAppManifestRequest{ + ID: id, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/manifest", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "detachAppManifest", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DetachAppManifestResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 204: + utils.DrainBody(httpRes) + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil + +} + +// ReadAppVariables - Get all variables of an app +func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.ReadAppVariablesResponse, error) { + request := operations.ReadAppVariablesRequest{ + ID: id, + PageSize: pageSize, + Cursor: cursor, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "readAppVariables", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ReadAppVariablesResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ReadVariablesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReadVariablesResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil + +} + +// CreateAppVariable - Create variable for an app +func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createVariableRequest components.CreateVariableRequest, opts ...operations.Option) (*operations.CreateAppVariableResponse, error) { + request := operations.CreateAppVariableRequest{ + ID: id, + CreateVariableRequest: createVariableRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createAppVariable", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "CreateVariableRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err } timeout := o.Timeout @@ -847,12 +2031,19 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } for k, v := range o.SetHeaders { req.Header.Set(k, v) @@ -949,7 +2140,7 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation } } - res := &operations.ReadAppResponse{ + res := &operations.CreateAppVariableResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -957,7 +2148,7 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation } switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -965,12 +2156,12 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation return nil, err } - var out components.AppResponse + var out components.CreateVariableResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AppResponse = &out + res.CreateVariableResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1017,10 +2208,11 @@ func (s *DeployServer) ReadApp(ctx context.Context, id string, opts ...operation } -// DeleteApp - Delete an app -func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operations.Option) (*operations.DeleteAppResponse, error) { - request := operations.DeleteAppRequest{ - ID: id, +// DeleteAppVariable - Delete a variable from an app +func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variableID string, opts ...operations.Option) (*operations.DeleteAppVariableResponse, error) { + request := operations.DeleteAppVariableRequest{ + ID: id, + VariableID: variableID, } o := operations.Options{} @@ -1041,7 +2233,7 @@ func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operati } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables/{variableId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1051,9 +2243,9 @@ func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operati SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "deleteApp", + OperationID: "deleteAppVariable", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -1074,6 +2266,10 @@ func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operati req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -1169,7 +2365,7 @@ func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operati } } - res := &operations.DeleteAppResponse{ + res := &operations.DeleteAppVariableResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1218,10 +2414,11 @@ func (s *DeployServer) DeleteApp(ctx context.Context, id string, opts ...operati } -// ReadAppCurrentStateVersion - Get the current state version of an app -func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadAppCurrentStateVersionResponse, error) { - request := operations.ReadAppCurrentStateVersionRequest{ - ID: id, +// CreateManifestRaw - Create a new manifest +func (s *DeployServer) CreateManifestRaw(ctx context.Context, name string, requestBody any, opts ...operations.Option) (*operations.CreateManifestRawResponse, error) { + request := operations.CreateManifestRawRequest{ + Name: name, + RequestBody: requestBody, } o := operations.Options{} @@ -1242,7 +2439,7 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/current-state-version", request, nil) + opURL, err := url.JoinPath(baseURL, "/manifests") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1252,9 +2449,13 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readAppCurrentStateVersion", + OperationID: "createManifest_raw", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "raw", `request:"mediaType=application/yaml"`) + if err != nil { + return nil, err } timeout := o.Timeout @@ -1268,12 +2469,23 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } for k, v := range o.SetHeaders { req.Header.Set(k, v) @@ -1370,7 +2582,7 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string } } - res := &operations.ReadAppCurrentStateVersionResponse{ + res := &operations.CreateManifestRawResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1378,7 +2590,7 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string } switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1386,12 +2598,12 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string return nil, err } - var out components.ReadStateResponse + var out components.CreateManifestResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadStateResponse = &out + res.CreateManifestResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1438,12 +2650,11 @@ func (s *DeployServer) ReadAppCurrentStateVersion(ctx context.Context, id string } -// ReadAppVariables - Get all variables of an app -func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumber *int64, pageSize *int64, opts ...operations.Option) (*operations.ReadAppVariablesResponse, error) { - request := operations.ReadAppVariablesRequest{ - ID: id, - PageNumber: pageNumber, - PageSize: pageSize, +// CreateManifest - Create a new manifest +func (s *DeployServer) CreateManifest(ctx context.Context, name string, requestBody operations.CreateManifestRequestBody, opts ...operations.Option) (*operations.CreateManifestResponse, error) { + request := operations.CreateManifestRequest{ + Name: name, + RequestBody: requestBody, } o := operations.Options{} @@ -1464,7 +2675,7 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables", request, nil) + opURL, err := url.JoinPath(baseURL, "/manifests") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1474,9 +2685,13 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readAppVariables", + OperationID: "createManifest", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err } timeout := o.Timeout @@ -1490,17 +2705,24 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -1596,7 +2818,7 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb } } - res := &operations.ReadAppVariablesResponse{ + res := &operations.CreateManifestResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1604,7 +2826,7 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb } switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1612,12 +2834,12 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb return nil, err } - var out components.ReadVariablesResponse + var out components.CreateManifestResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadVariablesResponse = &out + res.CreateManifestResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1664,11 +2886,11 @@ func (s *DeployServer) ReadAppVariables(ctx context.Context, id string, pageNumb } -// CreateAppVariable - Create variable for an app -func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createVariableRequest components.CreateVariableRequest, opts ...operations.Option) (*operations.CreateAppVariableResponse, error) { - request := operations.CreateAppVariableRequest{ - ID: id, - CreateVariableRequest: createVariableRequest, +// ListManifests - List manifests in the organization +func (s *DeployServer) ListManifests(ctx context.Context, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.ListManifestsResponse, error) { + request := operations.ListManifestsRequest{ + PageSize: pageSize, + Cursor: cursor, } o := operations.Options{} @@ -1689,7 +2911,7 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables", request, nil) + opURL, err := url.JoinPath(baseURL, "/manifests") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1699,13 +2921,9 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "createAppVariable", + OperationID: "listManifests", OAuth2Scopes: nil, - SecuritySource: nil, - } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "CreateVariableRequest", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -1719,14 +2937,19 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV defer cancel() } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err } for k, v := range o.SetHeaders { @@ -1824,7 +3047,7 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV } } - res := &operations.CreateAppVariableResponse{ + res := &operations.ListManifestsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1832,7 +3055,7 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV } switch { - case httpRes.StatusCode == 201: + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1840,12 +3063,12 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV return nil, err } - var out components.CreateVariableResponse + var out components.ListManifestsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateVariableResponse = &out + res.ListManifestsResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1892,11 +3115,11 @@ func (s *DeployServer) CreateAppVariable(ctx context.Context, id string, createV } -// DeleteAppVariable - Delete a variable from an app -func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variableID string, opts ...operations.Option) (*operations.DeleteAppVariableResponse, error) { - request := operations.DeleteAppVariableRequest{ - ID: id, - VariableID: variableID, +// ReadManifest - Read a manifest +func (s *DeployServer) ReadManifest(ctx context.Context, manifestID string, include *string, opts ...operations.Option) (*operations.ReadManifestResponse, error) { + request := operations.ReadManifestRequest{ + ManifestID: manifestID, + Include: include, } o := operations.Options{} @@ -1917,7 +3140,7 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/variables/{variableId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1927,9 +3150,9 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "deleteAppVariable", + OperationID: "readManifest", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -1943,13 +3166,21 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl defer cancel() } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -2045,7 +3276,7 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl } } - res := &operations.DeleteAppVariableResponse{ + res := &operations.ReadManifestResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2053,8 +3284,27 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl } switch { - case httpRes.StatusCode == 204: - utils.DrainBody(httpRes) + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ManifestResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ManifestResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2094,12 +3344,11 @@ func (s *DeployServer) DeleteAppVariable(ctx context.Context, id string, variabl } -// ReadAppRuns - Get runs of an app -func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *int64, pageSize *int64, opts ...operations.Option) (*operations.ReadAppRunsResponse, error) { - request := operations.ReadAppRunsRequest{ - ID: id, - PageNumber: pageNumber, - PageSize: pageSize, +// UpdateManifest - Update manifest metadata +func (s *DeployServer) UpdateManifest(ctx context.Context, manifestID string, updateManifestRequest components.UpdateManifestRequest, opts ...operations.Option) (*operations.UpdateManifestResponse, error) { + request := operations.UpdateManifestRequest{ + ManifestID: manifestID, + UpdateManifestRequest: updateManifestRequest, } o := operations.Options{} @@ -2120,7 +3369,7 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/runs", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2130,9 +3379,13 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readAppRuns", + OperationID: "updateManifest", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateManifestRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err } timeout := o.Timeout @@ -2146,15 +3399,18 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } - if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err } for k, v := range o.SetHeaders { @@ -2252,7 +3508,7 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i } } - res := &operations.ReadAppRunsResponse{ + res := &operations.UpdateManifestResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2268,12 +3524,12 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i return nil, err } - var out components.ListRunsResponse + var out components.ManifestResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListRunsResponse = &out + res.ManifestResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2320,12 +3576,10 @@ func (s *DeployServer) ReadAppRuns(ctx context.Context, id string, pageNumber *i } -// ReadAppVersions - Get versions of an app -func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumber *int64, pageSize *int64, opts ...operations.Option) (*operations.ReadAppVersionsResponse, error) { - request := operations.ReadAppVersionsRequest{ - ID: id, - PageNumber: pageNumber, - PageSize: pageSize, +// DeleteManifest - Delete a manifest and all its versions +func (s *DeployServer) DeleteManifest(ctx context.Context, manifestID string, opts ...operations.Option) (*operations.DeleteManifestResponse, error) { + request := operations.DeleteManifestRequest{ + ManifestID: manifestID, } o := operations.Options{} @@ -2346,7 +3600,7 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/versions", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2356,9 +3610,9 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readAppVersions", + OperationID: "deleteManifest", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -2372,15 +3626,15 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err } for k, v := range o.SetHeaders { @@ -2463,7 +3717,7 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"409", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2478,7 +3732,7 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe } } - res := &operations.ReadAppVersionsResponse{ + res := &operations.DeleteManifestResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2486,7 +3740,9 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe } switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 204: + utils.DrainBody(httpRes) + case httpRes.StatusCode == 409: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2494,12 +3750,12 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe return nil, err } - var out components.ListVersionsResponse + var out apierrors.Error if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListVersionsResponse = &out + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2546,10 +3802,10 @@ func (s *DeployServer) ReadAppVersions(ctx context.Context, id string, pageNumbe } -// DeployAppConfigurationRaw - Deploy a new configuration for an app -func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, requestBody any, opts ...operations.Option) (*operations.DeployAppConfigurationRawResponse, error) { - request := operations.DeployAppConfigurationRawRequest{ - ID: id, +// PushManifestVersionRaw - Push a new version of a manifest +func (s *DeployServer) PushManifestVersionRaw(ctx context.Context, manifestID string, requestBody any, opts ...operations.Option) (*operations.PushManifestVersionRawResponse, error) { + request := operations.PushManifestVersionRawRequest{ + ManifestID: manifestID, RequestBody: requestBody, } @@ -2571,7 +3827,7 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/deploy", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}/versions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2581,9 +3837,9 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "deployAppConfiguration_raw", + OperationID: "pushManifestVersion_raw", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "raw", `request:"mediaType=application/yaml"`) if err != nil { @@ -2611,6 +3867,10 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, req.Header.Set("Content-Type", reqContentType) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -2706,7 +3966,7 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, } } - res := &operations.DeployAppConfigurationRawResponse{ + res := &operations.PushManifestVersionRawResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2714,7 +3974,7 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, } switch { - case httpRes.StatusCode == 202: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2722,12 +3982,12 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, return nil, err } - var out components.RunResponse + var out components.ManifestVersionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.RunResponse = &out + res.ManifestVersionResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2774,11 +4034,11 @@ func (s *DeployServer) DeployAppConfigurationRaw(ctx context.Context, id string, } -// DeployAppConfiguration - Deploy a new configuration for an app -func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, application components.Application, opts ...operations.Option) (*operations.DeployAppConfigurationResponse, error) { - request := operations.DeployAppConfigurationRequest{ - ID: id, - Application: application, +// PushManifestVersion - Push a new version of a manifest +func (s *DeployServer) PushManifestVersion(ctx context.Context, manifestID string, requestBody operations.PushManifestVersionRequestBody, opts ...operations.Option) (*operations.PushManifestVersionResponse, error) { + request := operations.PushManifestVersionRequest{ + ManifestID: manifestID, + RequestBody: requestBody, } o := operations.Options{} @@ -2799,7 +4059,7 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/deploy", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}/versions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2809,11 +4069,11 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "deployAppConfiguration", + OperationID: "pushManifestVersion", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Application", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } @@ -2839,6 +4099,10 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap req.Header.Set("Content-Type", reqContentType) } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -2934,7 +4198,7 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap } } - res := &operations.DeployAppConfigurationResponse{ + res := &operations.PushManifestVersionResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2942,7 +4206,7 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap } switch { - case httpRes.StatusCode == 202: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2950,12 +4214,12 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap return nil, err } - var out components.RunResponse + var out components.ManifestVersionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.RunResponse = &out + res.ManifestVersionResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -3002,10 +4266,12 @@ func (s *DeployServer) DeployAppConfiguration(ctx context.Context, id string, ap } -// ReadCurrentRun - Get the current run of an app -func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadCurrentRunResponse, error) { - request := operations.ReadCurrentRunRequest{ - ID: id, +// ListManifestVersions - List versions of a manifest +func (s *DeployServer) ListManifestVersions(ctx context.Context, manifestID string, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.ListManifestVersionsResponse, error) { + request := operations.ListManifestVersionsRequest{ + ManifestID: manifestID, + PageSize: pageSize, + Cursor: cursor, } o := operations.Options{} @@ -3026,7 +4292,7 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/run", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}/versions", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -3036,9 +4302,9 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readCurrentRun", + OperationID: "listManifestVersions", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -3059,6 +4325,14 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -3154,7 +4428,7 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op } } - res := &operations.ReadCurrentRunResponse{ + res := &operations.ListManifestVersionsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -3170,12 +4444,12 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op return nil, err } - var out components.RunResponse + var out components.ListManifestVersionsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.RunResponse = &out + res.ListManifestVersionsResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -3222,10 +4496,11 @@ func (s *DeployServer) ReadCurrentRun(ctx context.Context, id string, opts ...op } -// ReadVersion - Get a specific version -func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadVersionResponse, error) { - request := operations.ReadVersionRequest{ - ID: id, +// ReadManifestVersion - Get a specific manifest version with content +func (s *DeployServer) ReadManifestVersion(ctx context.Context, manifestID string, version string, opts ...operations.Option) (*operations.ReadManifestVersionResponse, error) { + request := operations.ReadManifestVersionRequest{ + ManifestID: manifestID, + Version: version, } o := operations.Options{} @@ -3247,7 +4522,7 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/versions/{id}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/manifests/{manifestId}/versions/{version}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -3257,9 +4532,9 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readVersion", + OperationID: "readManifestVersion", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -3280,11 +4555,15 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera if o.AcceptHeaderOverride != nil { req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) } else { - req.Header.Set("Accept", "application/json;q=1, application/yaml;q=0.7, application/gzip;q=0") + req.Header.Set("Accept", "application/json;q=1, application/x-yaml;q=0") } req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -3380,7 +4659,7 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera } } - res := &operations.ReadVersionResponse{ + res := &operations.ReadManifestVersionResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -3396,18 +4675,14 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera return nil, err } - var out components.AppVersionResponse + var out components.ManifestVersionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AppVersionResponse = &out - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/gzip`): - res.TwoHundredApplicationGzipResponseStream = httpRes.Body - - return res, nil - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/yaml`): - res.TwoHundredApplicationYamlResponseStream = httpRes.Body + res.ManifestVersionResponse = &out + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/x-yaml`): + res.ResponseStream = httpRes.Body return res, nil default: @@ -3456,12 +4731,8 @@ func (s *DeployServer) ReadVersion(ctx context.Context, id string, opts ...opera } -// ReadRun - Get the run of a version -func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadRunResponse, error) { - request := operations.ReadRunRequest{ - ID: id, - } - +// CreateDeployment - Create a deployment (triggers a run) +func (s *DeployServer) CreateDeployment(ctx context.Context, request components.CreateDeploymentRequest, opts ...operations.Option) (*operations.CreateDeploymentResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3480,7 +4751,7 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/runs/{id}", request, nil) + opURL, err := url.JoinPath(baseURL, "/deployments") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -3490,9 +4761,13 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readRun", + OperationID: "createDeployment", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err } timeout := o.Timeout @@ -3506,12 +4781,19 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } for k, v := range o.SetHeaders { req.Header.Set(k, v) @@ -3608,7 +4890,7 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation } } - res := &operations.ReadRunResponse{ + res := &operations.CreateDeploymentResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -3616,7 +4898,7 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation } switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -3624,12 +4906,12 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation return nil, err } - var out components.RunResponse + var out components.DeploymentResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.RunResponse = &out + res.DeploymentResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -3676,10 +4958,12 @@ func (s *DeployServer) ReadRun(ctx context.Context, id string, opts ...operation } -// ReadRunLogs - Get logs of a run by its ID -func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadRunLogsResponse, error) { - request := operations.ReadRunLogsRequest{ - ID: id, +// ListDeployments - List deployments +func (s *DeployServer) ListDeployments(ctx context.Context, appID *string, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.ListDeploymentsResponse, error) { + request := operations.ListDeploymentsRequest{ + AppID: appID, + PageSize: pageSize, + Cursor: cursor, } o := operations.Options{} @@ -3700,7 +4984,7 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/runs/{id}/logs", request, nil) + opURL, err := url.JoinPath(baseURL, "/deployments") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -3710,9 +4994,9 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readRunLogs", + OperationID: "listDeployments", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -3733,6 +5017,14 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -3828,7 +5120,7 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera } } - res := &operations.ReadRunLogsResponse{ + res := &operations.ListDeploymentsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -3844,12 +5136,12 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera return nil, err } - var out components.ReadLogsResponse + var out components.ListDeploymentsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadLogsResponse = &out + res.ListDeploymentsResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -3896,16 +5188,18 @@ func (s *DeployServer) ReadRunLogs(ctx context.Context, id string, opts ...opera } -// ReadCurrentRunLogs - Get logs of the current run of an app -func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts ...operations.Option) (*operations.ReadCurrentRunLogsResponse, error) { - request := operations.ReadCurrentRunLogsRequest{ - ID: id, +// ReadDeployment - Get a single deployment +func (s *DeployServer) ReadDeployment(ctx context.Context, deploymentID string, include []operations.ReadDeploymentInclude, opts ...operations.Option) (*operations.ReadDeploymentResponse, error) { + request := operations.ReadDeploymentRequest{ + DeploymentID: deploymentID, + Include: include, } o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, operations.SupportedOptionTimeout, + operations.SupportedOptionAcceptHeaderOverride, } for _, opt := range opts { @@ -3920,7 +5214,7 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/run/logs", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/deployments/{deploymentId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -3930,9 +5224,9 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readCurrentRunLogs", + OperationID: "readDeployment", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -3950,9 +5244,22 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "application/json;q=1, application/yaml;q=0") + } + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + for k, v := range o.SetHeaders { req.Header.Set(k, v) } @@ -4048,7 +5355,7 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . } } - res := &operations.ReadCurrentRunLogsResponse{ + res := &operations.ReadDeploymentResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -4064,12 +5371,16 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . return nil, err } - var out components.ReadLogsResponse + var out components.DeploymentResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadLogsResponse = &out + res.DeploymentResponse = &out + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/yaml`): + res.ResponseStream = httpRes.Body + + return res, nil default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -4116,18 +5427,16 @@ func (s *DeployServer) ReadCurrentRunLogs(ctx context.Context, id string, opts . } -// ReadCurrentAppVersion - Get the current version of an app -func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, from *operations.From, opts ...operations.Option) (*operations.ReadCurrentAppVersionResponse, error) { - request := operations.ReadCurrentAppVersionRequest{ - ID: id, - From: from, +// ReadDeploymentLogs - Get run logs for a deployment +func (s *DeployServer) ReadDeploymentLogs(ctx context.Context, deploymentID string, opts ...operations.Option) (*operations.ReadDeploymentLogsResponse, error) { + request := operations.ReadDeploymentLogsRequest{ + DeploymentID: deploymentID, } o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, operations.SupportedOptionTimeout, - operations.SupportedOptionAcceptHeaderOverride, } for _, opt := range opts { @@ -4142,7 +5451,7 @@ func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, fro } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/apps/{id}/version", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/deployments/{deploymentId}/logs", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -4152,9 +5461,9 @@ func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, fro SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "readCurrentAppVersion", + OperationID: "readDeploymentLogs", OAuth2Scopes: nil, - SecuritySource: nil, + SecuritySource: s.sdkConfiguration.Security, } timeout := o.Timeout @@ -4172,16 +5481,11 @@ func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, fro if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - if o.AcceptHeaderOverride != nil { - req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) - } else { - req.Header.Set("Accept", "application/json;q=1, application/yaml;q=0.7, application/gzip;q=0") - } - + req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err } for k, v := range o.SetHeaders { @@ -4279,7 +5583,7 @@ func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, fro } } - res := &operations.ReadCurrentAppVersionResponse{ + res := &operations.ReadDeploymentLogsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -4295,20 +5599,12 @@ func (s *DeployServer) ReadCurrentAppVersion(ctx context.Context, id string, fro return nil, err } - var out components.AppVersionResponse + var out components.ReadLogsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AppVersionResponse = &out - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/gzip`): - res.TwoHundredApplicationGzipResponseStream = httpRes.Body - - return res, nil - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/yaml`): - res.TwoHundredApplicationYamlResponseStream = httpRes.Body - - return res, nil + res.ReadLogsResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/internal/deployserverclient/docs/models/components/pool.md b/internal/deployserverclient/docs/models/apierrors/error.md similarity index 62% rename from internal/deployserverclient/docs/models/components/pool.md rename to internal/deployserverclient/docs/models/apierrors/error.md index d9dc4914..5450343d 100644 --- a/internal/deployserverclient/docs/models/components/pool.md +++ b/internal/deployserverclient/docs/models/apierrors/error.md @@ -1,9 +1,9 @@ -# Pool +# Error ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `AccountIds` | []`string` | :heavy_minus_sign: | N/A | -| `Query` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ErrorCode` | `string` | :heavy_check_mark: | N/A | +| `ErrorMessage` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/app.md b/internal/deployserverclient/docs/models/components/app.md index a22cba38..c77eac6a 100644 --- a/internal/deployserverclient/docs/models/components/app.md +++ b/internal/deployserverclient/docs/models/components/app.md @@ -3,9 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the app | -| `Name` | `string` | :heavy_check_mark: | Name of the app | -| `CurrentConfigurationVersion` | [*components.ConfigurationVersion](../../models/components/configurationversion.md) | :heavy_minus_sign: | N/A | -| `CurrentRun` | [*components.Run](../../models/components/run.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the app | +| `Name` | `string` | :heavy_check_mark: | Name of the app | +| `StackID` | `*string` | :heavy_minus_sign: | Optional existing stack ID claimed by this app | +| `StackRegionID` | `*string` | :heavy_minus_sign: | Stack region ID (set when the app's stack lives in a specific region) | +| `State` | [*components.State](../../models/components/state.md) | :heavy_minus_sign: | N/A | +| `CurrentManifest` | [*components.AppCurrentManifest](../../models/components/appcurrentmanifest.md) | :heavy_minus_sign: | The manifest the app is currently bound to (apps.manifest_id), with
catalog metadata and divergence vs the most recent applied deployment.
Populated by GET /apps/{id} when a manifest is bound.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/appcurrentmanifest.md b/internal/deployserverclient/docs/models/components/appcurrentmanifest.md new file mode 100644 index 00000000..8d2c8375 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/appcurrentmanifest.md @@ -0,0 +1,16 @@ +# AppCurrentManifest + +The manifest the app is currently bound to (apps.manifest_id), with +catalog metadata and divergence vs the most recent applied deployment. +Populated by GET /apps/{id} when a manifest is bound. + + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | ID of the manifest the app is bound to | +| `Name` | `string` | :heavy_check_mark: | Name of the bound manifest | +| `LatestVersion` | `int64` | :heavy_check_mark: | Latest version available in the manifest's lineage | +| `Divergence` | [*components.AppManifestDivergence](../../models/components/appmanifestdivergence.md) | :heavy_minus_sign: | Relationship between the app's bound manifest and what's currently
deployed (last `applied` deployment, ignoring destroys).
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/application.md b/internal/deployserverclient/docs/models/components/application.md deleted file mode 100644 index ff0d6629..00000000 --- a/internal/deployserverclient/docs/models/components/application.md +++ /dev/null @@ -1,12 +0,0 @@ -# Application - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `Ledgers` | [][components.Ledger](../../models/components/ledger.md) | :heavy_minus_sign: | N/A | -| `Payments` | [*components.Payments](../../models/components/payments.md) | :heavy_minus_sign: | N/A | -| `Reconciliation` | [*components.Reconciliation](../../models/components/reconciliation.md) | :heavy_minus_sign: | N/A | -| `Stack` | [components.Stack](../../models/components/stack.md) | :heavy_check_mark: | N/A | -| `Webhooks` | [][components.Webhook](../../models/components/webhook.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/appmanifestdivergence.md b/internal/deployserverclient/docs/models/components/appmanifestdivergence.md new file mode 100644 index 00000000..92ae72e8 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/appmanifestdivergence.md @@ -0,0 +1,15 @@ +# AppManifestDivergence + +Relationship between the app's bound manifest and what's currently +deployed (last `applied` deployment, ignoring destroys). + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Kind` | [components.Kind](../../models/components/kind.md) | :heavy_check_mark: | - `undeployed`: the app has a manifest bound but no successful deployment yet.
- `synced`: deployed (manifestId, version) matches the bound manifest's latest version.
- `behind`: deployed manifest matches the bound manifest but on an older version.
- `rebound`: the app was rebound; deployed manifest is a different manifest.
| +| `DeployedManifestID` | `*string` | :heavy_minus_sign: | ID of the manifest reflected in the most recent applied deployment | +| `DeployedVersion` | `*int64` | :heavy_minus_sign: | Version reflected in the most recent applied deployment | +| `LatestVersion` | `int64` | :heavy_check_mark: | Latest version available in the bound manifest's lineage | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/appversionresponse.md b/internal/deployserverclient/docs/models/components/appversionresponse.md deleted file mode 100644 index 0d154583..00000000 --- a/internal/deployserverclient/docs/models/components/appversionresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# AppVersionResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Data` | [components.ConfigurationVersion](../../models/components/configurationversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/attachmanifestrequest.md b/internal/deployserverclient/docs/models/components/attachmanifestrequest.md new file mode 100644 index 00000000..b1ecb225 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/attachmanifestrequest.md @@ -0,0 +1,8 @@ +# AttachManifestRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `ManifestID` | `string` | :heavy_check_mark: | ID of the manifest to bind to the app | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/configurationversion.md b/internal/deployserverclient/docs/models/components/configurationversion.md deleted file mode 100644 index 66bd7ff6..00000000 --- a/internal/deployserverclient/docs/models/components/configurationversion.md +++ /dev/null @@ -1,12 +0,0 @@ -# ConfigurationVersion - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the configuration version | -| `AutoQueueRuns` | `bool` | :heavy_check_mark: | Auto queue runs when a new version is uploaded | -| `Error` | `string` | :heavy_check_mark: | Error code if the version is in an error state | -| `ErrorMessage` | `string` | :heavy_check_mark: | Error message if the version is in an error state | -| `Status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/connector.md b/internal/deployserverclient/docs/models/components/connector.md deleted file mode 100644 index fce666c8..00000000 --- a/internal/deployserverclient/docs/models/components/connector.md +++ /dev/null @@ -1,11 +0,0 @@ -# Connector - - -## Fields - -| Field | Type | Required | Description | -| ------------------- | ------------------- | ------------------- | ------------------- | -| `Configuration` | map[string]`any` | :heavy_minus_sign: | N/A | -| `Credentials` | map[string]`string` | :heavy_minus_sign: | N/A | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Provider` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/createapprequest.md b/internal/deployserverclient/docs/models/components/createapprequest.md index 5bc2c5c9..8d2ae919 100644 --- a/internal/deployserverclient/docs/models/components/createapprequest.md +++ b/internal/deployserverclient/docs/models/components/createapprequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| `OrganizationID` | `string` | :heavy_check_mark: | ID of the organization to which the app belongs | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `Name` | `string` | :heavy_check_mark: | Name of the app | +| `StackID` | `*string` | :heavy_minus_sign: | Optional existing stack ID to claim | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/createdeploymentrequest.md b/internal/deployserverclient/docs/models/components/createdeploymentrequest.md new file mode 100644 index 00000000..03f669eb --- /dev/null +++ b/internal/deployserverclient/docs/models/components/createdeploymentrequest.md @@ -0,0 +1,10 @@ +# CreateDeploymentRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `AppID` | `string` | :heavy_check_mark: | ID of the app to deploy to | +| `ManifestID` | `string` | :heavy_check_mark: | Manifest catalog ID | +| `ManifestVersion` | `int64` | :heavy_check_mark: | Manifest version | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/createmanifestresponse.md b/internal/deployserverclient/docs/models/components/createmanifestresponse.md new file mode 100644 index 00000000..c686febb --- /dev/null +++ b/internal/deployserverclient/docs/models/components/createmanifestresponse.md @@ -0,0 +1,8 @@ +# CreateManifestResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `Data` | [components.Data](../../models/components/data.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/data.md b/internal/deployserverclient/docs/models/components/data.md new file mode 100644 index 00000000..f1767725 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/data.md @@ -0,0 +1,11 @@ +# Data + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Version` | `int64` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/deleteappresponse.md b/internal/deployserverclient/docs/models/components/deleteappresponse.md new file mode 100644 index 00000000..0d8b766a --- /dev/null +++ b/internal/deployserverclient/docs/models/components/deleteappresponse.md @@ -0,0 +1,8 @@ +# DeleteAppResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DestroyDeploymentID` | `*string` | :heavy_minus_sign: | ID of the destroy deployment enqueued to clean up the app's
resources. Empty when no destroy was needed (e.g. no prior
applied deployment). Use `GET /deployments/{id}` to poll its
status.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/deploymentresource.md b/internal/deployserverclient/docs/models/components/deploymentresource.md new file mode 100644 index 00000000..4bf3d77b --- /dev/null +++ b/internal/deployserverclient/docs/models/components/deploymentresource.md @@ -0,0 +1,15 @@ +# DeploymentResource + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `AppID` | `string` | :heavy_check_mark: | N/A | +| `ManifestID` | `*string` | :heavy_minus_sign: | N/A | +| `ManifestVersion` | `*int64` | :heavy_minus_sign: | N/A | +| `Status` | `string` | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `State` | [*components.State](../../models/components/state.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/deploymentresponse.md b/internal/deployserverclient/docs/models/components/deploymentresponse.md new file mode 100644 index 00000000..e5a1bb0f --- /dev/null +++ b/internal/deployserverclient/docs/models/components/deploymentresponse.md @@ -0,0 +1,8 @@ +# DeploymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Data` | [components.DeploymentResource](../../models/components/deploymentresource.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/kind.md b/internal/deployserverclient/docs/models/components/kind.md new file mode 100644 index 00000000..983f988a --- /dev/null +++ b/internal/deployserverclient/docs/models/components/kind.md @@ -0,0 +1,27 @@ +# Kind + +- `undeployed`: the app has a manifest bound but no successful deployment yet. +- `synced`: deployed (manifestId, version) matches the bound manifest's latest version. +- `behind`: deployed manifest matches the bound manifest but on an older version. +- `rebound`: the app was rebound; deployed manifest is a different manifest. + + +## Example Usage + +```go +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +value := components.KindUndeployed +``` + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `KindUndeployed` | undeployed | +| `KindSynced` | synced | +| `KindBehind` | behind | +| `KindRebound` | rebound | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/ledger.md b/internal/deployserverclient/docs/models/components/ledger.md deleted file mode 100644 index cc0f331e..00000000 --- a/internal/deployserverclient/docs/models/components/ledger.md +++ /dev/null @@ -1,9 +0,0 @@ -# Ledger - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Schema` | map[string][components.V2SchemaData](../../models/components/v2schemadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listappsresponse.md b/internal/deployserverclient/docs/models/components/listappsresponse.md index 60800496..99147c1a 100644 --- a/internal/deployserverclient/docs/models/components/listappsresponse.md +++ b/internal/deployserverclient/docs/models/components/listappsresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Data` | [components.ListAppsResponseData](../../models/components/listappsresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Cursor` | [components.ListAppsResponseCursor](../../models/components/listappsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listappsresponsecursor.md b/internal/deployserverclient/docs/models/components/listappsresponsecursor.md new file mode 100644 index 00000000..93de1454 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listappsresponsecursor.md @@ -0,0 +1,18 @@ +# ListAppsResponseCursor + +Cursor pagination envelope. `next` and `previous` are opaque tokens +produced by the server; pass them back as `?cursor=` to fetch the +adjacent page. `hasMore` is `true` when more results exist after the +current page. `pageSize` echoes the page size used for this page. + + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Number of items requested for this page | +| `HasMore` | `bool` | :heavy_check_mark: | True when more results exist after this page | +| `Previous` | `*string` | :heavy_minus_sign: | Opaque cursor token for the previous page (empty when none) | +| `Next` | `*string` | :heavy_minus_sign: | Opaque cursor token for the next page (empty when none) | +| `Data` | [][components.App](../../models/components/app.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listappsresponsedata.md b/internal/deployserverclient/docs/models/components/listappsresponsedata.md deleted file mode 100644 index 8a07dd0a..00000000 --- a/internal/deployserverclient/docs/models/components/listappsresponsedata.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListAppsResponseData - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `CurrentPage` | `*int64` | :heavy_minus_sign: | Current page number | -| `PreviousPage` | `*int64` | :heavy_minus_sign: | Previous page number | -| `NextPage` | `*int64` | :heavy_minus_sign: | Next page number | -| `TotalPages` | `*int64` | :heavy_minus_sign: | Total number of pages | -| `TotalCount` | `*int64` | :heavy_minus_sign: | Total number of items | -| `Items` | [][components.App](../../models/components/app.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listdeploymentsresponse.md b/internal/deployserverclient/docs/models/components/listdeploymentsresponse.md new file mode 100644 index 00000000..2ce25a39 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listdeploymentsresponse.md @@ -0,0 +1,8 @@ +# ListDeploymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Cursor` | [components.ListDeploymentsResponseCursor](../../models/components/listdeploymentsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listdeploymentsresponsecursor.md b/internal/deployserverclient/docs/models/components/listdeploymentsresponsecursor.md new file mode 100644 index 00000000..2baeeaa9 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listdeploymentsresponsecursor.md @@ -0,0 +1,18 @@ +# ListDeploymentsResponseCursor + +Cursor pagination envelope. `next` and `previous` are opaque tokens +produced by the server; pass them back as `?cursor=` to fetch the +adjacent page. `hasMore` is `true` when more results exist after the +current page. `pageSize` echoes the page size used for this page. + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Number of items requested for this page | +| `HasMore` | `bool` | :heavy_check_mark: | True when more results exist after this page | +| `Previous` | `*string` | :heavy_minus_sign: | Opaque cursor token for the previous page (empty when none) | +| `Next` | `*string` | :heavy_minus_sign: | Opaque cursor token for the next page (empty when none) | +| `Data` | [][components.DeploymentResource](../../models/components/deploymentresource.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listmanifestsresponse.md b/internal/deployserverclient/docs/models/components/listmanifestsresponse.md new file mode 100644 index 00000000..74d925c6 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listmanifestsresponse.md @@ -0,0 +1,8 @@ +# ListManifestsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Cursor` | [components.ListManifestsResponseCursor](../../models/components/listmanifestsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listmanifestsresponsecursor.md b/internal/deployserverclient/docs/models/components/listmanifestsresponsecursor.md new file mode 100644 index 00000000..1c70dee7 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listmanifestsresponsecursor.md @@ -0,0 +1,18 @@ +# ListManifestsResponseCursor + +Cursor pagination envelope. `next` and `previous` are opaque tokens +produced by the server; pass them back as `?cursor=` to fetch the +adjacent page. `hasMore` is `true` when more results exist after the +current page. `pageSize` echoes the page size used for this page. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `PageSize` | `*int64` | :heavy_minus_sign: | Number of items requested for this page | +| `HasMore` | `bool` | :heavy_check_mark: | True when more results exist after this page | +| `Previous` | `*string` | :heavy_minus_sign: | Opaque cursor token for the previous page (empty when none) | +| `Next` | `*string` | :heavy_minus_sign: | Opaque cursor token for the next page (empty when none) | +| `Data` | [][components.Manifest](../../models/components/manifest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listmanifestversionsresponse.md b/internal/deployserverclient/docs/models/components/listmanifestversionsresponse.md new file mode 100644 index 00000000..cdfc28ea --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listmanifestversionsresponse.md @@ -0,0 +1,8 @@ +# ListManifestVersionsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Cursor` | [components.ListManifestVersionsResponseCursor](../../models/components/listmanifestversionsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listmanifestversionsresponsecursor.md b/internal/deployserverclient/docs/models/components/listmanifestversionsresponsecursor.md new file mode 100644 index 00000000..3f829a1d --- /dev/null +++ b/internal/deployserverclient/docs/models/components/listmanifestversionsresponsecursor.md @@ -0,0 +1,18 @@ +# ListManifestVersionsResponseCursor + +Cursor pagination envelope. `next` and `previous` are opaque tokens +produced by the server; pass them back as `?cursor=` to fetch the +adjacent page. `hasMore` is `true` when more results exist after the +current page. `pageSize` echoes the page size used for this page. + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Number of items requested for this page | +| `HasMore` | `bool` | :heavy_check_mark: | True when more results exist after this page | +| `Previous` | `*string` | :heavy_minus_sign: | Opaque cursor token for the previous page (empty when none) | +| `Next` | `*string` | :heavy_minus_sign: | Opaque cursor token for the next page (empty when none) | +| `Data` | [][components.ManifestVersion](../../models/components/manifestversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listrunsresponse.md b/internal/deployserverclient/docs/models/components/listrunsresponse.md deleted file mode 100644 index 8751277e..00000000 --- a/internal/deployserverclient/docs/models/components/listrunsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListRunsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Data` | [components.ListRunsResponseData](../../models/components/listrunsresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listrunsresponsedata.md b/internal/deployserverclient/docs/models/components/listrunsresponsedata.md deleted file mode 100644 index d29d6c4d..00000000 --- a/internal/deployserverclient/docs/models/components/listrunsresponsedata.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListRunsResponseData - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `CurrentPage` | `*int64` | :heavy_minus_sign: | Current page number | -| `PreviousPage` | `*int64` | :heavy_minus_sign: | Previous page number | -| `NextPage` | `*int64` | :heavy_minus_sign: | Next page number | -| `TotalPages` | `*int64` | :heavy_minus_sign: | Total number of pages | -| `TotalCount` | `*int64` | :heavy_minus_sign: | Total number of items | -| `Items` | [][components.Run](../../models/components/run.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listversionsresponse.md b/internal/deployserverclient/docs/models/components/listversionsresponse.md deleted file mode 100644 index 5c0505ae..00000000 --- a/internal/deployserverclient/docs/models/components/listversionsresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListVersionsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `Data` | [components.ListVersionsResponseData](../../models/components/listversionsresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/listversionsresponsedata.md b/internal/deployserverclient/docs/models/components/listversionsresponsedata.md deleted file mode 100644 index 4da3b6ad..00000000 --- a/internal/deployserverclient/docs/models/components/listversionsresponsedata.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListVersionsResponseData - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `CurrentPage` | `*int64` | :heavy_minus_sign: | Current page number | -| `PreviousPage` | `*int64` | :heavy_minus_sign: | Previous page number | -| `NextPage` | `*int64` | :heavy_minus_sign: | Next page number | -| `TotalPages` | `*int64` | :heavy_minus_sign: | Total number of pages | -| `TotalCount` | `*int64` | :heavy_minus_sign: | Total number of items | -| `Items` | [][components.ConfigurationVersion](../../models/components/configurationversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/manifest.md b/internal/deployserverclient/docs/models/components/manifest.md new file mode 100644 index 00000000..407cb573 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/manifest.md @@ -0,0 +1,12 @@ +# Manifest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the manifest | +| `Name` | `string` | :heavy_check_mark: | Name of the manifest | +| `LatestVersion` | `int64` | :heavy_check_mark: | Latest version number | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Timestamp when the manifest was created | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Timestamp when the manifest was last updated | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/manifestresponse.md b/internal/deployserverclient/docs/models/components/manifestresponse.md new file mode 100644 index 00000000..30a0ca2d --- /dev/null +++ b/internal/deployserverclient/docs/models/components/manifestresponse.md @@ -0,0 +1,8 @@ +# ManifestResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Data` | [components.Manifest](../../models/components/manifest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/manifestversion.md b/internal/deployserverclient/docs/models/components/manifestversion.md new file mode 100644 index 00000000..608ea35c --- /dev/null +++ b/internal/deployserverclient/docs/models/components/manifestversion.md @@ -0,0 +1,11 @@ +# ManifestVersion + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `ManifestID` | `string` | :heavy_check_mark: | ID of the manifest this version belongs to | +| `Version` | `int64` | :heavy_check_mark: | Version number | +| `Content` | `*string` | :heavy_minus_sign: | Manifest content (base64-encoded). Null when listing versions, present when reading a specific version. | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Timestamp when the version was created | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/manifestversionresponse.md b/internal/deployserverclient/docs/models/components/manifestversionresponse.md new file mode 100644 index 00000000..fe14fcbd --- /dev/null +++ b/internal/deployserverclient/docs/models/components/manifestversionresponse.md @@ -0,0 +1,8 @@ +# ManifestVersionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Data` | [components.ManifestVersion](../../models/components/manifestversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/payments.md b/internal/deployserverclient/docs/models/components/payments.md deleted file mode 100644 index 2f9fcb61..00000000 --- a/internal/deployserverclient/docs/models/components/payments.md +++ /dev/null @@ -1,9 +0,0 @@ -# Payments - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `Connectors` | [][components.Connector](../../models/components/connector.md) | :heavy_minus_sign: | N/A | -| `Pools` | map[string][components.Pool](../../models/components/pool.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/readstateresponse.md b/internal/deployserverclient/docs/models/components/readstateresponse.md deleted file mode 100644 index 9562394d..00000000 --- a/internal/deployserverclient/docs/models/components/readstateresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReadStateResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `Data` | [components.State](../../models/components/state.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/readvariablesresponse.md b/internal/deployserverclient/docs/models/components/readvariablesresponse.md index dca4b95b..56f1ad49 100644 --- a/internal/deployserverclient/docs/models/components/readvariablesresponse.md +++ b/internal/deployserverclient/docs/models/components/readvariablesresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Data` | [components.ReadVariablesResponseData](../../models/components/readvariablesresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Cursor` | [components.ReadVariablesResponseCursor](../../models/components/readvariablesresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/readvariablesresponsecursor.md b/internal/deployserverclient/docs/models/components/readvariablesresponsecursor.md new file mode 100644 index 00000000..cc317df0 --- /dev/null +++ b/internal/deployserverclient/docs/models/components/readvariablesresponsecursor.md @@ -0,0 +1,18 @@ +# ReadVariablesResponseCursor + +Cursor pagination envelope. `next` and `previous` are opaque tokens +produced by the server; pass them back as `?cursor=` to fetch the +adjacent page. `hasMore` is `true` when more results exist after the +current page. `pageSize` echoes the page size used for this page. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `PageSize` | `*int64` | :heavy_minus_sign: | Number of items requested for this page | +| `HasMore` | `bool` | :heavy_check_mark: | True when more results exist after this page | +| `Previous` | `*string` | :heavy_minus_sign: | Opaque cursor token for the previous page (empty when none) | +| `Next` | `*string` | :heavy_minus_sign: | Opaque cursor token for the next page (empty when none) | +| `Data` | [][components.Variable](../../models/components/variable.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/readvariablesresponsedata.md b/internal/deployserverclient/docs/models/components/readvariablesresponsedata.md deleted file mode 100644 index a8e3d430..00000000 --- a/internal/deployserverclient/docs/models/components/readvariablesresponsedata.md +++ /dev/null @@ -1,13 +0,0 @@ -# ReadVariablesResponseData - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `Items` | [][components.Variable](../../models/components/variable.md) | :heavy_minus_sign: | N/A | -| `CurrentPage` | `*int64` | :heavy_minus_sign: | Current page number | -| `PreviousPage` | `*int64` | :heavy_minus_sign: | Previous page number | -| `NextPage` | `*int64` | :heavy_minus_sign: | Next page number | -| `TotalPages` | `*int64` | :heavy_minus_sign: | Total number of pages | -| `TotalCount` | `*int64` | :heavy_minus_sign: | Total number of items | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/reconciliationledger.md b/internal/deployserverclient/docs/models/components/reconciliationledger.md deleted file mode 100644 index 9533b09c..00000000 --- a/internal/deployserverclient/docs/models/components/reconciliationledger.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReconciliationLedger - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Query` | map[string]`any` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/reconciliationpolicy.md b/internal/deployserverclient/docs/models/components/reconciliationpolicy.md deleted file mode 100644 index f27b97c3..00000000 --- a/internal/deployserverclient/docs/models/components/reconciliationpolicy.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReconciliationPolicy - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Ledger` | [components.ReconciliationLedger](../../models/components/reconciliationledger.md) | :heavy_check_mark: | N/A | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Pool` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/regionselector.md b/internal/deployserverclient/docs/models/components/regionselector.md deleted file mode 100644 index f139fa74..00000000 --- a/internal/deployserverclient/docs/models/components/regionselector.md +++ /dev/null @@ -1,9 +0,0 @@ -# RegionSelector - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `*string` | :heavy_minus_sign: | N/A | -| `Name` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/run.md b/internal/deployserverclient/docs/models/components/run.md deleted file mode 100644 index b54edaa2..00000000 --- a/internal/deployserverclient/docs/models/components/run.md +++ /dev/null @@ -1,19 +0,0 @@ -# Run - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the run | -| `AutoApply` | `bool` | :heavy_check_mark: | Whether the run was auto-applied | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Timestamp when the run was created | -| `IsDestroy` | `bool` | :heavy_check_mark: | Whether the run is a destroy operation | -| `HasChanges` | `bool` | :heavy_check_mark: | Whether the run has changes | -| `Message` | `string` | :heavy_check_mark: | Message associated with the run | -| `PlanOnly` | `bool` | :heavy_check_mark: | Whether the run is a plan-only operation | -| `Refresh` | `bool` | :heavy_check_mark: | Whether the run is a refresh operation | -| `RefreshOnly` | `bool` | :heavy_check_mark: | Whether the run is a refresh-only operation | -| `SavePlan` | `bool` | :heavy_check_mark: | Whether the run saves the plan | -| `Status` | `string` | :heavy_check_mark: | Status of the run | -| `ConfigurationVersion` | [*components.ConfigurationVersion](../../models/components/configurationversion.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/runresponse.md b/internal/deployserverclient/docs/models/components/runresponse.md deleted file mode 100644 index cf19aff0..00000000 --- a/internal/deployserverclient/docs/models/components/runresponse.md +++ /dev/null @@ -1,8 +0,0 @@ -# RunResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `Data` | [components.Run](../../models/components/run.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readrunrequest.md b/internal/deployserverclient/docs/models/components/security.md similarity index 71% rename from internal/deployserverclient/docs/models/operations/readrunrequest.md rename to internal/deployserverclient/docs/models/components/security.md index 70575144..c15c11e5 100644 --- a/internal/deployserverclient/docs/models/operations/readrunrequest.md +++ b/internal/deployserverclient/docs/models/components/security.md @@ -1,8 +1,8 @@ -# ReadRunRequest +# Security ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file +| `BearerAuth` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/stack.md b/internal/deployserverclient/docs/models/components/stack.md deleted file mode 100644 index eba39fff..00000000 --- a/internal/deployserverclient/docs/models/components/stack.md +++ /dev/null @@ -1,10 +0,0 @@ -# Stack - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Region` | [components.RegionSelector](../../models/components/regionselector.md) | :heavy_check_mark: | N/A | -| `Version` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/state.md b/internal/deployserverclient/docs/models/components/state.md index 1cf3a814..4e5096c4 100644 --- a/internal/deployserverclient/docs/models/components/state.md +++ b/internal/deployserverclient/docs/models/components/state.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `Stack` | map[string]`any` | :heavy_check_mark: | The stack details from the Terraform state | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Stack` | map[string]`any` | :heavy_check_mark: | The live stack details reported by Formance Cloud (a projection of
the bound stack from Membership). Shape is a free-form object
mirroring the upstream stack resource.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/status.md b/internal/deployserverclient/docs/models/components/status.md deleted file mode 100644 index 9ae23ca0..00000000 --- a/internal/deployserverclient/docs/models/components/status.md +++ /dev/null @@ -1,23 +0,0 @@ -# Status - -## Example Usage - -```go -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -value := components.StatusArchived -``` - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `StatusArchived` | archived | -| `StatusErrored` | errored | -| `StatusPending` | pending | -| `StatusFetching` | fetching | -| `StatusUploaded` | uploaded | -| `StatusUnknown` | | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/updateapprequest.md b/internal/deployserverclient/docs/models/components/updateapprequest.md index c5cfdb62..61637f46 100644 --- a/internal/deployserverclient/docs/models/components/updateapprequest.md +++ b/internal/deployserverclient/docs/models/components/updateapprequest.md @@ -3,5 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Name` | `string` | :heavy_check_mark: | Updated name for the app | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/updatemanifestrequest.md b/internal/deployserverclient/docs/models/components/updatemanifestrequest.md new file mode 100644 index 00000000..2df4cefa --- /dev/null +++ b/internal/deployserverclient/docs/models/components/updatemanifestrequest.md @@ -0,0 +1,8 @@ +# UpdateManifestRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `Name` | `string` | :heavy_check_mark: | Updated name for the manifest | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/v2chartsegment.md b/internal/deployserverclient/docs/models/components/v2chartsegment.md deleted file mode 100644 index 7358c3d3..00000000 --- a/internal/deployserverclient/docs/models/components/v2chartsegment.md +++ /dev/null @@ -1,12 +0,0 @@ -# V2ChartSegment - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `DotMetadata` | map[string][components.V2ChartAccountMetadata](../../models/components/v2chartaccountmetadata.md) | :heavy_minus_sign: | N/A | -| `DotPattern` | `*string` | :heavy_minus_sign: | N/A | -| `DotRules` | [*components.V2ChartAccountRules](../../models/components/v2chartaccountrules.md) | :heavy_minus_sign: | N/A | -| `DotSelf` | [*components.DotSelf](../../models/components/dotself.md) | :heavy_minus_sign: | N/A | -| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/v2schemadata.md b/internal/deployserverclient/docs/models/components/v2schemadata.md deleted file mode 100644 index ace0af48..00000000 --- a/internal/deployserverclient/docs/models/components/v2schemadata.md +++ /dev/null @@ -1,9 +0,0 @@ -# V2SchemaData - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Chart` | map[string][components.V2ChartSegment](../../models/components/v2chartsegment.md) | :heavy_minus_sign: | N/A | -| `Transactions` | map[string][components.V2TransactionTemplate](../../models/components/v2transactiontemplate.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/v2transactiontemplate.md b/internal/deployserverclient/docs/models/components/v2transactiontemplate.md deleted file mode 100644 index a11f6f3b..00000000 --- a/internal/deployserverclient/docs/models/components/v2transactiontemplate.md +++ /dev/null @@ -1,10 +0,0 @@ -# V2TransactionTemplate - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Description` | `*string` | :heavy_minus_sign: | N/A | -| `Runtime` | `*string` | :heavy_minus_sign: | N/A | -| `Script` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/variable.md b/internal/deployserverclient/docs/models/components/variable.md index 6fc3df29..3f697c82 100644 --- a/internal/deployserverclient/docs/models/components/variable.md +++ b/internal/deployserverclient/docs/models/components/variable.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `Key` | `string` | :heavy_check_mark: | Key of the variable | -| `Value` | `string` | :heavy_check_mark: | Value of the variable | -| `Description` | `*string` | :heavy_minus_sign: | Description of the variable | -| `Sensitive` | `bool` | :heavy_check_mark: | Whether the variable is sensitive | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the variable | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Key` | `string` | :heavy_check_mark: | Snake-case identifier (case-insensitive at the API boundary,
normalized to lowercase on storage to match `var.` in the
generated HCL). Either `MONEYCORP_API_KEY` or
`moneycorp_api_key` is accepted.
| +| `Value` | `string` | :heavy_check_mark: | Value of the variable. Always treated as sensitive: `value` is
redacted (`REDACTED`) on every read endpoint.
| +| `Description` | `*string` | :heavy_minus_sign: | Description of the variable | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the variable | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/variabledata.md b/internal/deployserverclient/docs/models/components/variabledata.md index e6528690..42c414ca 100644 --- a/internal/deployserverclient/docs/models/components/variabledata.md +++ b/internal/deployserverclient/docs/models/components/variabledata.md @@ -3,9 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | -| `Key` | `string` | :heavy_check_mark: | Key of the variable | -| `Value` | `string` | :heavy_check_mark: | Value of the variable | -| `Description` | `*string` | :heavy_minus_sign: | Description of the variable | -| `Sensitive` | `bool` | :heavy_check_mark: | Whether the variable is sensitive | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Key` | `string` | :heavy_check_mark: | Snake-case identifier (case-insensitive at the API boundary,
normalized to lowercase on storage to match `var.` in the
generated HCL). Either `MONEYCORP_API_KEY` or
`moneycorp_api_key` is accepted.
| +| `Value` | `string` | :heavy_check_mark: | Value of the variable. Always treated as sensitive: `value` is
redacted (`REDACTED`) on every read endpoint.
| +| `Description` | `*string` | :heavy_minus_sign: | Description of the variable | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/webhook.md b/internal/deployserverclient/docs/models/components/webhook.md deleted file mode 100644 index 32e7fd85..00000000 --- a/internal/deployserverclient/docs/models/components/webhook.md +++ /dev/null @@ -1,11 +0,0 @@ -# Webhook - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Endpoint` | `string` | :heavy_check_mark: | N/A | -| `Events` | []`string` | :heavy_minus_sign: | N/A | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Secret` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/attachappmanifestrequest.md b/internal/deployserverclient/docs/models/operations/attachappmanifestrequest.md new file mode 100644 index 00000000..9a803bad --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/attachappmanifestrequest.md @@ -0,0 +1,9 @@ +# AttachAppManifestRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `AttachManifestRequest` | [components.AttachManifestRequest](../../models/components/attachmanifestrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentrunresponse.md b/internal/deployserverclient/docs/models/operations/attachappmanifestresponse.md similarity index 74% rename from internal/deployserverclient/docs/models/operations/readcurrentrunresponse.md rename to internal/deployserverclient/docs/models/operations/attachappmanifestresponse.md index f7baf2fd..58ad5c5b 100644 --- a/internal/deployserverclient/docs/models/operations/readcurrentrunresponse.md +++ b/internal/deployserverclient/docs/models/operations/attachappmanifestresponse.md @@ -1,4 +1,4 @@ -# ReadCurrentRunResponse +# AttachAppManifestResponse ## Fields @@ -6,5 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `RunResponse` | [*components.RunResponse](../../models/components/runresponse.md) | :heavy_minus_sign: | Current run retrieved successfully | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | manifestId missing or empty | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentappversionresponse.md b/internal/deployserverclient/docs/models/operations/createdeploymentresponse.md similarity index 57% rename from internal/deployserverclient/docs/models/operations/readcurrentappversionresponse.md rename to internal/deployserverclient/docs/models/operations/createdeploymentresponse.md index beb7ed13..d6be3430 100644 --- a/internal/deployserverclient/docs/models/operations/readcurrentappversionresponse.md +++ b/internal/deployserverclient/docs/models/operations/createdeploymentresponse.md @@ -1,4 +1,4 @@ -# ReadCurrentAppVersionResponse +# CreateDeploymentResponse ## Fields @@ -6,7 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `AppVersionResponse` | [*components.AppVersionResponse](../../models/components/appversionresponse.md) | :heavy_minus_sign: | Current app version retrieved successfully | -| `TwoHundredApplicationGzipResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | Current app version retrieved successfully | -| `TwoHundredApplicationYamlResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | Current app version retrieved successfully | +| `DeploymentResponse` | [*components.DeploymentResponse](../../models/components/deploymentresponse.md) | :heavy_minus_sign: | Deployment created successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/createmanifestrawrequest.md b/internal/deployserverclient/docs/models/operations/createmanifestrawrequest.md new file mode 100644 index 00000000..dc7c3123 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/createmanifestrawrequest.md @@ -0,0 +1,9 @@ +# CreateManifestRawRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `Name` | `string` | :heavy_check_mark: | Name for the manifest | +| `RequestBody` | `any` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/createmanifestrawresponse.md b/internal/deployserverclient/docs/models/operations/createmanifestrawresponse.md new file mode 100644 index 00000000..3e8b398e --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/createmanifestrawresponse.md @@ -0,0 +1,10 @@ +# CreateManifestRawResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `CreateManifestResponse` | [*components.CreateManifestResponse](../../models/components/createmanifestresponse.md) | :heavy_minus_sign: | Manifest created successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/createmanifestrequest.md b/internal/deployserverclient/docs/models/operations/createmanifestrequest.md new file mode 100644 index 00000000..319e78b7 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/createmanifestrequest.md @@ -0,0 +1,9 @@ +# CreateManifestRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Name` | `string` | :heavy_check_mark: | Name for the manifest | +| `RequestBody` | [operations.CreateManifestRequestBody](../../models/operations/createmanifestrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/v2chartaccountrules.md b/internal/deployserverclient/docs/models/operations/createmanifestrequestbody.md similarity index 71% rename from internal/deployserverclient/docs/models/components/v2chartaccountrules.md rename to internal/deployserverclient/docs/models/operations/createmanifestrequestbody.md index b79d01a9..6089e69c 100644 --- a/internal/deployserverclient/docs/models/components/v2chartaccountrules.md +++ b/internal/deployserverclient/docs/models/operations/createmanifestrequestbody.md @@ -1,4 +1,6 @@ -# V2ChartAccountRules +# CreateManifestRequestBody + +JSON manifest content ## Fields diff --git a/internal/deployserverclient/docs/models/operations/createmanifestresponse.md b/internal/deployserverclient/docs/models/operations/createmanifestresponse.md new file mode 100644 index 00000000..ea064c63 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/createmanifestresponse.md @@ -0,0 +1,10 @@ +# CreateManifestResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `CreateManifestResponse` | [*components.CreateManifestResponse](../../models/components/createmanifestresponse.md) | :heavy_minus_sign: | Manifest created successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/deleteapprequest.md b/internal/deployserverclient/docs/models/operations/deleteapprequest.md index 316a4d8d..63b4b8ba 100644 --- a/internal/deployserverclient/docs/models/operations/deleteapprequest.md +++ b/internal/deployserverclient/docs/models/operations/deleteapprequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Wait` | `*bool` | :heavy_minus_sign: | When `true`, the call blocks until the destroy deployment reaches a
terminal status. Default `false` (returns 202 Accepted).
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/deleteappresponse.md b/internal/deployserverclient/docs/models/operations/deleteappresponse.md index 5363fdba..41ecd5c7 100644 --- a/internal/deployserverclient/docs/models/operations/deleteappresponse.md +++ b/internal/deployserverclient/docs/models/operations/deleteappresponse.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `DeleteAppResponse` | [*components.DeleteAppResponse](../../models/components/deleteappresponse.md) | :heavy_minus_sign: | Soft-delete accepted. Cleanup runs asynchronously. The
`Location` header points at the destroy deployment if one was
enqueued.
| +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readrunlogsrequest.md b/internal/deployserverclient/docs/models/operations/deletemanifestrequest.md similarity index 70% rename from internal/deployserverclient/docs/models/operations/readrunlogsrequest.md rename to internal/deployserverclient/docs/models/operations/deletemanifestrequest.md index 38e600c0..26341ed1 100644 --- a/internal/deployserverclient/docs/models/operations/readrunlogsrequest.md +++ b/internal/deployserverclient/docs/models/operations/deletemanifestrequest.md @@ -1,8 +1,8 @@ -# ReadRunLogsRequest +# DeleteManifestRequest ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file +| `ManifestID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/deployappconfigurationresponse.md b/internal/deployserverclient/docs/models/operations/deletemanifestresponse.md similarity index 73% rename from internal/deployserverclient/docs/models/operations/deployappconfigurationresponse.md rename to internal/deployserverclient/docs/models/operations/deletemanifestresponse.md index 46edd9bc..e8a81fae 100644 --- a/internal/deployserverclient/docs/models/operations/deployappconfigurationresponse.md +++ b/internal/deployserverclient/docs/models/operations/deletemanifestresponse.md @@ -1,4 +1,4 @@ -# DeployAppConfigurationResponse +# DeleteManifestResponse ## Fields @@ -6,5 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `RunResponse` | [*components.RunResponse](../../models/components/runresponse.md) | :heavy_minus_sign: | App configuration deployed successfully | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Manifest is still referenced by deployments | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/deployappconfigurationrawresponse.md b/internal/deployserverclient/docs/models/operations/deployappconfigurationrawresponse.md deleted file mode 100644 index 904ecb0a..00000000 --- a/internal/deployserverclient/docs/models/operations/deployappconfigurationrawresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeployAppConfigurationRawResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `RunResponse` | [*components.RunResponse](../../models/components/runresponse.md) | :heavy_minus_sign: | App configuration deployed successfully | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/deployappconfigurationrequest.md b/internal/deployserverclient/docs/models/operations/deployappconfigurationrequest.md deleted file mode 100644 index ed26f293..00000000 --- a/internal/deployserverclient/docs/models/operations/deployappconfigurationrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# DeployAppConfigurationRequest - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `ID` | `string` | :heavy_check_mark: | N/A | -| `Application` | [components.Application](../../models/components/application.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentrunrequest.md b/internal/deployserverclient/docs/models/operations/detachappmanifestrequest.md similarity index 90% rename from internal/deployserverclient/docs/models/operations/readcurrentrunrequest.md rename to internal/deployserverclient/docs/models/operations/detachappmanifestrequest.md index 70e92fc2..d11d0dba 100644 --- a/internal/deployserverclient/docs/models/operations/readcurrentrunrequest.md +++ b/internal/deployserverclient/docs/models/operations/detachappmanifestrequest.md @@ -1,4 +1,4 @@ -# ReadCurrentRunRequest +# DetachAppManifestRequest ## Fields diff --git a/internal/deployserverclient/docs/models/operations/readrunresponse.md b/internal/deployserverclient/docs/models/operations/detachappmanifestresponse.md similarity index 79% rename from internal/deployserverclient/docs/models/operations/readrunresponse.md rename to internal/deployserverclient/docs/models/operations/detachappmanifestresponse.md index dda55995..fbbd1f5a 100644 --- a/internal/deployserverclient/docs/models/operations/readrunresponse.md +++ b/internal/deployserverclient/docs/models/operations/detachappmanifestresponse.md @@ -1,4 +1,4 @@ -# ReadRunResponse +# DetachAppManifestResponse ## Fields @@ -6,5 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `RunResponse` | [*components.RunResponse](../../models/components/runresponse.md) | :heavy_minus_sign: | Run retrieved successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/from.md b/internal/deployserverclient/docs/models/operations/from.md deleted file mode 100644 index c334a966..00000000 --- a/internal/deployserverclient/docs/models/operations/from.md +++ /dev/null @@ -1,18 +0,0 @@ -# From - -## Example Usage - -```go -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" -) - -value := operations.FromState -``` - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `FromState` | state | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listappsrequest.md b/internal/deployserverclient/docs/models/operations/listappsrequest.md index 3316363e..11c97674 100644 --- a/internal/deployserverclient/docs/models/operations/listappsrequest.md +++ b/internal/deployserverclient/docs/models/operations/listappsrequest.md @@ -3,8 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `OrganizationID` | `string` | :heavy_check_mark: | N/A | -| `PageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `PageSize` | `*int64` | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listdeploymentsrequest.md b/internal/deployserverclient/docs/models/operations/listdeploymentsrequest.md new file mode 100644 index 00000000..2ee05d5a --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listdeploymentsrequest.md @@ -0,0 +1,10 @@ +# ListDeploymentsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AppID` | `*string` | :heavy_minus_sign: | N/A | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listdeploymentsresponse.md b/internal/deployserverclient/docs/models/operations/listdeploymentsresponse.md new file mode 100644 index 00000000..cc044400 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listdeploymentsresponse.md @@ -0,0 +1,10 @@ +# ListDeploymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ListDeploymentsResponse` | [*components.ListDeploymentsResponse](../../models/components/listdeploymentsresponse.md) | :heavy_minus_sign: | Deployments retrieved successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listmanifestsrequest.md b/internal/deployserverclient/docs/models/operations/listmanifestsrequest.md new file mode 100644 index 00000000..115e9ccb --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listmanifestsrequest.md @@ -0,0 +1,9 @@ +# ListManifestsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listmanifestsresponse.md b/internal/deployserverclient/docs/models/operations/listmanifestsresponse.md new file mode 100644 index 00000000..7bb7f793 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listmanifestsresponse.md @@ -0,0 +1,10 @@ +# ListManifestsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ListManifestsResponse` | [*components.ListManifestsResponse](../../models/components/listmanifestsresponse.md) | :heavy_minus_sign: | Manifests retrieved successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listmanifestversionsrequest.md b/internal/deployserverclient/docs/models/operations/listmanifestversionsrequest.md new file mode 100644 index 00000000..7200d26c --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listmanifestversionsrequest.md @@ -0,0 +1,10 @@ +# ListManifestVersionsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ManifestID` | `string` | :heavy_check_mark: | N/A | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/listmanifestversionsresponse.md b/internal/deployserverclient/docs/models/operations/listmanifestversionsresponse.md new file mode 100644 index 00000000..03497219 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/listmanifestversionsresponse.md @@ -0,0 +1,10 @@ +# ListManifestVersionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ListManifestVersionsResponse` | [*components.ListManifestVersionsResponse](../../models/components/listmanifestversionsresponse.md) | :heavy_minus_sign: | Manifest versions retrieved successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/option.md b/internal/deployserverclient/docs/models/operations/option.md index fe22ef08..c511959b 100644 --- a/internal/deployserverclient/docs/models/operations/option.md +++ b/internal/deployserverclient/docs/models/operations/option.md @@ -39,6 +39,22 @@ WithClient allows the overriding of the default HTTP client used by the SDK. deployserverclient.WithClient(httpClient) ``` +### WithSecurity + +WithSecurity configures the SDK to use the provided security details. + +```go +deployserverclient.WithSecurity(/* ... */) +``` + +### WithSecuritySource + +WithSecuritySource configures the SDK to invoke the provided function on each method call to determine authentication. + +```go +deployserverclient.WithSecuritySource(/* ... */) +``` + ### WithRetryConfig WithRetryConfig allows setting the default retry configuration used by the SDK for all supported operations. diff --git a/internal/deployserverclient/docs/models/operations/deployappconfigurationrawrequest.md b/internal/deployserverclient/docs/models/operations/pushmanifestversionrawrequest.md similarity index 74% rename from internal/deployserverclient/docs/models/operations/deployappconfigurationrawrequest.md rename to internal/deployserverclient/docs/models/operations/pushmanifestversionrawrequest.md index 1fff1b33..a21204cf 100644 --- a/internal/deployserverclient/docs/models/operations/deployappconfigurationrawrequest.md +++ b/internal/deployserverclient/docs/models/operations/pushmanifestversionrawrequest.md @@ -1,9 +1,9 @@ -# DeployAppConfigurationRawRequest +# PushManifestVersionRawRequest ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | +| `ManifestID` | `string` | :heavy_check_mark: | N/A | | `RequestBody` | `any` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/pushmanifestversionrawresponse.md b/internal/deployserverclient/docs/models/operations/pushmanifestversionrawresponse.md new file mode 100644 index 00000000..0985bb7c --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/pushmanifestversionrawresponse.md @@ -0,0 +1,10 @@ +# PushManifestVersionRawResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ManifestVersionResponse` | [*components.ManifestVersionResponse](../../models/components/manifestversionresponse.md) | :heavy_minus_sign: | Manifest version created successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/pushmanifestversionrequest.md b/internal/deployserverclient/docs/models/operations/pushmanifestversionrequest.md new file mode 100644 index 00000000..dd1aab9d --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/pushmanifestversionrequest.md @@ -0,0 +1,9 @@ +# PushManifestVersionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `ManifestID` | `string` | :heavy_check_mark: | N/A | +| `RequestBody` | [operations.PushManifestVersionRequestBody](../../models/operations/pushmanifestversionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/dotself.md b/internal/deployserverclient/docs/models/operations/pushmanifestversionrequestbody.md similarity index 69% rename from internal/deployserverclient/docs/models/components/dotself.md rename to internal/deployserverclient/docs/models/operations/pushmanifestversionrequestbody.md index c0862a7d..520019e8 100644 --- a/internal/deployserverclient/docs/models/components/dotself.md +++ b/internal/deployserverclient/docs/models/operations/pushmanifestversionrequestbody.md @@ -1,4 +1,6 @@ -# DotSelf +# PushManifestVersionRequestBody + +JSON manifest content ## Fields diff --git a/internal/deployserverclient/docs/models/operations/pushmanifestversionresponse.md b/internal/deployserverclient/docs/models/operations/pushmanifestversionresponse.md new file mode 100644 index 00000000..f1e2e08b --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/pushmanifestversionresponse.md @@ -0,0 +1,10 @@ +# PushManifestVersionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ManifestVersionResponse` | [*components.ManifestVersionResponse](../../models/components/manifestversionresponse.md) | :heavy_minus_sign: | Manifest version created successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappcurrentstateversionrequest.md b/internal/deployserverclient/docs/models/operations/readappcurrentstateversionrequest.md deleted file mode 100644 index d505e3a1..00000000 --- a/internal/deployserverclient/docs/models/operations/readappcurrentstateversionrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReadAppCurrentStateVersionRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappcurrentstateversionresponse.md b/internal/deployserverclient/docs/models/operations/readappcurrentstateversionresponse.md deleted file mode 100644 index f2b7ce5e..00000000 --- a/internal/deployserverclient/docs/models/operations/readappcurrentstateversionresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReadAppCurrentStateVersionResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `ReadStateResponse` | [*components.ReadStateResponse](../../models/components/readstateresponse.md) | :heavy_minus_sign: | Current state version retrieved successfully | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappinclude.md b/internal/deployserverclient/docs/models/operations/readappinclude.md new file mode 100644 index 00000000..5f20740f --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readappinclude.md @@ -0,0 +1,18 @@ +# ReadAppInclude + +## Example Usage + +```go +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" +) + +value := operations.ReadAppIncludeState +``` + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `ReadAppIncludeState` | state | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readapprequest.md b/internal/deployserverclient/docs/models/operations/readapprequest.md index 7469fa05..c7041dc2 100644 --- a/internal/deployserverclient/docs/models/operations/readapprequest.md +++ b/internal/deployserverclient/docs/models/operations/readapprequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Include` | [][operations.ReadAppInclude](../../models/operations/readappinclude.md) | :heavy_minus_sign: | Comma-separated list of related resources to include.
- `state`: Include the live stack state reported by Formance Cloud
(a projection of the bound stack from Membership, not a snapshot
persisted by the proxy).
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readapprunsrequest.md b/internal/deployserverclient/docs/models/operations/readapprunsrequest.md deleted file mode 100644 index 9dfaf1fe..00000000 --- a/internal/deployserverclient/docs/models/operations/readapprunsrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReadAppRunsRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | -| `PageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `PageSize` | `*int64` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappvariablesrequest.md b/internal/deployserverclient/docs/models/operations/readappvariablesrequest.md index 997f2a80..369da6d9 100644 --- a/internal/deployserverclient/docs/models/operations/readappvariablesrequest.md +++ b/internal/deployserverclient/docs/models/operations/readappvariablesrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | -| `PageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `PageSize` | `*int64` | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `PageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappversionsrequest.md b/internal/deployserverclient/docs/models/operations/readappversionsrequest.md deleted file mode 100644 index 0f9658ff..00000000 --- a/internal/deployserverclient/docs/models/operations/readappversionsrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReadAppVersionsRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | -| `PageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `PageSize` | `*int64` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readappversionsresponse.md b/internal/deployserverclient/docs/models/operations/readappversionsresponse.md deleted file mode 100644 index 6ed33516..00000000 --- a/internal/deployserverclient/docs/models/operations/readappversionsresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReadAppVersionsResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `ListVersionsResponse` | [*components.ListVersionsResponse](../../models/components/listversionsresponse.md) | :heavy_minus_sign: | App versions retrieved successfully | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentappversionrequest.md b/internal/deployserverclient/docs/models/operations/readcurrentappversionrequest.md deleted file mode 100644 index 21483ef3..00000000 --- a/internal/deployserverclient/docs/models/operations/readcurrentappversionrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReadCurrentAppVersionRequest - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `ID` | `string` | :heavy_check_mark: | N/A | -| `From` | [*operations.From](../../models/operations/from.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentrunlogsrequest.md b/internal/deployserverclient/docs/models/operations/readcurrentrunlogsrequest.md deleted file mode 100644 index db1a51bf..00000000 --- a/internal/deployserverclient/docs/models/operations/readcurrentrunlogsrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReadCurrentRunLogsRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readdeploymentinclude.md b/internal/deployserverclient/docs/models/operations/readdeploymentinclude.md new file mode 100644 index 00000000..9f5f1789 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readdeploymentinclude.md @@ -0,0 +1,18 @@ +# ReadDeploymentInclude + +## Example Usage + +```go +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" +) + +value := operations.ReadDeploymentIncludeState +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `ReadDeploymentIncludeState` | state | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/v2chartaccountmetadata.md b/internal/deployserverclient/docs/models/operations/readdeploymentlogsrequest.md similarity index 69% rename from internal/deployserverclient/docs/models/components/v2chartaccountmetadata.md rename to internal/deployserverclient/docs/models/operations/readdeploymentlogsrequest.md index 2c764179..f028eaba 100644 --- a/internal/deployserverclient/docs/models/components/v2chartaccountmetadata.md +++ b/internal/deployserverclient/docs/models/operations/readdeploymentlogsrequest.md @@ -1,8 +1,8 @@ -# V2ChartAccountMetadata +# ReadDeploymentLogsRequest ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `Default` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file +| `DeploymentID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readrunlogsresponse.md b/internal/deployserverclient/docs/models/operations/readdeploymentlogsresponse.md similarity index 90% rename from internal/deployserverclient/docs/models/operations/readrunlogsresponse.md rename to internal/deployserverclient/docs/models/operations/readdeploymentlogsresponse.md index bfe621a3..1388ac81 100644 --- a/internal/deployserverclient/docs/models/operations/readrunlogsresponse.md +++ b/internal/deployserverclient/docs/models/operations/readdeploymentlogsresponse.md @@ -1,4 +1,4 @@ -# ReadRunLogsResponse +# ReadDeploymentLogsResponse ## Fields @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `ReadLogsResponse` | [*components.ReadLogsResponse](../../models/components/readlogsresponse.md) | :heavy_minus_sign: | Run logs retrieved successfully | +| `ReadLogsResponse` | [*components.ReadLogsResponse](../../models/components/readlogsresponse.md) | :heavy_minus_sign: | Deployment logs retrieved successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readdeploymentrequest.md b/internal/deployserverclient/docs/models/operations/readdeploymentrequest.md new file mode 100644 index 00000000..52c58dbb --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readdeploymentrequest.md @@ -0,0 +1,9 @@ +# ReadDeploymentRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DeploymentID` | `string` | :heavy_check_mark: | N/A | +| `Include` | [][operations.ReadDeploymentInclude](../../models/operations/readdeploymentinclude.md) | :heavy_minus_sign: | Comma-separated list of related resources to include.
- `state`: Include the live stack state reported by Formance Cloud
for this deployment's bound stack. Note: this is the **live**
projection from Membership, not a frozen per-deployment snapshot.
| \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readversionresponse.md b/internal/deployserverclient/docs/models/operations/readdeploymentresponse.md similarity index 63% rename from internal/deployserverclient/docs/models/operations/readversionresponse.md rename to internal/deployserverclient/docs/models/operations/readdeploymentresponse.md index af15e4fc..d63d2c3b 100644 --- a/internal/deployserverclient/docs/models/operations/readversionresponse.md +++ b/internal/deployserverclient/docs/models/operations/readdeploymentresponse.md @@ -1,4 +1,4 @@ -# ReadVersionResponse +# ReadDeploymentResponse ## Fields @@ -6,7 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `AppVersionResponse` | [*components.AppVersionResponse](../../models/components/appversionresponse.md) | :heavy_minus_sign: | version retrieved successfully | -| `TwoHundredApplicationGzipResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | version retrieved successfully | -| `TwoHundredApplicationYamlResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | version retrieved successfully | +| `DeploymentResponse` | [*components.DeploymentResponse](../../models/components/deploymentresponse.md) | :heavy_minus_sign: | Deployment retrieved successfully | +| `ResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | Deployment retrieved successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readmanifestrequest.md b/internal/deployserverclient/docs/models/operations/readmanifestrequest.md new file mode 100644 index 00000000..d785ed1d --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readmanifestrequest.md @@ -0,0 +1,9 @@ +# ReadManifestRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ManifestID` | `string` | :heavy_check_mark: | N/A | +| `Include` | `*string` | :heavy_minus_sign: | Comma-separated includes (e.g. "latest" to embed latest version content) | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readapprunsresponse.md b/internal/deployserverclient/docs/models/operations/readmanifestresponse.md similarity index 82% rename from internal/deployserverclient/docs/models/operations/readapprunsresponse.md rename to internal/deployserverclient/docs/models/operations/readmanifestresponse.md index 05a91a03..f6626bd6 100644 --- a/internal/deployserverclient/docs/models/operations/readapprunsresponse.md +++ b/internal/deployserverclient/docs/models/operations/readmanifestresponse.md @@ -1,4 +1,4 @@ -# ReadAppRunsResponse +# ReadManifestResponse ## Fields @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `ListRunsResponse` | [*components.ListRunsResponse](../../models/components/listrunsresponse.md) | :heavy_minus_sign: | App runs retrieved successfully | +| `ManifestResponse` | [*components.ManifestResponse](../../models/components/manifestresponse.md) | :heavy_minus_sign: | Manifest retrieved successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readmanifestversionrequest.md b/internal/deployserverclient/docs/models/operations/readmanifestversionrequest.md new file mode 100644 index 00000000..f917413f --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readmanifestversionrequest.md @@ -0,0 +1,9 @@ +# ReadManifestVersionRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `ManifestID` | `string` | :heavy_check_mark: | N/A | +| `Version` | `string` | :heavy_check_mark: | Version number or "latest" | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readmanifestversionresponse.md b/internal/deployserverclient/docs/models/operations/readmanifestversionresponse.md new file mode 100644 index 00000000..616ab664 --- /dev/null +++ b/internal/deployserverclient/docs/models/operations/readmanifestversionresponse.md @@ -0,0 +1,11 @@ +# ReadManifestVersionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `ManifestVersionResponse` | [*components.ManifestVersionResponse](../../models/components/manifestversionresponse.md) | :heavy_minus_sign: | Manifest version retrieved successfully | +| `ResponseStream` | `io.ReadCloser` | :heavy_minus_sign: | Manifest version retrieved successfully | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readversionrequest.md b/internal/deployserverclient/docs/models/operations/readversionrequest.md deleted file mode 100644 index 30c9ea77..00000000 --- a/internal/deployserverclient/docs/models/operations/readversionrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReadVersionRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/components/reconciliation.md b/internal/deployserverclient/docs/models/operations/updatemanifestrequest.md similarity index 56% rename from internal/deployserverclient/docs/models/components/reconciliation.md rename to internal/deployserverclient/docs/models/operations/updatemanifestrequest.md index 2dd49f91..0d35f285 100644 --- a/internal/deployserverclient/docs/models/components/reconciliation.md +++ b/internal/deployserverclient/docs/models/operations/updatemanifestrequest.md @@ -1,8 +1,9 @@ -# Reconciliation +# UpdateManifestRequest ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Policies` | [][components.ReconciliationPolicy](../../models/components/reconciliationpolicy.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ManifestID` | `string` | :heavy_check_mark: | N/A | +| `UpdateManifestRequest` | [components.UpdateManifestRequest](../../models/components/updatemanifestrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/internal/deployserverclient/docs/models/operations/readcurrentrunlogsresponse.md b/internal/deployserverclient/docs/models/operations/updatemanifestresponse.md similarity index 78% rename from internal/deployserverclient/docs/models/operations/readcurrentrunlogsresponse.md rename to internal/deployserverclient/docs/models/operations/updatemanifestresponse.md index 5bd0e6e8..f8b0e9ef 100644 --- a/internal/deployserverclient/docs/models/operations/readcurrentrunlogsresponse.md +++ b/internal/deployserverclient/docs/models/operations/updatemanifestresponse.md @@ -1,4 +1,4 @@ -# ReadCurrentRunLogsResponse +# UpdateManifestResponse ## Fields @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `ReadLogsResponse` | [*components.ReadLogsResponse](../../models/components/readlogsresponse.md) | :heavy_minus_sign: | Current run logs retrieved successfully | +| `ManifestResponse` | [*components.ManifestResponse](../../models/components/manifestresponse.md) | :heavy_minus_sign: | Manifest updated successfully | | `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/internal/deployserverclient/docs/sdks/deployserver/README.md b/internal/deployserverclient/docs/sdks/deployserver/README.md index a0e239dc..38b6bb51 100644 --- a/internal/deployserverclient/docs/sdks/deployserver/README.md +++ b/internal/deployserverclient/docs/sdks/deployserver/README.md @@ -9,20 +9,25 @@ * [UpdateApp](#updateapp) - Update an app * [ReadApp](#readapp) - read app details * [DeleteApp](#deleteapp) - Delete an app -* [ReadAppCurrentStateVersion](#readappcurrentstateversion) - Get the current state version of an app +* [AttachAppManifest](#attachappmanifest) - Bind an app to a manifest +* [DetachAppManifest](#detachappmanifest) - Unbind an app from its manifest * [ReadAppVariables](#readappvariables) - Get all variables of an app * [CreateAppVariable](#createappvariable) - Create variable for an app * [DeleteAppVariable](#deleteappvariable) - Delete a variable from an app -* [ReadAppRuns](#readappruns) - Get runs of an app -* [ReadAppVersions](#readappversions) - Get versions of an app -* [DeployAppConfigurationRaw](#deployappconfigurationraw) - Deploy a new configuration for an app -* [DeployAppConfiguration](#deployappconfiguration) - Deploy a new configuration for an app -* [ReadCurrentRun](#readcurrentrun) - Get the current run of an app -* [ReadVersion](#readversion) - Get a specific version -* [ReadRun](#readrun) - Get the run of a version -* [ReadRunLogs](#readrunlogs) - Get logs of a run by its ID -* [ReadCurrentRunLogs](#readcurrentrunlogs) - Get logs of the current run of an app -* [ReadCurrentAppVersion](#readcurrentappversion) - Get the current version of an app +* [CreateManifestRaw](#createmanifestraw) - Create a new manifest +* [CreateManifest](#createmanifest) - Create a new manifest +* [ListManifests](#listmanifests) - List manifests in the organization +* [ReadManifest](#readmanifest) - Read a manifest +* [UpdateManifest](#updatemanifest) - Update manifest metadata +* [DeleteManifest](#deletemanifest) - Delete a manifest and all its versions +* [PushManifestVersionRaw](#pushmanifestversionraw) - Push a new version of a manifest +* [PushManifestVersion](#pushmanifestversion) - Push a new version of a manifest +* [ListManifestVersions](#listmanifestversions) - List versions of a manifest +* [ReadManifestVersion](#readmanifestversion) - Get a specific manifest version with content +* [CreateDeployment](#createdeployment) - Create a deployment (triggers a run) +* [ListDeployments](#listdeployments) - List deployments +* [ReadDeployment](#readdeployment) - Get a single deployment +* [ReadDeploymentLogs](#readdeploymentlogs) - Get run logs for a deployment ## ListApps @@ -36,6 +41,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -43,9 +49,11 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ListApps(ctx, "", nil, nil) + res, err := s.ListApps(ctx, nil, nil) if err != nil { log.Fatal(err) } @@ -57,13 +65,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `organizationID` | `string` | :heavy_check_mark: | N/A | -| `pageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `pageSize` | `*int64` | :heavy_minus_sign: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -87,6 +94,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" @@ -95,10 +103,12 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) res, err := s.CreateApp(ctx, components.CreateAppRequest{ - OrganizationID: "", + Name: "", }) if err != nil { log.Fatal(err) @@ -139,6 +149,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" @@ -147,9 +158,13 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.UpdateApp(ctx, "", components.UpdateAppRequest{}) + res, err := s.UpdateApp(ctx, "", components.UpdateAppRequest{ + Name: "", + }) if err != nil { log.Fatal(err) } @@ -190,6 +205,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -197,9 +213,11 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadApp(ctx, "") + res, err := s.ReadApp(ctx, "", nil) if err != nil { log.Fatal(err) } @@ -211,11 +229,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | `string` | :heavy_check_mark: | N/A | +| `include` | [][operations.ReadAppInclude](../../models/operations/readappinclude.md) | :heavy_minus_sign: | Comma-separated list of related resources to include.
- `state`: Include the live stack state reported by Formance Cloud
(a projection of the bound stack from Membership, not a snapshot
persisted by the proxy).
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -229,7 +248,17 @@ func main() { ## DeleteApp -Delete an app +Soft-deletes the app immediately and enqueues a destroy deployment to +clean up the app's resources on Formance Cloud via the openapi +reconciler's tear-down path. The app becomes invisible to all +subsequent reads. The destroy runs through the normal worker +pipeline; once it reaches a successful terminal status the worker +hard-deletes the app row. + +By default this returns 202 Accepted as soon as the destroy is +enqueued (or 202 with no body if no destroy was needed). Pass +`?wait=true` to block until the destroy reaches a terminal status. + ### Example Usage @@ -239,6 +268,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -246,13 +276,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.DeleteApp(ctx, "") + res, err := s.DeleteApp(ctx, "", deployserverclient.Pointer(false)) if err != nil { log.Fatal(err) } - if res.Error != nil { + if res.DeleteAppResponse != nil { // handle response } } @@ -260,11 +292,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | `string` | :heavy_check_mark: | N/A | +| `wait` | `*bool` | :heavy_minus_sign: | When `true`, the call blocks until the destroy deployment reaches a
terminal status. Default `false` (returns 202 Accepted).
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -276,32 +309,94 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadAppCurrentStateVersion +## AttachAppManifest + +Updates the app's `manifest_id` pointer. Idempotent — re-binding to the +same id is a no-op; rebinding to a different id moves the pointer. -Get the current state version of an app ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadAppCurrentStateVersion(ctx, "") + res, err := s.AttachAppManifest(ctx, "", components.AttachManifestRequest{ + ManifestID: "", + }) if err != nil { log.Fatal(err) } - if res.ReadStateResponse != nil { + if res.Error != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | `string` | :heavy_check_mark: | N/A | +| `attachManifestRequest` | [components.AttachManifestRequest](../../models/components/attachmanifestrequest.md) | :heavy_check_mark: | N/A | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.AttachAppManifestResponse](../../models/operations/attachappmanifestresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.Error | 400, 404 | application/json | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## DetachAppManifest + +Clears the app's `manifest_id` pointer. Idempotent. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "log" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.DetachAppManifest(ctx, "") + if err != nil { + log.Fatal(err) + } + if res.Error != nil { // handle response } } @@ -317,7 +412,7 @@ func main() { ### Response -**[*operations.ReadAppCurrentStateVersionResponse](../../models/operations/readappcurrentstateversionresponse.md), error** +**[*operations.DetachAppManifestResponse](../../models/operations/detachappmanifestresponse.md), error** ### Errors @@ -337,6 +432,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -344,7 +440,9 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) res, err := s.ReadAppVariables(ctx, "", nil, nil) if err != nil { @@ -358,13 +456,13 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `pageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `pageSize` | `*int64` | :heavy_minus_sign: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | `string` | :heavy_check_mark: | N/A | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -388,6 +486,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" @@ -396,13 +495,14 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) res, err := s.CreateAppVariable(ctx, "", components.CreateVariableRequest{ Variable: components.VariableData{ Key: "", Value: "", - Sensitive: false, }, }) if err != nil { @@ -445,6 +545,7 @@ package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -452,7 +553,9 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) res, err := s.DeleteAppVariable(ctx, "", "") if err != nil { @@ -483,18 +586,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadAppRuns +## CreateManifestRaw -Get runs of an app +Create a new manifest ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -502,13 +606,20 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + example, fileErr := os.Open("example.file") + if fileErr != nil { + panic(fileErr) + } - res, err := s.ReadAppRuns(ctx, "", nil, nil) + res, err := s.CreateManifestRaw(ctx, "", example) if err != nil { log.Fatal(err) } - if res.ListRunsResponse != nil { + if res.CreateManifestResponse != nil { // handle response } } @@ -519,14 +630,67 @@ func main() { | Parameter | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `pageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `pageSize` | `*int64` | :heavy_minus_sign: | N/A | +| `name` | `string` | :heavy_check_mark: | Name for the manifest | +| `requestBody` | `any` | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadAppRunsResponse](../../models/operations/readapprunsresponse.md), error** +**[*operations.CreateManifestRawResponse](../../models/operations/createmanifestrawresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## CreateManifest + +Create a new manifest + +### Example Usage + + +```go +package main + +import( + "context" + "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.CreateManifest(ctx, "", operations.CreateManifestRequestBody{}) + if err != nil { + log.Fatal(err) + } + if res.CreateManifestResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `name` | `string` | :heavy_check_mark: | Name for the manifest | +| `requestBody` | [operations.CreateManifestRequestBody](../../models/operations/createmanifestrequestbody.md) | :heavy_check_mark: | N/A | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateManifestResponse](../../models/operations/createmanifestresponse.md), error** ### Errors @@ -534,18 +698,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadAppVersions +## ListManifests -Get versions of an app +List manifests in the organization ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -553,13 +718,177 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadAppVersions(ctx, "", nil, nil) + res, err := s.ListManifests(ctx, nil, nil) if err != nil { log.Fatal(err) } - if res.ListVersionsResponse != nil { + if res.ListManifestsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListManifestsResponse](../../models/operations/listmanifestsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## ReadManifest + +Read a manifest + +### Example Usage + + +```go +package main + +import( + "context" + "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "log" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.ReadManifest(ctx, "", nil) + if err != nil { + log.Fatal(err) + } + if res.ManifestResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `manifestID` | `string` | :heavy_check_mark: | N/A | +| `include` | `*string` | :heavy_minus_sign: | Comma-separated includes (e.g. "latest" to embed latest version content) | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ReadManifestResponse](../../models/operations/readmanifestresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## UpdateManifest + +Update manifest metadata + +### Example Usage + + +```go +package main + +import( + "context" + "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.UpdateManifest(ctx, "", components.UpdateManifestRequest{ + Name: "", + }) + if err != nil { + log.Fatal(err) + } + if res.ManifestResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `manifestID` | `string` | :heavy_check_mark: | N/A | +| `updateManifestRequest` | [components.UpdateManifestRequest](../../models/components/updatemanifestrequest.md) | :heavy_check_mark: | N/A | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.UpdateManifestResponse](../../models/operations/updatemanifestresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## DeleteManifest + +Delete a manifest and all its versions + +### Example Usage + + +```go +package main + +import( + "context" + "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "log" +) + +func main() { + ctx := context.Background() + + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) + + res, err := s.DeleteManifest(ctx, "") + if err != nil { + log.Fatal(err) + } + if res.Error != nil { // handle response } } @@ -570,53 +899,54 @@ func main() { | Parameter | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `pageNumber` | `*int64` | :heavy_minus_sign: | N/A | -| `pageSize` | `*int64` | :heavy_minus_sign: | N/A | +| `manifestID` | `string` | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadAppVersionsResponse](../../models/operations/readappversionsresponse.md), error** +**[*operations.DeleteManifestResponse](../../models/operations/deletemanifestresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | +| apierrors.Error | 409 | application/json | | apierrors.APIError | 4XX, 5XX | \*/\* | -## DeployAppConfigurationRaw +## PushManifestVersionRaw -Deploy a new configuration for an app +Push a new version of a manifest ### Example Usage - + ```go package main import( "context" - deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "os" + deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) example, fileErr := os.Open("example.file") if fileErr != nil { panic(fileErr) } - res, err := s.DeployAppConfigurationRaw(ctx, "", example) + res, err := s.PushManifestVersionRaw(ctx, "", example) if err != nil { log.Fatal(err) } - if res.RunResponse != nil { + if res.ManifestVersionResponse != nil { // handle response } } @@ -627,13 +957,13 @@ func main() { | Parameter | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | +| `manifestID` | `string` | :heavy_check_mark: | N/A | | `requestBody` | `any` | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.DeployAppConfigurationRawResponse](../../models/operations/deployappconfigurationrawresponse.md), error** +**[*operations.PushManifestVersionRawResponse](../../models/operations/pushmanifestversionrawresponse.md), error** ### Errors @@ -641,38 +971,36 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## DeployAppConfiguration +## PushManifestVersion -Deploy a new configuration for an app +Push a new version of a manifest ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/operations" "log" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.DeployAppConfiguration(ctx, "", components.Application{ - Stack: components.Stack{ - Name: "", - Region: components.RegionSelector{}, - }, - }) + res, err := s.PushManifestVersion(ctx, "", operations.PushManifestVersionRequestBody{}) if err != nil { log.Fatal(err) } - if res.RunResponse != nil { + if res.ManifestVersionResponse != nil { // handle response } } @@ -680,16 +1008,16 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `application` | [components.Application](../../models/components/application.md) | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `manifestID` | `string` | :heavy_check_mark: | N/A | +| `requestBody` | [operations.PushManifestVersionRequestBody](../../models/operations/pushmanifestversionrequestbody.md) | :heavy_check_mark: | N/A | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.DeployAppConfigurationResponse](../../models/operations/deployappconfigurationresponse.md), error** +**[*operations.PushManifestVersionResponse](../../models/operations/pushmanifestversionresponse.md), error** ### Errors @@ -697,18 +1025,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadCurrentRun +## ListManifestVersions -Get the current run of an app +List versions of a manifest ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -716,13 +1045,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadCurrentRun(ctx, "") + res, err := s.ListManifestVersions(ctx, "", nil, nil) if err != nil { log.Fatal(err) } - if res.RunResponse != nil { + if res.ListManifestVersionsResponse != nil { // handle response } } @@ -730,15 +1061,17 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `manifestID` | `string` | :heavy_check_mark: | N/A | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadCurrentRunResponse](../../models/operations/readcurrentrunresponse.md), error** +**[*operations.ListManifestVersionsResponse](../../models/operations/listmanifestversionsresponse.md), error** ### Errors @@ -746,18 +1079,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadVersion +## ReadManifestVersion -Get a specific version +Get a specific manifest version with content ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -765,13 +1099,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadVersion(ctx, "") + res, err := s.ReadManifestVersion(ctx, "", "") if err != nil { log.Fatal(err) } - if res.AppVersionResponse != nil { + if res.ManifestVersionResponse != nil { // handle response } } @@ -782,12 +1118,13 @@ func main() { | Parameter | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | +| `manifestID` | `string` | :heavy_check_mark: | N/A | +| `version` | `string` | :heavy_check_mark: | Version number or "latest" | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadVersionResponse](../../models/operations/readversionresponse.md), error** +**[*operations.ReadManifestVersionResponse](../../models/operations/readmanifestversionresponse.md), error** ### Errors @@ -795,32 +1132,40 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadRun +## CreateDeployment -Get the run of a version +Create a deployment (triggers a run) ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" "log" ) func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadRun(ctx, "") + res, err := s.CreateDeployment(ctx, components.CreateDeploymentRequest{ + AppID: "", + ManifestID: "", + ManifestVersion: 5649, + }) if err != nil { log.Fatal(err) } - if res.RunResponse != nil { + if res.DeploymentResponse != nil { // handle response } } @@ -828,15 +1173,15 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.CreateDeploymentRequest](../../models/components/createdeploymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadRunResponse](../../models/operations/readrunresponse.md), error** +**[*operations.CreateDeploymentResponse](../../models/operations/createdeploymentresponse.md), error** ### Errors @@ -844,18 +1189,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadRunLogs +## ListDeployments -Get logs of a run by its ID +List deployments ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -863,13 +1209,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadRunLogs(ctx, "") + res, err := s.ListDeployments(ctx, nil, nil, nil) if err != nil { log.Fatal(err) } - if res.ReadLogsResponse != nil { + if res.ListDeploymentsResponse != nil { // handle response } } @@ -877,15 +1225,17 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `appID` | `*string` | :heavy_minus_sign: | N/A | +| `pageSize` | `*int64` | :heavy_minus_sign: | Maximum number of items to return on the first page. Capped at 100;
ignored when `cursor` is supplied (subsequent pages reuse the page
size baked into the cursor token). Defaults to 100.
| +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination token returned in `cursor.next` / `cursor.previous`
on the previous page. Pass it back unchanged to fetch the adjacent
page. Mutually exclusive with `pageSize` after the first request.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadRunLogsResponse](../../models/operations/readrunlogsresponse.md), error** +**[*operations.ListDeploymentsResponse](../../models/operations/listdeploymentsresponse.md), error** ### Errors @@ -893,18 +1243,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadCurrentRunLogs +## ReadDeployment -Get logs of the current run of an app +Get a single deployment ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -912,13 +1263,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadCurrentRunLogs(ctx, "") + res, err := s.ReadDeployment(ctx, "", nil) if err != nil { log.Fatal(err) } - if res.ReadLogsResponse != nil { + if res.DeploymentResponse != nil { // handle response } } @@ -926,15 +1279,16 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `deploymentID` | `string` | :heavy_check_mark: | N/A | +| `include` | [][operations.ReadDeploymentInclude](../../models/operations/readdeploymentinclude.md) | :heavy_minus_sign: | Comma-separated list of related resources to include.
- `state`: Include the live stack state reported by Formance Cloud
for this deployment's bound stack. Note: this is the **live**
projection from Membership, not a frozen per-deployment snapshot.
| +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadCurrentRunLogsResponse](../../models/operations/readcurrentrunlogsresponse.md), error** +**[*operations.ReadDeploymentResponse](../../models/operations/readdeploymentresponse.md), error** ### Errors @@ -942,18 +1296,19 @@ func main() { | ------------------ | ------------------ | ------------------ | | apierrors.APIError | 4XX, 5XX | \*/\* | -## ReadCurrentAppVersion +## ReadDeploymentLogs -Get the current version of an app +Get run logs for a deployment ### Example Usage - + ```go package main import( "context" + "os" deployserverclient "github.com/formancehq/fctl/internal/deployserverclient/v3" "log" ) @@ -961,13 +1316,15 @@ import( func main() { ctx := context.Background() - s := deployserverclient.New() + s := deployserverclient.New( + deployserverclient.WithSecurity(os.Getenv("DEPLOYSERVER_BEARER_AUTH")), + ) - res, err := s.ReadCurrentAppVersion(ctx, "", nil) + res, err := s.ReadDeploymentLogs(ctx, "") if err != nil { log.Fatal(err) } - if res.AppVersionResponse != nil { + if res.ReadLogsResponse != nil { // handle response } } @@ -978,13 +1335,12 @@ func main() { | Parameter | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | `string` | :heavy_check_mark: | N/A | -| `from` | [*operations.From](../../models/operations/from.md) | :heavy_minus_sign: | N/A | +| `deploymentID` | `string` | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response -**[*operations.ReadCurrentAppVersionResponse](../../models/operations/readcurrentappversionresponse.md), error** +**[*operations.ReadDeploymentLogsResponse](../../models/operations/readdeploymentlogsresponse.md), error** ### Errors diff --git a/internal/deployserverclient/internal/config/sdkconfiguration.go b/internal/deployserverclient/internal/config/sdkconfiguration.go index e0e5bebf..dd5ad42c 100644 --- a/internal/deployserverclient/internal/config/sdkconfiguration.go +++ b/internal/deployserverclient/internal/config/sdkconfiguration.go @@ -4,6 +4,7 @@ package config import ( + "context" "github.com/formancehq/fctl/internal/deployserverclient/v3/retry" "net/http" "time" @@ -14,8 +15,8 @@ type HTTPClient interface { } type SDKConfiguration struct { - Client HTTPClient - + Client HTTPClient + Security func(context.Context) (interface{}, error) ServerURL string ServerIndex int ServerList []string diff --git a/internal/deployserverclient/models/apierrors/error.go b/internal/deployserverclient/models/apierrors/error.go new file mode 100644 index 00000000..3216263c --- /dev/null +++ b/internal/deployserverclient/models/apierrors/error.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: fa6526d8455d + +package apierrors + +import ( + "encoding/json" +) + +type Error struct { + ErrorCode string `json:"errorCode"` + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +var _ error = &Error{} + +func (e *Error) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/internal/deployserverclient/models/components/app.go b/internal/deployserverclient/models/components/app.go index f3a2dfe0..c56bdf01 100644 --- a/internal/deployserverclient/models/components/app.go +++ b/internal/deployserverclient/models/components/app.go @@ -7,9 +7,17 @@ type App struct { // Unique identifier for the app ID string `json:"id"` // Name of the app - Name string `json:"name"` - CurrentConfigurationVersion *ConfigurationVersion `json:"currentConfigurationVersion,omitempty"` - CurrentRun *Run `json:"currentRun,omitempty"` + Name string `json:"name"` + // Optional existing stack ID claimed by this app + StackID *string `json:"stackId,omitempty"` + // Stack region ID (set when the app's stack lives in a specific region) + StackRegionID *string `json:"stackRegionId,omitempty"` + State *State `json:"state,omitempty"` + // The manifest the app is currently bound to (apps.manifest_id), with + // catalog metadata and divergence vs the most recent applied deployment. + // Populated by GET /apps/{id} when a manifest is bound. + // + CurrentManifest *AppCurrentManifest `json:"currentManifest,omitempty"` } func (a *App) GetID() string { @@ -26,16 +34,30 @@ func (a *App) GetName() string { return a.Name } -func (a *App) GetCurrentConfigurationVersion() *ConfigurationVersion { +func (a *App) GetStackID() *string { if a == nil { return nil } - return a.CurrentConfigurationVersion + return a.StackID } -func (a *App) GetCurrentRun() *Run { +func (a *App) GetStackRegionID() *string { if a == nil { return nil } - return a.CurrentRun + return a.StackRegionID +} + +func (a *App) GetState() *State { + if a == nil { + return nil + } + return a.State +} + +func (a *App) GetCurrentManifest() *AppCurrentManifest { + if a == nil { + return nil + } + return a.CurrentManifest } diff --git a/internal/deployserverclient/models/components/appcurrentmanifest.go b/internal/deployserverclient/models/components/appcurrentmanifest.go new file mode 100644 index 00000000..e7de2cd9 --- /dev/null +++ b/internal/deployserverclient/models/components/appcurrentmanifest.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 196f8c8444aa + +package components + +// AppCurrentManifest - The manifest the app is currently bound to (apps.manifest_id), with +// catalog metadata and divergence vs the most recent applied deployment. +// Populated by GET /apps/{id} when a manifest is bound. +type AppCurrentManifest struct { + // ID of the manifest the app is bound to + ID string `json:"id"` + // Name of the bound manifest + Name string `json:"name"` + // Latest version available in the manifest's lineage + LatestVersion int64 `json:"latestVersion"` + // Relationship between the app's bound manifest and what's currently + // deployed (last `applied` deployment, ignoring destroys). + // + Divergence *AppManifestDivergence `json:"divergence,omitempty"` +} + +func (a *AppCurrentManifest) GetID() string { + if a == nil { + return "" + } + return a.ID +} + +func (a *AppCurrentManifest) GetName() string { + if a == nil { + return "" + } + return a.Name +} + +func (a *AppCurrentManifest) GetLatestVersion() int64 { + if a == nil { + return 0 + } + return a.LatestVersion +} + +func (a *AppCurrentManifest) GetDivergence() *AppManifestDivergence { + if a == nil { + return nil + } + return a.Divergence +} diff --git a/internal/deployserverclient/models/components/application.go b/internal/deployserverclient/models/components/application.go deleted file mode 100644 index f930a1c1..00000000 --- a/internal/deployserverclient/models/components/application.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 28d697942062 - -package components - -type Application struct { - Ledgers []Ledger `json:"ledgers,omitempty"` - Payments *Payments `json:"payments,omitempty"` - Reconciliation *Reconciliation `json:"reconciliation,omitempty"` - Stack Stack `json:"stack"` - Webhooks []Webhook `json:"webhooks,omitempty"` -} - -func (a *Application) GetLedgers() []Ledger { - if a == nil { - return nil - } - return a.Ledgers -} - -func (a *Application) GetPayments() *Payments { - if a == nil { - return nil - } - return a.Payments -} - -func (a *Application) GetReconciliation() *Reconciliation { - if a == nil { - return nil - } - return a.Reconciliation -} - -func (a *Application) GetStack() Stack { - if a == nil { - return Stack{} - } - return a.Stack -} - -func (a *Application) GetWebhooks() []Webhook { - if a == nil { - return nil - } - return a.Webhooks -} diff --git a/internal/deployserverclient/models/components/appmanifestdivergence.go b/internal/deployserverclient/models/components/appmanifestdivergence.go new file mode 100644 index 00000000..c9e0e722 --- /dev/null +++ b/internal/deployserverclient/models/components/appmanifestdivergence.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 9210c43db58e + +package components + +import ( + "encoding/json" + "fmt" +) + +// Kind - - `undeployed`: the app has a manifest bound but no successful deployment yet. +// - `synced`: deployed (manifestId, version) matches the bound manifest's latest version. +// - `behind`: deployed manifest matches the bound manifest but on an older version. +// - `rebound`: the app was rebound; deployed manifest is a different manifest. +type Kind string + +const ( + KindUndeployed Kind = "undeployed" + KindSynced Kind = "synced" + KindBehind Kind = "behind" + KindRebound Kind = "rebound" +) + +func (e Kind) ToPointer() *Kind { + return &e +} +func (e *Kind) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "undeployed": + fallthrough + case "synced": + fallthrough + case "behind": + fallthrough + case "rebound": + *e = Kind(v) + return nil + default: + return fmt.Errorf("invalid value for Kind: %v", v) + } +} + +// AppManifestDivergence - Relationship between the app's bound manifest and what's currently +// deployed (last `applied` deployment, ignoring destroys). +type AppManifestDivergence struct { + // - `undeployed`: the app has a manifest bound but no successful deployment yet. + // - `synced`: deployed (manifestId, version) matches the bound manifest's latest version. + // - `behind`: deployed manifest matches the bound manifest but on an older version. + // - `rebound`: the app was rebound; deployed manifest is a different manifest. + // + Kind Kind `json:"kind"` + // ID of the manifest reflected in the most recent applied deployment + DeployedManifestID *string `json:"deployedManifestId,omitempty"` + // Version reflected in the most recent applied deployment + DeployedVersion *int64 `json:"deployedVersion,omitempty"` + // Latest version available in the bound manifest's lineage + LatestVersion int64 `json:"latestVersion"` +} + +func (a *AppManifestDivergence) GetKind() Kind { + if a == nil { + return Kind("") + } + return a.Kind +} + +func (a *AppManifestDivergence) GetDeployedManifestID() *string { + if a == nil { + return nil + } + return a.DeployedManifestID +} + +func (a *AppManifestDivergence) GetDeployedVersion() *int64 { + if a == nil { + return nil + } + return a.DeployedVersion +} + +func (a *AppManifestDivergence) GetLatestVersion() int64 { + if a == nil { + return 0 + } + return a.LatestVersion +} diff --git a/internal/deployserverclient/models/components/appversionresponse.go b/internal/deployserverclient/models/components/appversionresponse.go deleted file mode 100644 index 8f5e9ef5..00000000 --- a/internal/deployserverclient/models/components/appversionresponse.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: be12d8327676 - -package components - -type AppVersionResponse struct { - Data ConfigurationVersion `json:"data"` -} - -func (a *AppVersionResponse) GetData() ConfigurationVersion { - if a == nil { - return ConfigurationVersion{} - } - return a.Data -} diff --git a/internal/deployserverclient/models/components/attachmanifestrequest.go b/internal/deployserverclient/models/components/attachmanifestrequest.go new file mode 100644 index 00000000..5cab118b --- /dev/null +++ b/internal/deployserverclient/models/components/attachmanifestrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: b536df2de3fc + +package components + +type AttachManifestRequest struct { + // ID of the manifest to bind to the app + ManifestID string `json:"manifestId"` +} + +func (a *AttachManifestRequest) GetManifestID() string { + if a == nil { + return "" + } + return a.ManifestID +} diff --git a/internal/deployserverclient/models/components/configurationversion.go b/internal/deployserverclient/models/components/configurationversion.go deleted file mode 100644 index 6656d874..00000000 --- a/internal/deployserverclient/models/components/configurationversion.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: c20a074bc3a9 - -package components - -import ( - "encoding/json" - "fmt" -) - -type Status string - -const ( - StatusArchived Status = "archived" - StatusErrored Status = "errored" - StatusPending Status = "pending" - StatusFetching Status = "fetching" - StatusUploaded Status = "uploaded" - StatusUnknown Status = "" -) - -func (e Status) ToPointer() *Status { - return &e -} -func (e *Status) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "archived": - fallthrough - case "errored": - fallthrough - case "pending": - fallthrough - case "fetching": - fallthrough - case "uploaded": - fallthrough - case "": - *e = Status(v) - return nil - default: - return fmt.Errorf("invalid value for Status: %v", v) - } -} - -type ConfigurationVersion struct { - // Unique identifier for the configuration version - ID string `json:"id"` - // Auto queue runs when a new version is uploaded - AutoQueueRuns bool `json:"autoQueueRuns"` - // Error code if the version is in an error state - Error string `json:"error"` - // Error message if the version is in an error state - ErrorMessage string `json:"errorMessage"` - Status Status `json:"status"` -} - -func (c *ConfigurationVersion) GetID() string { - if c == nil { - return "" - } - return c.ID -} - -func (c *ConfigurationVersion) GetAutoQueueRuns() bool { - if c == nil { - return false - } - return c.AutoQueueRuns -} - -func (c *ConfigurationVersion) GetError() string { - if c == nil { - return "" - } - return c.Error -} - -func (c *ConfigurationVersion) GetErrorMessage() string { - if c == nil { - return "" - } - return c.ErrorMessage -} - -func (c *ConfigurationVersion) GetStatus() Status { - if c == nil { - return Status("") - } - return c.Status -} diff --git a/internal/deployserverclient/models/components/createapprequest.go b/internal/deployserverclient/models/components/createapprequest.go index b79eeb0c..f8efe948 100644 --- a/internal/deployserverclient/models/components/createapprequest.go +++ b/internal/deployserverclient/models/components/createapprequest.go @@ -4,13 +4,22 @@ package components type CreateAppRequest struct { - // ID of the organization to which the app belongs - OrganizationID string `json:"organizationId"` + // Name of the app + Name string `json:"name"` + // Optional existing stack ID to claim + StackID *string `json:"stackId,omitempty"` } -func (c *CreateAppRequest) GetOrganizationID() string { +func (c *CreateAppRequest) GetName() string { if c == nil { return "" } - return c.OrganizationID + return c.Name +} + +func (c *CreateAppRequest) GetStackID() *string { + if c == nil { + return nil + } + return c.StackID } diff --git a/internal/deployserverclient/models/components/createdeploymentrequest.go b/internal/deployserverclient/models/components/createdeploymentrequest.go new file mode 100644 index 00000000..9b4eaf86 --- /dev/null +++ b/internal/deployserverclient/models/components/createdeploymentrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 0f79a4986282 + +package components + +type CreateDeploymentRequest struct { + // ID of the app to deploy to + AppID string `json:"appId"` + // Manifest catalog ID + ManifestID string `json:"manifestId"` + // Manifest version + ManifestVersion int64 `json:"manifestVersion"` +} + +func (c *CreateDeploymentRequest) GetAppID() string { + if c == nil { + return "" + } + return c.AppID +} + +func (c *CreateDeploymentRequest) GetManifestID() string { + if c == nil { + return "" + } + return c.ManifestID +} + +func (c *CreateDeploymentRequest) GetManifestVersion() int64 { + if c == nil { + return 0 + } + return c.ManifestVersion +} diff --git a/internal/deployserverclient/models/components/createmanifestresponse.go b/internal/deployserverclient/models/components/createmanifestresponse.go new file mode 100644 index 00000000..4b428503 --- /dev/null +++ b/internal/deployserverclient/models/components/createmanifestresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: d9b2be34c541 + +package components + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" + "time" +) + +type Data struct { + ID string `json:"id"` + Version int64 `json:"version"` + Name string `json:"name"` + CreatedAt time.Time `json:"createdAt"` +} + +func (d Data) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *Data) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *Data) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *Data) GetVersion() int64 { + if d == nil { + return 0 + } + return d.Version +} + +func (d *Data) GetName() string { + if d == nil { + return "" + } + return d.Name +} + +func (d *Data) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +type CreateManifestResponse struct { + Data Data `json:"data"` +} + +func (c *CreateManifestResponse) GetData() Data { + if c == nil { + return Data{} + } + return c.Data +} diff --git a/internal/deployserverclient/models/components/deleteappresponse.go b/internal/deployserverclient/models/components/deleteappresponse.go new file mode 100644 index 00000000..4d77c78b --- /dev/null +++ b/internal/deployserverclient/models/components/deleteappresponse.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: de6e097ab360 + +package components + +type DeleteAppResponse struct { + // ID of the destroy deployment enqueued to clean up the app's + // resources. Empty when no destroy was needed (e.g. no prior + // applied deployment). Use `GET /deployments/{id}` to poll its + // status. + // + DestroyDeploymentID *string `json:"destroyDeploymentId,omitempty"` +} + +func (d *DeleteAppResponse) GetDestroyDeploymentID() *string { + if d == nil { + return nil + } + return d.DestroyDeploymentID +} diff --git a/internal/deployserverclient/models/components/deploymentresource.go b/internal/deployserverclient/models/components/deploymentresource.go new file mode 100644 index 00000000..eae7f819 --- /dev/null +++ b/internal/deployserverclient/models/components/deploymentresource.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: a2fac3219c8a + +package components + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" + "time" +) + +type DeploymentResource struct { + ID string `json:"id"` + AppID string `json:"appId"` + ManifestID *string `json:"manifestId,omitempty"` + ManifestVersion *int64 `json:"manifestVersion,omitempty"` + Status string `json:"status"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + State *State `json:"state,omitempty"` +} + +func (d DeploymentResource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeploymentResource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeploymentResource) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DeploymentResource) GetAppID() string { + if d == nil { + return "" + } + return d.AppID +} + +func (d *DeploymentResource) GetManifestID() *string { + if d == nil { + return nil + } + return d.ManifestID +} + +func (d *DeploymentResource) GetManifestVersion() *int64 { + if d == nil { + return nil + } + return d.ManifestVersion +} + +func (d *DeploymentResource) GetStatus() string { + if d == nil { + return "" + } + return d.Status +} + +func (d *DeploymentResource) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DeploymentResource) GetUpdatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.UpdatedAt +} + +func (d *DeploymentResource) GetState() *State { + if d == nil { + return nil + } + return d.State +} diff --git a/internal/deployserverclient/models/components/deploymentresponse.go b/internal/deployserverclient/models/components/deploymentresponse.go new file mode 100644 index 00000000..e3b7e32d --- /dev/null +++ b/internal/deployserverclient/models/components/deploymentresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 38a6c1aca4c2 + +package components + +type DeploymentResponse struct { + Data DeploymentResource `json:"data"` +} + +func (d *DeploymentResponse) GetData() DeploymentResource { + if d == nil { + return DeploymentResource{} + } + return d.Data +} diff --git a/internal/deployserverclient/models/components/dotself.go b/internal/deployserverclient/models/components/dotself.go deleted file mode 100644 index 9df4ab4a..00000000 --- a/internal/deployserverclient/models/components/dotself.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: fa704096d419 - -package components - -type DotSelf struct { -} diff --git a/internal/deployserverclient/models/components/ledger.go b/internal/deployserverclient/models/components/ledger.go deleted file mode 100644 index b5768087..00000000 --- a/internal/deployserverclient/models/components/ledger.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: edabbbad5d02 - -package components - -type Ledger struct { - Name string `json:"name"` - Schema map[string]V2SchemaData `json:"schema,omitempty"` -} - -func (l *Ledger) GetName() string { - if l == nil { - return "" - } - return l.Name -} - -func (l *Ledger) GetSchema() map[string]V2SchemaData { - if l == nil { - return nil - } - return l.Schema -} diff --git a/internal/deployserverclient/models/components/listappsresponse.go b/internal/deployserverclient/models/components/listappsresponse.go index d91d6e67..b8eb4b25 100644 --- a/internal/deployserverclient/models/components/listappsresponse.go +++ b/internal/deployserverclient/models/components/listappsresponse.go @@ -3,69 +3,64 @@ package components -type ListAppsResponseData struct { - // Current page number - CurrentPage *int64 `json:"currentPage,omitempty"` - // Previous page number - PreviousPage *int64 `json:"previousPage,omitempty"` - // Next page number - NextPage *int64 `json:"nextPage,omitempty"` - // Total number of pages - TotalPages *int64 `json:"totalPages,omitempty"` - // Total number of items - TotalCount *int64 `json:"totalCount,omitempty"` - Items []App `json:"items"` +// ListAppsResponseCursor - Cursor pagination envelope. `next` and `previous` are opaque tokens +// produced by the server; pass them back as `?cursor=` to fetch the +// adjacent page. `hasMore` is `true` when more results exist after the +// current page. `pageSize` echoes the page size used for this page. +type ListAppsResponseCursor struct { + // Number of items requested for this page + PageSize *int64 `json:"pageSize,omitempty"` + // True when more results exist after this page + HasMore bool `json:"hasMore"` + // Opaque cursor token for the previous page (empty when none) + Previous *string `json:"previous,omitempty"` + // Opaque cursor token for the next page (empty when none) + Next *string `json:"next,omitempty"` + Data []App `json:"data"` } -func (l *ListAppsResponseData) GetCurrentPage() *int64 { +func (l *ListAppsResponseCursor) GetPageSize() *int64 { if l == nil { return nil } - return l.CurrentPage + return l.PageSize } -func (l *ListAppsResponseData) GetPreviousPage() *int64 { +func (l *ListAppsResponseCursor) GetHasMore() bool { if l == nil { - return nil - } - return l.PreviousPage -} - -func (l *ListAppsResponseData) GetNextPage() *int64 { - if l == nil { - return nil + return false } - return l.NextPage + return l.HasMore } -func (l *ListAppsResponseData) GetTotalPages() *int64 { +func (l *ListAppsResponseCursor) GetPrevious() *string { if l == nil { return nil } - return l.TotalPages + return l.Previous } -func (l *ListAppsResponseData) GetTotalCount() *int64 { +func (l *ListAppsResponseCursor) GetNext() *string { if l == nil { return nil } - return l.TotalCount + return l.Next } -func (l *ListAppsResponseData) GetItems() []App { +func (l *ListAppsResponseCursor) GetData() []App { if l == nil { return []App{} } - return l.Items + return l.Data } type ListAppsResponse struct { - Data ListAppsResponseData `json:"data"` + Cursor ListAppsResponseCursor `json:"cursor"` } -func (l *ListAppsResponse) GetData() ListAppsResponseData { +func (l *ListAppsResponse) GetCursor() ListAppsResponseCursor { if l == nil { - return ListAppsResponseData{} + return ListAppsResponseCursor{} } - return l.Data + return l.Cursor } diff --git a/internal/deployserverclient/models/components/listdeploymentsresponse.go b/internal/deployserverclient/models/components/listdeploymentsresponse.go new file mode 100644 index 00000000..e6a14515 --- /dev/null +++ b/internal/deployserverclient/models/components/listdeploymentsresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 2c3a36f113ed + +package components + +// ListDeploymentsResponseCursor - Cursor pagination envelope. `next` and `previous` are opaque tokens +// produced by the server; pass them back as `?cursor=` to fetch the +// adjacent page. `hasMore` is `true` when more results exist after the +// current page. `pageSize` echoes the page size used for this page. +type ListDeploymentsResponseCursor struct { + // Number of items requested for this page + PageSize *int64 `json:"pageSize,omitempty"` + // True when more results exist after this page + HasMore bool `json:"hasMore"` + // Opaque cursor token for the previous page (empty when none) + Previous *string `json:"previous,omitempty"` + // Opaque cursor token for the next page (empty when none) + Next *string `json:"next,omitempty"` + Data []DeploymentResource `json:"data"` +} + +func (l *ListDeploymentsResponseCursor) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListDeploymentsResponseCursor) GetHasMore() bool { + if l == nil { + return false + } + return l.HasMore +} + +func (l *ListDeploymentsResponseCursor) GetPrevious() *string { + if l == nil { + return nil + } + return l.Previous +} + +func (l *ListDeploymentsResponseCursor) GetNext() *string { + if l == nil { + return nil + } + return l.Next +} + +func (l *ListDeploymentsResponseCursor) GetData() []DeploymentResource { + if l == nil { + return []DeploymentResource{} + } + return l.Data +} + +type ListDeploymentsResponse struct { + Cursor ListDeploymentsResponseCursor `json:"cursor"` +} + +func (l *ListDeploymentsResponse) GetCursor() ListDeploymentsResponseCursor { + if l == nil { + return ListDeploymentsResponseCursor{} + } + return l.Cursor +} diff --git a/internal/deployserverclient/models/components/listmanifestsresponse.go b/internal/deployserverclient/models/components/listmanifestsresponse.go new file mode 100644 index 00000000..2911e50d --- /dev/null +++ b/internal/deployserverclient/models/components/listmanifestsresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: db96081c00d7 + +package components + +// ListManifestsResponseCursor - Cursor pagination envelope. `next` and `previous` are opaque tokens +// produced by the server; pass them back as `?cursor=` to fetch the +// adjacent page. `hasMore` is `true` when more results exist after the +// current page. `pageSize` echoes the page size used for this page. +type ListManifestsResponseCursor struct { + // Number of items requested for this page + PageSize *int64 `json:"pageSize,omitempty"` + // True when more results exist after this page + HasMore bool `json:"hasMore"` + // Opaque cursor token for the previous page (empty when none) + Previous *string `json:"previous,omitempty"` + // Opaque cursor token for the next page (empty when none) + Next *string `json:"next,omitempty"` + Data []Manifest `json:"data"` +} + +func (l *ListManifestsResponseCursor) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListManifestsResponseCursor) GetHasMore() bool { + if l == nil { + return false + } + return l.HasMore +} + +func (l *ListManifestsResponseCursor) GetPrevious() *string { + if l == nil { + return nil + } + return l.Previous +} + +func (l *ListManifestsResponseCursor) GetNext() *string { + if l == nil { + return nil + } + return l.Next +} + +func (l *ListManifestsResponseCursor) GetData() []Manifest { + if l == nil { + return []Manifest{} + } + return l.Data +} + +type ListManifestsResponse struct { + Cursor ListManifestsResponseCursor `json:"cursor"` +} + +func (l *ListManifestsResponse) GetCursor() ListManifestsResponseCursor { + if l == nil { + return ListManifestsResponseCursor{} + } + return l.Cursor +} diff --git a/internal/deployserverclient/models/components/listmanifestversionsresponse.go b/internal/deployserverclient/models/components/listmanifestversionsresponse.go new file mode 100644 index 00000000..6d02f172 --- /dev/null +++ b/internal/deployserverclient/models/components/listmanifestversionsresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 3e9aea6345f2 + +package components + +// ListManifestVersionsResponseCursor - Cursor pagination envelope. `next` and `previous` are opaque tokens +// produced by the server; pass them back as `?cursor=` to fetch the +// adjacent page. `hasMore` is `true` when more results exist after the +// current page. `pageSize` echoes the page size used for this page. +type ListManifestVersionsResponseCursor struct { + // Number of items requested for this page + PageSize *int64 `json:"pageSize,omitempty"` + // True when more results exist after this page + HasMore bool `json:"hasMore"` + // Opaque cursor token for the previous page (empty when none) + Previous *string `json:"previous,omitempty"` + // Opaque cursor token for the next page (empty when none) + Next *string `json:"next,omitempty"` + Data []ManifestVersion `json:"data"` +} + +func (l *ListManifestVersionsResponseCursor) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListManifestVersionsResponseCursor) GetHasMore() bool { + if l == nil { + return false + } + return l.HasMore +} + +func (l *ListManifestVersionsResponseCursor) GetPrevious() *string { + if l == nil { + return nil + } + return l.Previous +} + +func (l *ListManifestVersionsResponseCursor) GetNext() *string { + if l == nil { + return nil + } + return l.Next +} + +func (l *ListManifestVersionsResponseCursor) GetData() []ManifestVersion { + if l == nil { + return []ManifestVersion{} + } + return l.Data +} + +type ListManifestVersionsResponse struct { + Cursor ListManifestVersionsResponseCursor `json:"cursor"` +} + +func (l *ListManifestVersionsResponse) GetCursor() ListManifestVersionsResponseCursor { + if l == nil { + return ListManifestVersionsResponseCursor{} + } + return l.Cursor +} diff --git a/internal/deployserverclient/models/components/listrunsresponse.go b/internal/deployserverclient/models/components/listrunsresponse.go deleted file mode 100644 index 82094286..00000000 --- a/internal/deployserverclient/models/components/listrunsresponse.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 1d784df7fbb5 - -package components - -type ListRunsResponseData struct { - // Current page number - CurrentPage *int64 `json:"currentPage,omitempty"` - // Previous page number - PreviousPage *int64 `json:"previousPage,omitempty"` - // Next page number - NextPage *int64 `json:"nextPage,omitempty"` - // Total number of pages - TotalPages *int64 `json:"totalPages,omitempty"` - // Total number of items - TotalCount *int64 `json:"totalCount,omitempty"` - Items []Run `json:"items"` -} - -func (l *ListRunsResponseData) GetCurrentPage() *int64 { - if l == nil { - return nil - } - return l.CurrentPage -} - -func (l *ListRunsResponseData) GetPreviousPage() *int64 { - if l == nil { - return nil - } - return l.PreviousPage -} - -func (l *ListRunsResponseData) GetNextPage() *int64 { - if l == nil { - return nil - } - return l.NextPage -} - -func (l *ListRunsResponseData) GetTotalPages() *int64 { - if l == nil { - return nil - } - return l.TotalPages -} - -func (l *ListRunsResponseData) GetTotalCount() *int64 { - if l == nil { - return nil - } - return l.TotalCount -} - -func (l *ListRunsResponseData) GetItems() []Run { - if l == nil { - return []Run{} - } - return l.Items -} - -type ListRunsResponse struct { - Data ListRunsResponseData `json:"data"` -} - -func (l *ListRunsResponse) GetData() ListRunsResponseData { - if l == nil { - return ListRunsResponseData{} - } - return l.Data -} diff --git a/internal/deployserverclient/models/components/listversionsresponse.go b/internal/deployserverclient/models/components/listversionsresponse.go deleted file mode 100644 index db62864a..00000000 --- a/internal/deployserverclient/models/components/listversionsresponse.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 4e6592758a04 - -package components - -type ListVersionsResponseData struct { - // Current page number - CurrentPage *int64 `json:"currentPage,omitempty"` - // Previous page number - PreviousPage *int64 `json:"previousPage,omitempty"` - // Next page number - NextPage *int64 `json:"nextPage,omitempty"` - // Total number of pages - TotalPages *int64 `json:"totalPages,omitempty"` - // Total number of items - TotalCount *int64 `json:"totalCount,omitempty"` - Items []ConfigurationVersion `json:"items"` -} - -func (l *ListVersionsResponseData) GetCurrentPage() *int64 { - if l == nil { - return nil - } - return l.CurrentPage -} - -func (l *ListVersionsResponseData) GetPreviousPage() *int64 { - if l == nil { - return nil - } - return l.PreviousPage -} - -func (l *ListVersionsResponseData) GetNextPage() *int64 { - if l == nil { - return nil - } - return l.NextPage -} - -func (l *ListVersionsResponseData) GetTotalPages() *int64 { - if l == nil { - return nil - } - return l.TotalPages -} - -func (l *ListVersionsResponseData) GetTotalCount() *int64 { - if l == nil { - return nil - } - return l.TotalCount -} - -func (l *ListVersionsResponseData) GetItems() []ConfigurationVersion { - if l == nil { - return []ConfigurationVersion{} - } - return l.Items -} - -type ListVersionsResponse struct { - Data ListVersionsResponseData `json:"data"` -} - -func (l *ListVersionsResponse) GetData() ListVersionsResponseData { - if l == nil { - return ListVersionsResponseData{} - } - return l.Data -} diff --git a/internal/deployserverclient/models/components/manifest.go b/internal/deployserverclient/models/components/manifest.go new file mode 100644 index 00000000..5057e763 --- /dev/null +++ b/internal/deployserverclient/models/components/manifest.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: f6810ad982e8 + +package components + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" + "time" +) + +type Manifest struct { + // Unique identifier for the manifest + ID string `json:"id"` + // Name of the manifest + Name string `json:"name"` + // Latest version number + LatestVersion int64 `json:"latestVersion"` + // Timestamp when the manifest was created + CreatedAt time.Time `json:"createdAt"` + // Timestamp when the manifest was last updated + UpdatedAt time.Time `json:"updatedAt"` +} + +func (m Manifest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Manifest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *Manifest) GetID() string { + if m == nil { + return "" + } + return m.ID +} + +func (m *Manifest) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +func (m *Manifest) GetLatestVersion() int64 { + if m == nil { + return 0 + } + return m.LatestVersion +} + +func (m *Manifest) GetCreatedAt() time.Time { + if m == nil { + return time.Time{} + } + return m.CreatedAt +} + +func (m *Manifest) GetUpdatedAt() time.Time { + if m == nil { + return time.Time{} + } + return m.UpdatedAt +} diff --git a/internal/deployserverclient/models/components/manifestresponse.go b/internal/deployserverclient/models/components/manifestresponse.go new file mode 100644 index 00000000..9e920547 --- /dev/null +++ b/internal/deployserverclient/models/components/manifestresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 6a8226d38ac7 + +package components + +type ManifestResponse struct { + Data Manifest `json:"data"` +} + +func (m *ManifestResponse) GetData() Manifest { + if m == nil { + return Manifest{} + } + return m.Data +} diff --git a/internal/deployserverclient/models/components/manifestversion.go b/internal/deployserverclient/models/components/manifestversion.go new file mode 100644 index 00000000..0344b172 --- /dev/null +++ b/internal/deployserverclient/models/components/manifestversion.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: a45a7b58ee06 + +package components + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" + "time" +) + +type ManifestVersion struct { + // ID of the manifest this version belongs to + ManifestID string `json:"manifestId"` + // Version number + Version int64 `json:"version"` + // Manifest content (base64-encoded). Null when listing versions, present when reading a specific version. + Content *string `json:"content,omitempty"` + // Timestamp when the version was created + CreatedAt time.Time `json:"createdAt"` +} + +func (m ManifestVersion) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ManifestVersion) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *ManifestVersion) GetManifestID() string { + if m == nil { + return "" + } + return m.ManifestID +} + +func (m *ManifestVersion) GetVersion() int64 { + if m == nil { + return 0 + } + return m.Version +} + +func (m *ManifestVersion) GetContent() *string { + if m == nil { + return nil + } + return m.Content +} + +func (m *ManifestVersion) GetCreatedAt() time.Time { + if m == nil { + return time.Time{} + } + return m.CreatedAt +} diff --git a/internal/deployserverclient/models/components/manifestversionresponse.go b/internal/deployserverclient/models/components/manifestversionresponse.go new file mode 100644 index 00000000..80e366ca --- /dev/null +++ b/internal/deployserverclient/models/components/manifestversionresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: b26b78dc49ec + +package components + +type ManifestVersionResponse struct { + Data ManifestVersion `json:"data"` +} + +func (m *ManifestVersionResponse) GetData() ManifestVersion { + if m == nil { + return ManifestVersion{} + } + return m.Data +} diff --git a/internal/deployserverclient/models/components/payments.go b/internal/deployserverclient/models/components/payments.go deleted file mode 100644 index 7d1b67c9..00000000 --- a/internal/deployserverclient/models/components/payments.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 813ef73c5fb1 - -package components - -type Connector struct { - Configuration map[string]any `json:"configuration,omitempty"` - Credentials map[string]string `json:"credentials,omitempty"` - Name string `json:"name"` - Provider string `json:"provider"` -} - -func (c *Connector) GetConfiguration() map[string]any { - if c == nil { - return nil - } - return c.Configuration -} - -func (c *Connector) GetCredentials() map[string]string { - if c == nil { - return nil - } - return c.Credentials -} - -func (c *Connector) GetName() string { - if c == nil { - return "" - } - return c.Name -} - -func (c *Connector) GetProvider() string { - if c == nil { - return "" - } - return c.Provider -} - -type Payments struct { - Connectors []Connector `json:"connectors,omitempty"` - Pools map[string]Pool `json:"pools,omitempty"` -} - -func (p *Payments) GetConnectors() []Connector { - if p == nil { - return nil - } - return p.Connectors -} - -func (p *Payments) GetPools() map[string]Pool { - if p == nil { - return nil - } - return p.Pools -} diff --git a/internal/deployserverclient/models/components/pool.go b/internal/deployserverclient/models/components/pool.go deleted file mode 100644 index 46ae746b..00000000 --- a/internal/deployserverclient/models/components/pool.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 52814f15349a - -package components - -type Pool struct { - AccountIds []string `json:"accountIds,omitempty"` - Query map[string]any `json:"query,omitempty"` -} - -func (p *Pool) GetAccountIds() []string { - if p == nil { - return nil - } - return p.AccountIds -} - -func (p *Pool) GetQuery() map[string]any { - if p == nil { - return nil - } - return p.Query -} diff --git a/internal/deployserverclient/models/components/readstateresponse.go b/internal/deployserverclient/models/components/readstateresponse.go deleted file mode 100644 index 06c746db..00000000 --- a/internal/deployserverclient/models/components/readstateresponse.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: bf78e9f0f87c - -package components - -type ReadStateResponse struct { - Data State `json:"data"` -} - -func (r *ReadStateResponse) GetData() State { - if r == nil { - return State{} - } - return r.Data -} diff --git a/internal/deployserverclient/models/components/readvariablesresponse.go b/internal/deployserverclient/models/components/readvariablesresponse.go index f9f233b9..c707e31e 100644 --- a/internal/deployserverclient/models/components/readvariablesresponse.go +++ b/internal/deployserverclient/models/components/readvariablesresponse.go @@ -3,69 +3,64 @@ package components -type ReadVariablesResponseData struct { - Items []Variable `json:"items,omitempty"` - // Current page number - CurrentPage *int64 `json:"currentPage,omitempty"` - // Previous page number - PreviousPage *int64 `json:"previousPage,omitempty"` - // Next page number - NextPage *int64 `json:"nextPage,omitempty"` - // Total number of pages - TotalPages *int64 `json:"totalPages,omitempty"` - // Total number of items - TotalCount *int64 `json:"totalCount,omitempty"` +// ReadVariablesResponseCursor - Cursor pagination envelope. `next` and `previous` are opaque tokens +// produced by the server; pass them back as `?cursor=` to fetch the +// adjacent page. `hasMore` is `true` when more results exist after the +// current page. `pageSize` echoes the page size used for this page. +type ReadVariablesResponseCursor struct { + // Number of items requested for this page + PageSize *int64 `json:"pageSize,omitempty"` + // True when more results exist after this page + HasMore bool `json:"hasMore"` + // Opaque cursor token for the previous page (empty when none) + Previous *string `json:"previous,omitempty"` + // Opaque cursor token for the next page (empty when none) + Next *string `json:"next,omitempty"` + Data []Variable `json:"data"` } -func (r *ReadVariablesResponseData) GetItems() []Variable { +func (r *ReadVariablesResponseCursor) GetPageSize() *int64 { if r == nil { return nil } - return r.Items + return r.PageSize } -func (r *ReadVariablesResponseData) GetCurrentPage() *int64 { +func (r *ReadVariablesResponseCursor) GetHasMore() bool { if r == nil { - return nil + return false } - return r.CurrentPage + return r.HasMore } -func (r *ReadVariablesResponseData) GetPreviousPage() *int64 { +func (r *ReadVariablesResponseCursor) GetPrevious() *string { if r == nil { return nil } - return r.PreviousPage + return r.Previous } -func (r *ReadVariablesResponseData) GetNextPage() *int64 { +func (r *ReadVariablesResponseCursor) GetNext() *string { if r == nil { return nil } - return r.NextPage + return r.Next } -func (r *ReadVariablesResponseData) GetTotalPages() *int64 { +func (r *ReadVariablesResponseCursor) GetData() []Variable { if r == nil { - return nil + return []Variable{} } - return r.TotalPages -} - -func (r *ReadVariablesResponseData) GetTotalCount() *int64 { - if r == nil { - return nil - } - return r.TotalCount + return r.Data } type ReadVariablesResponse struct { - Data ReadVariablesResponseData `json:"data"` + Cursor ReadVariablesResponseCursor `json:"cursor"` } -func (r *ReadVariablesResponse) GetData() ReadVariablesResponseData { +func (r *ReadVariablesResponse) GetCursor() ReadVariablesResponseCursor { if r == nil { - return ReadVariablesResponseData{} + return ReadVariablesResponseCursor{} } - return r.Data + return r.Cursor } diff --git a/internal/deployserverclient/models/components/reconciliation.go b/internal/deployserverclient/models/components/reconciliation.go deleted file mode 100644 index c14e11f6..00000000 --- a/internal/deployserverclient/models/components/reconciliation.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 93a115f26465 - -package components - -type Reconciliation struct { - Policies []ReconciliationPolicy `json:"policies,omitempty"` -} - -func (r *Reconciliation) GetPolicies() []ReconciliationPolicy { - if r == nil { - return nil - } - return r.Policies -} diff --git a/internal/deployserverclient/models/components/reconciliationledger.go b/internal/deployserverclient/models/components/reconciliationledger.go deleted file mode 100644 index 2d622c1a..00000000 --- a/internal/deployserverclient/models/components/reconciliationledger.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 503c2b3746a0 - -package components - -type ReconciliationLedger struct { - Name string `json:"name"` - Query map[string]any `json:"query"` -} - -func (r *ReconciliationLedger) GetName() string { - if r == nil { - return "" - } - return r.Name -} - -func (r *ReconciliationLedger) GetQuery() map[string]any { - if r == nil { - return nil - } - return r.Query -} diff --git a/internal/deployserverclient/models/components/reconciliationpolicy.go b/internal/deployserverclient/models/components/reconciliationpolicy.go deleted file mode 100644 index b8151f03..00000000 --- a/internal/deployserverclient/models/components/reconciliationpolicy.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 5b45b105ea5c - -package components - -type ReconciliationPolicy struct { - Ledger ReconciliationLedger `json:"ledger"` - Name string `json:"name"` - Pool string `json:"pool"` -} - -func (r *ReconciliationPolicy) GetLedger() ReconciliationLedger { - if r == nil { - return ReconciliationLedger{} - } - return r.Ledger -} - -func (r *ReconciliationPolicy) GetName() string { - if r == nil { - return "" - } - return r.Name -} - -func (r *ReconciliationPolicy) GetPool() string { - if r == nil { - return "" - } - return r.Pool -} diff --git a/internal/deployserverclient/models/components/regionselector.go b/internal/deployserverclient/models/components/regionselector.go deleted file mode 100644 index 063b9bf2..00000000 --- a/internal/deployserverclient/models/components/regionselector.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: f051ec8ea341 - -package components - -type RegionSelector struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` -} - -func (r *RegionSelector) GetID() *string { - if r == nil { - return nil - } - return r.ID -} - -func (r *RegionSelector) GetName() *string { - if r == nil { - return nil - } - return r.Name -} diff --git a/internal/deployserverclient/models/components/run.go b/internal/deployserverclient/models/components/run.go deleted file mode 100644 index 8ecf58a5..00000000 --- a/internal/deployserverclient/models/components/run.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: bb212548d46b - -package components - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" - "time" -) - -type Run struct { - // Unique identifier for the run - ID string `json:"id"` - // Whether the run was auto-applied - AutoApply bool `json:"autoApply"` - // Timestamp when the run was created - CreatedAt time.Time `json:"createdAt"` - // Whether the run is a destroy operation - IsDestroy bool `json:"isDestroy"` - // Whether the run has changes - HasChanges bool `json:"hasChanges"` - // Message associated with the run - Message string `json:"message"` - // Whether the run is a plan-only operation - PlanOnly bool `json:"planOnly"` - // Whether the run is a refresh operation - Refresh bool `json:"refresh"` - // Whether the run is a refresh-only operation - RefreshOnly bool `json:"refreshOnly"` - // Whether the run saves the plan - SavePlan bool `json:"savePlan"` - // Status of the run - Status string `json:"status"` - ConfigurationVersion *ConfigurationVersion `json:"configurationVersion,omitempty"` -} - -func (r Run) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *Run) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { - return err - } - return nil -} - -func (r *Run) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -func (r *Run) GetAutoApply() bool { - if r == nil { - return false - } - return r.AutoApply -} - -func (r *Run) GetCreatedAt() time.Time { - if r == nil { - return time.Time{} - } - return r.CreatedAt -} - -func (r *Run) GetIsDestroy() bool { - if r == nil { - return false - } - return r.IsDestroy -} - -func (r *Run) GetHasChanges() bool { - if r == nil { - return false - } - return r.HasChanges -} - -func (r *Run) GetMessage() string { - if r == nil { - return "" - } - return r.Message -} - -func (r *Run) GetPlanOnly() bool { - if r == nil { - return false - } - return r.PlanOnly -} - -func (r *Run) GetRefresh() bool { - if r == nil { - return false - } - return r.Refresh -} - -func (r *Run) GetRefreshOnly() bool { - if r == nil { - return false - } - return r.RefreshOnly -} - -func (r *Run) GetSavePlan() bool { - if r == nil { - return false - } - return r.SavePlan -} - -func (r *Run) GetStatus() string { - if r == nil { - return "" - } - return r.Status -} - -func (r *Run) GetConfigurationVersion() *ConfigurationVersion { - if r == nil { - return nil - } - return r.ConfigurationVersion -} diff --git a/internal/deployserverclient/models/components/runresponse.go b/internal/deployserverclient/models/components/runresponse.go deleted file mode 100644 index fd89b639..00000000 --- a/internal/deployserverclient/models/components/runresponse.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 37156d4174a5 - -package components - -type RunResponse struct { - Data Run `json:"data"` -} - -func (r *RunResponse) GetData() Run { - if r == nil { - return Run{} - } - return r.Data -} diff --git a/internal/deployserverclient/models/components/security.go b/internal/deployserverclient/models/components/security.go new file mode 100644 index 00000000..5f41eea6 --- /dev/null +++ b/internal/deployserverclient/models/components/security.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: f6f99ec31c6f + +package components + +type Security struct { + BearerAuth *string `security:"scheme,type=http,subtype=bearer,name=Authorization,env=deployserver_bearer_auth"` +} + +func (s *Security) GetBearerAuth() *string { + if s == nil { + return nil + } + return s.BearerAuth +} diff --git a/internal/deployserverclient/models/components/stack.go b/internal/deployserverclient/models/components/stack.go deleted file mode 100644 index 002a18db..00000000 --- a/internal/deployserverclient/models/components/stack.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 0cb6ab58393a - -package components - -type Stack struct { - Name string `json:"name"` - Region RegionSelector `json:"region"` - Version *string `json:"version,omitempty"` -} - -func (s *Stack) GetName() string { - if s == nil { - return "" - } - return s.Name -} - -func (s *Stack) GetRegion() RegionSelector { - if s == nil { - return RegionSelector{} - } - return s.Region -} - -func (s *Stack) GetVersion() *string { - if s == nil { - return nil - } - return s.Version -} diff --git a/internal/deployserverclient/models/components/state.go b/internal/deployserverclient/models/components/state.go index 36d6cfe5..4a14aefd 100644 --- a/internal/deployserverclient/models/components/state.go +++ b/internal/deployserverclient/models/components/state.go @@ -4,7 +4,10 @@ package components type State struct { - // The stack details from the Terraform state + // The live stack details reported by Formance Cloud (a projection of + // the bound stack from Membership). Shape is a free-form object + // mirroring the upstream stack resource. + // Stack map[string]any `json:"stack"` } diff --git a/internal/deployserverclient/models/components/updateapprequest.go b/internal/deployserverclient/models/components/updateapprequest.go index c7a05a2d..7045a1fb 100644 --- a/internal/deployserverclient/models/components/updateapprequest.go +++ b/internal/deployserverclient/models/components/updateapprequest.go @@ -4,4 +4,13 @@ package components type UpdateAppRequest struct { + // Updated name for the app + Name string `json:"name"` +} + +func (u *UpdateAppRequest) GetName() string { + if u == nil { + return "" + } + return u.Name } diff --git a/internal/deployserverclient/models/components/updatemanifestrequest.go b/internal/deployserverclient/models/components/updatemanifestrequest.go new file mode 100644 index 00000000..8cd2a385 --- /dev/null +++ b/internal/deployserverclient/models/components/updatemanifestrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 7b78c92173e3 + +package components + +type UpdateManifestRequest struct { + // Updated name for the manifest + Name string `json:"name"` +} + +func (u *UpdateManifestRequest) GetName() string { + if u == nil { + return "" + } + return u.Name +} diff --git a/internal/deployserverclient/models/components/v2chartaccountmetadata.go b/internal/deployserverclient/models/components/v2chartaccountmetadata.go deleted file mode 100644 index 86a7afa2..00000000 --- a/internal/deployserverclient/models/components/v2chartaccountmetadata.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 491d4a959c4e - -package components - -type V2ChartAccountMetadata struct { - Default *string `json:"default,omitempty"` -} - -func (v *V2ChartAccountMetadata) GetDefault() *string { - if v == nil { - return nil - } - return v.Default -} - -// #region class-body-v2chartaccountmetadata -// #endregion class-body-v2chartaccountmetadata diff --git a/internal/deployserverclient/models/components/v2chartaccountrules.go b/internal/deployserverclient/models/components/v2chartaccountrules.go deleted file mode 100644 index 76ccec55..00000000 --- a/internal/deployserverclient/models/components/v2chartaccountrules.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: c1d801e21cc5 - -package components - -type V2ChartAccountRules struct { -} - -// #region class-body-v2chartaccountrules -// #endregion class-body-v2chartaccountrules diff --git a/internal/deployserverclient/models/components/v2chartsegment.go b/internal/deployserverclient/models/components/v2chartsegment.go deleted file mode 100644 index 5ea89448..00000000 --- a/internal/deployserverclient/models/components/v2chartsegment.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: d6b9525ac608 - -package components - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" -) - -type V2ChartSegment struct { - DotMetadata map[string]V2ChartAccountMetadata `json:".metadata,omitempty"` - DotPattern *string `json:".pattern,omitempty"` - DotRules *V2ChartAccountRules `json:".rules,omitempty"` - DotSelf *DotSelf `json:".self,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (v V2ChartSegment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(v, "", false) -} - -func (v *V2ChartSegment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &v, "", false, nil); err != nil { - return err - } - return nil -} - -func (v *V2ChartSegment) GetDotMetadata() map[string]V2ChartAccountMetadata { - if v == nil { - return nil - } - return v.DotMetadata -} - -func (v *V2ChartSegment) GetDotPattern() *string { - if v == nil { - return nil - } - return v.DotPattern -} - -func (v *V2ChartSegment) GetDotRules() *V2ChartAccountRules { - if v == nil { - return nil - } - return v.DotRules -} - -func (v *V2ChartSegment) GetDotSelf() *DotSelf { - if v == nil { - return nil - } - return v.DotSelf -} - -func (v *V2ChartSegment) GetAdditionalProperties() map[string]any { - if v == nil { - return nil - } - return v.AdditionalProperties -} - -// #region class-body-v2chartsegment -// #endregion class-body-v2chartsegment diff --git a/internal/deployserverclient/models/components/v2schemadata.go b/internal/deployserverclient/models/components/v2schemadata.go deleted file mode 100644 index 75680602..00000000 --- a/internal/deployserverclient/models/components/v2schemadata.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: f469d423c0af - -package components - -type V2SchemaData struct { - Chart map[string]V2ChartSegment `json:"chart,omitempty"` - Transactions map[string]V2TransactionTemplate `json:"transactions,omitempty"` -} - -func (v *V2SchemaData) GetChart() map[string]V2ChartSegment { - if v == nil { - return nil - } - return v.Chart -} - -func (v *V2SchemaData) GetTransactions() map[string]V2TransactionTemplate { - if v == nil { - return nil - } - return v.Transactions -} - -// #region class-body-v2schemadata -// #endregion class-body-v2schemadata diff --git a/internal/deployserverclient/models/components/v2transactiontemplate.go b/internal/deployserverclient/models/components/v2transactiontemplate.go deleted file mode 100644 index 7222da99..00000000 --- a/internal/deployserverclient/models/components/v2transactiontemplate.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: d8e0b9428216 - -package components - -type V2TransactionTemplate struct { - Description *string `json:"description,omitempty"` - Runtime *string `json:"runtime,omitempty"` - Script *string `json:"script,omitempty"` -} - -func (v *V2TransactionTemplate) GetDescription() *string { - if v == nil { - return nil - } - return v.Description -} - -func (v *V2TransactionTemplate) GetRuntime() *string { - if v == nil { - return nil - } - return v.Runtime -} - -func (v *V2TransactionTemplate) GetScript() *string { - if v == nil { - return nil - } - return v.Script -} - -// #region class-body-v2transactiontemplate -// #endregion class-body-v2transactiontemplate diff --git a/internal/deployserverclient/models/components/variable.go b/internal/deployserverclient/models/components/variable.go index 839f2ea7..b0a97d2a 100644 --- a/internal/deployserverclient/models/components/variable.go +++ b/internal/deployserverclient/models/components/variable.go @@ -4,14 +4,18 @@ package components type Variable struct { - // Key of the variable + // Snake-case identifier (case-insensitive at the API boundary, + // normalized to lowercase on storage to match `var.` in the + // generated HCL). Either `MONEYCORP_API_KEY` or + // `moneycorp_api_key` is accepted. + // Key string `json:"key"` - // Value of the variable + // Value of the variable. Always treated as sensitive: `value` is + // redacted (`REDACTED`) on every read endpoint. + // Value string `json:"value"` // Description of the variable Description *string `json:"description,omitempty"` - // Whether the variable is sensitive - Sensitive bool `json:"sensitive"` // Unique identifier for the variable ID string `json:"id"` } @@ -37,13 +41,6 @@ func (v *Variable) GetDescription() *string { return v.Description } -func (v *Variable) GetSensitive() bool { - if v == nil { - return false - } - return v.Sensitive -} - func (v *Variable) GetID() string { if v == nil { return "" diff --git a/internal/deployserverclient/models/components/variabledata.go b/internal/deployserverclient/models/components/variabledata.go index 9ca7263b..b1cfac06 100644 --- a/internal/deployserverclient/models/components/variabledata.go +++ b/internal/deployserverclient/models/components/variabledata.go @@ -4,14 +4,18 @@ package components type VariableData struct { - // Key of the variable + // Snake-case identifier (case-insensitive at the API boundary, + // normalized to lowercase on storage to match `var.` in the + // generated HCL). Either `MONEYCORP_API_KEY` or + // `moneycorp_api_key` is accepted. + // Key string `json:"key"` - // Value of the variable + // Value of the variable. Always treated as sensitive: `value` is + // redacted (`REDACTED`) on every read endpoint. + // Value string `json:"value"` // Description of the variable Description *string `json:"description,omitempty"` - // Whether the variable is sensitive - Sensitive bool `json:"sensitive"` } func (v *VariableData) GetKey() string { @@ -34,10 +38,3 @@ func (v *VariableData) GetDescription() *string { } return v.Description } - -func (v *VariableData) GetSensitive() bool { - if v == nil { - return false - } - return v.Sensitive -} diff --git a/internal/deployserverclient/models/components/webhook.go b/internal/deployserverclient/models/components/webhook.go deleted file mode 100644 index 7e498959..00000000 --- a/internal/deployserverclient/models/components/webhook.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: d567ec78b7ea - -package components - -type Webhook struct { - Endpoint string `json:"endpoint"` - Events []string `json:"events,omitempty"` - Name string `json:"name"` - Secret *string `json:"secret,omitempty"` -} - -func (w *Webhook) GetEndpoint() string { - if w == nil { - return "" - } - return w.Endpoint -} - -func (w *Webhook) GetEvents() []string { - if w == nil { - return nil - } - return w.Events -} - -func (w *Webhook) GetName() string { - if w == nil { - return "" - } - return w.Name -} - -func (w *Webhook) GetSecret() *string { - if w == nil { - return nil - } - return w.Secret -} diff --git a/internal/deployserverclient/models/operations/attachappmanifest.go b/internal/deployserverclient/models/operations/attachappmanifest.go new file mode 100644 index 00000000..5833ba6a --- /dev/null +++ b/internal/deployserverclient/models/operations/attachappmanifest.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 857d985e78ef + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type AttachAppManifestRequest struct { + ID string `pathParam:"style=simple,explode=false,name=id"` + AttachManifestRequest components.AttachManifestRequest `request:"mediaType=application/json"` +} + +func (a *AttachAppManifestRequest) GetID() string { + if a == nil { + return "" + } + return a.ID +} + +func (a *AttachAppManifestRequest) GetAttachManifestRequest() components.AttachManifestRequest { + if a == nil { + return components.AttachManifestRequest{} + } + return a.AttachManifestRequest +} + +type AttachAppManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // manifestId missing or empty + Error *components.Error +} + +func (a *AttachAppManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if a == nil { + return components.HTTPMetadata{} + } + return a.HTTPMeta +} + +func (a *AttachAppManifestResponse) GetError() *components.Error { + if a == nil { + return nil + } + return a.Error +} diff --git a/internal/deployserverclient/models/operations/createdeployment.go b/internal/deployserverclient/models/operations/createdeployment.go new file mode 100644 index 00000000..03c8cee8 --- /dev/null +++ b/internal/deployserverclient/models/operations/createdeployment.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 326b5e3d00e2 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type CreateDeploymentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Deployment created successfully + DeploymentResponse *components.DeploymentResponse + // Error + Error *components.Error +} + +func (c *CreateDeploymentResponse) GetHTTPMeta() components.HTTPMetadata { + if c == nil { + return components.HTTPMetadata{} + } + return c.HTTPMeta +} + +func (c *CreateDeploymentResponse) GetDeploymentResponse() *components.DeploymentResponse { + if c == nil { + return nil + } + return c.DeploymentResponse +} + +func (c *CreateDeploymentResponse) GetError() *components.Error { + if c == nil { + return nil + } + return c.Error +} diff --git a/internal/deployserverclient/models/operations/createmanifest.go b/internal/deployserverclient/models/operations/createmanifest.go new file mode 100644 index 00000000..8640b852 --- /dev/null +++ b/internal/deployserverclient/models/operations/createmanifest.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 7be33bfb9044 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +// CreateManifestRequestBody - JSON manifest content +type CreateManifestRequestBody struct { +} + +type CreateManifestRequest struct { + // Name for the manifest + Name string `queryParam:"style=form,explode=true,name=name"` + RequestBody CreateManifestRequestBody `request:"mediaType=application/json"` +} + +func (c *CreateManifestRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *CreateManifestRequest) GetRequestBody() CreateManifestRequestBody { + if c == nil { + return CreateManifestRequestBody{} + } + return c.RequestBody +} + +type CreateManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest created successfully + CreateManifestResponse *components.CreateManifestResponse + // Error + Error *components.Error +} + +func (c *CreateManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if c == nil { + return components.HTTPMetadata{} + } + return c.HTTPMeta +} + +func (c *CreateManifestResponse) GetCreateManifestResponse() *components.CreateManifestResponse { + if c == nil { + return nil + } + return c.CreateManifestResponse +} + +func (c *CreateManifestResponse) GetError() *components.Error { + if c == nil { + return nil + } + return c.Error +} diff --git a/internal/deployserverclient/models/operations/createmanifestraw.go b/internal/deployserverclient/models/operations/createmanifestraw.go new file mode 100644 index 00000000..8aad3fd7 --- /dev/null +++ b/internal/deployserverclient/models/operations/createmanifestraw.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 15dca3cfa2e6 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type CreateManifestRawRequest struct { + // Name for the manifest + Name string `queryParam:"style=form,explode=true,name=name"` + // This field accepts []byte data or io.Reader implementations, such as *os.File. + RequestBody any `request:"mediaType=application/yaml"` +} + +func (c *CreateManifestRawRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *CreateManifestRawRequest) GetRequestBody() any { + if c == nil { + return nil + } + return c.RequestBody +} + +type CreateManifestRawResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest created successfully + CreateManifestResponse *components.CreateManifestResponse + // Error + Error *components.Error +} + +func (c *CreateManifestRawResponse) GetHTTPMeta() components.HTTPMetadata { + if c == nil { + return components.HTTPMetadata{} + } + return c.HTTPMeta +} + +func (c *CreateManifestRawResponse) GetCreateManifestResponse() *components.CreateManifestResponse { + if c == nil { + return nil + } + return c.CreateManifestResponse +} + +func (c *CreateManifestRawResponse) GetError() *components.Error { + if c == nil { + return nil + } + return c.Error +} diff --git a/internal/deployserverclient/models/operations/deleteapp.go b/internal/deployserverclient/models/operations/deleteapp.go index ebfdb319..c6a72d8b 100644 --- a/internal/deployserverclient/models/operations/deleteapp.go +++ b/internal/deployserverclient/models/operations/deleteapp.go @@ -4,11 +4,27 @@ package operations import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/internal/utils" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" ) type DeleteAppRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` + // When `true`, the call blocks until the destroy deployment reaches a + // terminal status. Default `false` (returns 202 Accepted). + // + Wait *bool `default:"false" queryParam:"style=form,explode=true,name=wait"` +} + +func (d DeleteAppRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteAppRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil } func (d *DeleteAppRequest) GetID() string { @@ -18,8 +34,20 @@ func (d *DeleteAppRequest) GetID() string { return d.ID } +func (d *DeleteAppRequest) GetWait() *bool { + if d == nil { + return nil + } + return d.Wait +} + type DeleteAppResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` + // Soft-delete accepted. Cleanup runs asynchronously. The + // `Location` header points at the destroy deployment if one was + // enqueued. + // + DeleteAppResponse *components.DeleteAppResponse // Error Error *components.Error } @@ -31,6 +59,13 @@ func (d *DeleteAppResponse) GetHTTPMeta() components.HTTPMetadata { return d.HTTPMeta } +func (d *DeleteAppResponse) GetDeleteAppResponse() *components.DeleteAppResponse { + if d == nil { + return nil + } + return d.DeleteAppResponse +} + func (d *DeleteAppResponse) GetError() *components.Error { if d == nil { return nil diff --git a/internal/deployserverclient/models/operations/deletemanifest.go b/internal/deployserverclient/models/operations/deletemanifest.go new file mode 100644 index 00000000..06b43a2f --- /dev/null +++ b/internal/deployserverclient/models/operations/deletemanifest.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 74acf540b4e9 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type DeleteManifestRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` +} + +func (d *DeleteManifestRequest) GetManifestID() string { + if d == nil { + return "" + } + return d.ManifestID +} + +type DeleteManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest is still referenced by deployments + Error *components.Error +} + +func (d *DeleteManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if d == nil { + return components.HTTPMetadata{} + } + return d.HTTPMeta +} + +func (d *DeleteManifestResponse) GetError() *components.Error { + if d == nil { + return nil + } + return d.Error +} diff --git a/internal/deployserverclient/models/operations/deployappconfiguration.go b/internal/deployserverclient/models/operations/deployappconfiguration.go deleted file mode 100644 index 35c6066d..00000000 --- a/internal/deployserverclient/models/operations/deployappconfiguration.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 8e90a0308c1e - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type DeployAppConfigurationRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - Application components.Application `request:"mediaType=application/json"` -} - -func (d *DeployAppConfigurationRequest) GetID() string { - if d == nil { - return "" - } - return d.ID -} - -func (d *DeployAppConfigurationRequest) GetApplication() components.Application { - if d == nil { - return components.Application{} - } - return d.Application -} - -type DeployAppConfigurationResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // App configuration deployed successfully - RunResponse *components.RunResponse - // Error - Error *components.Error -} - -func (d *DeployAppConfigurationResponse) GetHTTPMeta() components.HTTPMetadata { - if d == nil { - return components.HTTPMetadata{} - } - return d.HTTPMeta -} - -func (d *DeployAppConfigurationResponse) GetRunResponse() *components.RunResponse { - if d == nil { - return nil - } - return d.RunResponse -} - -func (d *DeployAppConfigurationResponse) GetError() *components.Error { - if d == nil { - return nil - } - return d.Error -} diff --git a/internal/deployserverclient/models/operations/deployappconfigurationraw.go b/internal/deployserverclient/models/operations/deployappconfigurationraw.go deleted file mode 100644 index 4e9796f4..00000000 --- a/internal/deployserverclient/models/operations/deployappconfigurationraw.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: da484da15385 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type DeployAppConfigurationRawRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - // This field accepts []byte data or io.Reader implementations, such as *os.File. - RequestBody any `request:"mediaType=application/yaml"` -} - -func (d *DeployAppConfigurationRawRequest) GetID() string { - if d == nil { - return "" - } - return d.ID -} - -func (d *DeployAppConfigurationRawRequest) GetRequestBody() any { - if d == nil { - return nil - } - return d.RequestBody -} - -type DeployAppConfigurationRawResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // App configuration deployed successfully - RunResponse *components.RunResponse - // Error - Error *components.Error -} - -func (d *DeployAppConfigurationRawResponse) GetHTTPMeta() components.HTTPMetadata { - if d == nil { - return components.HTTPMetadata{} - } - return d.HTTPMeta -} - -func (d *DeployAppConfigurationRawResponse) GetRunResponse() *components.RunResponse { - if d == nil { - return nil - } - return d.RunResponse -} - -func (d *DeployAppConfigurationRawResponse) GetError() *components.Error { - if d == nil { - return nil - } - return d.Error -} diff --git a/internal/deployserverclient/models/operations/detachappmanifest.go b/internal/deployserverclient/models/operations/detachappmanifest.go new file mode 100644 index 00000000..dfa94ca5 --- /dev/null +++ b/internal/deployserverclient/models/operations/detachappmanifest.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 3b7d438b6e4b + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type DetachAppManifestRequest struct { + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (d *DetachAppManifestRequest) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +type DetachAppManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Error + Error *components.Error +} + +func (d *DetachAppManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if d == nil { + return components.HTTPMetadata{} + } + return d.HTTPMeta +} + +func (d *DetachAppManifestResponse) GetError() *components.Error { + if d == nil { + return nil + } + return d.Error +} diff --git a/internal/deployserverclient/models/operations/listapps.go b/internal/deployserverclient/models/operations/listapps.go index cffd13ec..35573e66 100644 --- a/internal/deployserverclient/models/operations/listapps.go +++ b/internal/deployserverclient/models/operations/listapps.go @@ -8,30 +8,30 @@ import ( ) type ListAppsRequest struct { - OrganizationID string `queryParam:"style=form,explode=true,name=organizationId"` - PageNumber *int64 `queryParam:"style=form,explode=true,name=pageNumber"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Maximum number of items to return on the first page. Capped at 100; + // ignored when `cursor` is supplied (subsequent pages reuse the page + // size baked into the cursor token). Defaults to 100. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Opaque pagination token returned in `cursor.next` / `cursor.previous` + // on the previous page. Pass it back unchanged to fetch the adjacent + // page. Mutually exclusive with `pageSize` after the first request. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` } -func (l *ListAppsRequest) GetOrganizationID() string { - if l == nil { - return "" - } - return l.OrganizationID -} - -func (l *ListAppsRequest) GetPageNumber() *int64 { +func (l *ListAppsRequest) GetPageSize() *int64 { if l == nil { return nil } - return l.PageNumber + return l.PageSize } -func (l *ListAppsRequest) GetPageSize() *int64 { +func (l *ListAppsRequest) GetCursor() *string { if l == nil { return nil } - return l.PageSize + return l.Cursor } type ListAppsResponse struct { diff --git a/internal/deployserverclient/models/operations/listdeployments.go b/internal/deployserverclient/models/operations/listdeployments.go new file mode 100644 index 00000000..6c51c65b --- /dev/null +++ b/internal/deployserverclient/models/operations/listdeployments.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: d893847d4513 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type ListDeploymentsRequest struct { + AppID *string `queryParam:"style=form,explode=true,name=appId"` + // Maximum number of items to return on the first page. Capped at 100; + // ignored when `cursor` is supplied (subsequent pages reuse the page + // size baked into the cursor token). Defaults to 100. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Opaque pagination token returned in `cursor.next` / `cursor.previous` + // on the previous page. Pass it back unchanged to fetch the adjacent + // page. Mutually exclusive with `pageSize` after the first request. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (l *ListDeploymentsRequest) GetAppID() *string { + if l == nil { + return nil + } + return l.AppID +} + +func (l *ListDeploymentsRequest) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListDeploymentsRequest) GetCursor() *string { + if l == nil { + return nil + } + return l.Cursor +} + +type ListDeploymentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Deployments retrieved successfully + ListDeploymentsResponse *components.ListDeploymentsResponse + // Error + Error *components.Error +} + +func (l *ListDeploymentsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { + return components.HTTPMetadata{} + } + return l.HTTPMeta +} + +func (l *ListDeploymentsResponse) GetListDeploymentsResponse() *components.ListDeploymentsResponse { + if l == nil { + return nil + } + return l.ListDeploymentsResponse +} + +func (l *ListDeploymentsResponse) GetError() *components.Error { + if l == nil { + return nil + } + return l.Error +} diff --git a/internal/deployserverclient/models/operations/listmanifests.go b/internal/deployserverclient/models/operations/listmanifests.go new file mode 100644 index 00000000..fb5f4953 --- /dev/null +++ b/internal/deployserverclient/models/operations/listmanifests.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: bc6fb185b576 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type ListManifestsRequest struct { + // Maximum number of items to return on the first page. Capped at 100; + // ignored when `cursor` is supplied (subsequent pages reuse the page + // size baked into the cursor token). Defaults to 100. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Opaque pagination token returned in `cursor.next` / `cursor.previous` + // on the previous page. Pass it back unchanged to fetch the adjacent + // page. Mutually exclusive with `pageSize` after the first request. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (l *ListManifestsRequest) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListManifestsRequest) GetCursor() *string { + if l == nil { + return nil + } + return l.Cursor +} + +type ListManifestsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifests retrieved successfully + ListManifestsResponse *components.ListManifestsResponse + // Error + Error *components.Error +} + +func (l *ListManifestsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { + return components.HTTPMetadata{} + } + return l.HTTPMeta +} + +func (l *ListManifestsResponse) GetListManifestsResponse() *components.ListManifestsResponse { + if l == nil { + return nil + } + return l.ListManifestsResponse +} + +func (l *ListManifestsResponse) GetError() *components.Error { + if l == nil { + return nil + } + return l.Error +} diff --git a/internal/deployserverclient/models/operations/listmanifestversions.go b/internal/deployserverclient/models/operations/listmanifestversions.go new file mode 100644 index 00000000..383a02ec --- /dev/null +++ b/internal/deployserverclient/models/operations/listmanifestversions.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: e8bf8a35a4b6 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type ListManifestVersionsRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + // Maximum number of items to return on the first page. Capped at 100; + // ignored when `cursor` is supplied (subsequent pages reuse the page + // size baked into the cursor token). Defaults to 100. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Opaque pagination token returned in `cursor.next` / `cursor.previous` + // on the previous page. Pass it back unchanged to fetch the adjacent + // page. Mutually exclusive with `pageSize` after the first request. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (l *ListManifestVersionsRequest) GetManifestID() string { + if l == nil { + return "" + } + return l.ManifestID +} + +func (l *ListManifestVersionsRequest) GetPageSize() *int64 { + if l == nil { + return nil + } + return l.PageSize +} + +func (l *ListManifestVersionsRequest) GetCursor() *string { + if l == nil { + return nil + } + return l.Cursor +} + +type ListManifestVersionsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest versions retrieved successfully + ListManifestVersionsResponse *components.ListManifestVersionsResponse + // Error + Error *components.Error +} + +func (l *ListManifestVersionsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { + return components.HTTPMetadata{} + } + return l.HTTPMeta +} + +func (l *ListManifestVersionsResponse) GetListManifestVersionsResponse() *components.ListManifestVersionsResponse { + if l == nil { + return nil + } + return l.ListManifestVersionsResponse +} + +func (l *ListManifestVersionsResponse) GetError() *components.Error { + if l == nil { + return nil + } + return l.Error +} diff --git a/internal/deployserverclient/models/operations/options.go b/internal/deployserverclient/models/operations/options.go index 42fca769..6c56bd90 100644 --- a/internal/deployserverclient/models/operations/options.go +++ b/internal/deployserverclient/models/operations/options.go @@ -22,9 +22,9 @@ const ( type AcceptHeaderEnum string const ( - AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" - AcceptHeaderEnumApplicationYaml AcceptHeaderEnum = "application/yaml" - AcceptHeaderEnumApplicationGzip AcceptHeaderEnum = "application/gzip" + AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" + AcceptHeaderEnumApplicationXYaml AcceptHeaderEnum = "application/x-yaml" + AcceptHeaderEnumApplicationYaml AcceptHeaderEnum = "application/yaml" ) func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum { diff --git a/internal/deployserverclient/models/operations/pushmanifestversion.go b/internal/deployserverclient/models/operations/pushmanifestversion.go new file mode 100644 index 00000000..d8c0578c --- /dev/null +++ b/internal/deployserverclient/models/operations/pushmanifestversion.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 0f7af438ef3a + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +// PushManifestVersionRequestBody - JSON manifest content +type PushManifestVersionRequestBody struct { +} + +type PushManifestVersionRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + RequestBody PushManifestVersionRequestBody `request:"mediaType=application/json"` +} + +func (p *PushManifestVersionRequest) GetManifestID() string { + if p == nil { + return "" + } + return p.ManifestID +} + +func (p *PushManifestVersionRequest) GetRequestBody() PushManifestVersionRequestBody { + if p == nil { + return PushManifestVersionRequestBody{} + } + return p.RequestBody +} + +type PushManifestVersionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest version created successfully + ManifestVersionResponse *components.ManifestVersionResponse + // Error + Error *components.Error +} + +func (p *PushManifestVersionResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PushManifestVersionResponse) GetManifestVersionResponse() *components.ManifestVersionResponse { + if p == nil { + return nil + } + return p.ManifestVersionResponse +} + +func (p *PushManifestVersionResponse) GetError() *components.Error { + if p == nil { + return nil + } + return p.Error +} diff --git a/internal/deployserverclient/models/operations/pushmanifestversionraw.go b/internal/deployserverclient/models/operations/pushmanifestversionraw.go new file mode 100644 index 00000000..03411e7c --- /dev/null +++ b/internal/deployserverclient/models/operations/pushmanifestversionraw.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 4d4b476a2bc8 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type PushManifestVersionRawRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + // This field accepts []byte data or io.Reader implementations, such as *os.File. + RequestBody any `request:"mediaType=application/yaml"` +} + +func (p *PushManifestVersionRawRequest) GetManifestID() string { + if p == nil { + return "" + } + return p.ManifestID +} + +func (p *PushManifestVersionRawRequest) GetRequestBody() any { + if p == nil { + return nil + } + return p.RequestBody +} + +type PushManifestVersionRawResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest version created successfully + ManifestVersionResponse *components.ManifestVersionResponse + // Error + Error *components.Error +} + +func (p *PushManifestVersionRawResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PushManifestVersionRawResponse) GetManifestVersionResponse() *components.ManifestVersionResponse { + if p == nil { + return nil + } + return p.ManifestVersionResponse +} + +func (p *PushManifestVersionRawResponse) GetError() *components.Error { + if p == nil { + return nil + } + return p.Error +} diff --git a/internal/deployserverclient/models/operations/readapp.go b/internal/deployserverclient/models/operations/readapp.go index c0da89ff..fdaf235b 100644 --- a/internal/deployserverclient/models/operations/readapp.go +++ b/internal/deployserverclient/models/operations/readapp.go @@ -4,11 +4,42 @@ package operations import ( + "encoding/json" + "fmt" "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" ) +type ReadAppInclude string + +const ( + ReadAppIncludeState ReadAppInclude = "state" +) + +func (e ReadAppInclude) ToPointer() *ReadAppInclude { + return &e +} +func (e *ReadAppInclude) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "state": + *e = ReadAppInclude(v) + return nil + default: + return fmt.Errorf("invalid value for ReadAppInclude: %v", v) + } +} + type ReadAppRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` + // Comma-separated list of related resources to include. + // - `state`: Include the live stack state reported by Formance Cloud + // (a projection of the bound stack from Membership, not a snapshot + // persisted by the proxy). + // + Include []ReadAppInclude `queryParam:"style=form,explode=true,name=include"` } func (r *ReadAppRequest) GetID() string { @@ -18,6 +49,13 @@ func (r *ReadAppRequest) GetID() string { return r.ID } +func (r *ReadAppRequest) GetInclude() []ReadAppInclude { + if r == nil { + return nil + } + return r.Include +} + type ReadAppResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // App details retrieved successfully diff --git a/internal/deployserverclient/models/operations/readappcurrentstateversion.go b/internal/deployserverclient/models/operations/readappcurrentstateversion.go deleted file mode 100644 index 25aa5b88..00000000 --- a/internal/deployserverclient/models/operations/readappcurrentstateversion.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 43c91c9a5fd7 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadAppCurrentStateVersionRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (r *ReadAppCurrentStateVersionRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -type ReadAppCurrentStateVersionResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Current state version retrieved successfully - ReadStateResponse *components.ReadStateResponse - // Error - Error *components.Error -} - -func (r *ReadAppCurrentStateVersionResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadAppCurrentStateVersionResponse) GetReadStateResponse() *components.ReadStateResponse { - if r == nil { - return nil - } - return r.ReadStateResponse -} - -func (r *ReadAppCurrentStateVersionResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readappruns.go b/internal/deployserverclient/models/operations/readappruns.go deleted file mode 100644 index 8f5ff67e..00000000 --- a/internal/deployserverclient/models/operations/readappruns.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: a61642c0d316 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadAppRunsRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - PageNumber *int64 `queryParam:"style=form,explode=true,name=pageNumber"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` -} - -func (r *ReadAppRunsRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -func (r *ReadAppRunsRequest) GetPageNumber() *int64 { - if r == nil { - return nil - } - return r.PageNumber -} - -func (r *ReadAppRunsRequest) GetPageSize() *int64 { - if r == nil { - return nil - } - return r.PageSize -} - -type ReadAppRunsResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // App runs retrieved successfully - ListRunsResponse *components.ListRunsResponse - // Error - Error *components.Error -} - -func (r *ReadAppRunsResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadAppRunsResponse) GetListRunsResponse() *components.ListRunsResponse { - if r == nil { - return nil - } - return r.ListRunsResponse -} - -func (r *ReadAppRunsResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readappvariables.go b/internal/deployserverclient/models/operations/readappvariables.go index f642a034..b273ef6b 100644 --- a/internal/deployserverclient/models/operations/readappvariables.go +++ b/internal/deployserverclient/models/operations/readappvariables.go @@ -8,9 +8,17 @@ import ( ) type ReadAppVariablesRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - PageNumber *int64 `queryParam:"style=form,explode=true,name=pageNumber"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + ID string `pathParam:"style=simple,explode=false,name=id"` + // Maximum number of items to return on the first page. Capped at 100; + // ignored when `cursor` is supplied (subsequent pages reuse the page + // size baked into the cursor token). Defaults to 100. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Opaque pagination token returned in `cursor.next` / `cursor.previous` + // on the previous page. Pass it back unchanged to fetch the adjacent + // page. Mutually exclusive with `pageSize` after the first request. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` } func (r *ReadAppVariablesRequest) GetID() string { @@ -20,18 +28,18 @@ func (r *ReadAppVariablesRequest) GetID() string { return r.ID } -func (r *ReadAppVariablesRequest) GetPageNumber() *int64 { +func (r *ReadAppVariablesRequest) GetPageSize() *int64 { if r == nil { return nil } - return r.PageNumber + return r.PageSize } -func (r *ReadAppVariablesRequest) GetPageSize() *int64 { +func (r *ReadAppVariablesRequest) GetCursor() *string { if r == nil { return nil } - return r.PageSize + return r.Cursor } type ReadAppVariablesResponse struct { diff --git a/internal/deployserverclient/models/operations/readappversions.go b/internal/deployserverclient/models/operations/readappversions.go deleted file mode 100644 index 5a47d8d1..00000000 --- a/internal/deployserverclient/models/operations/readappversions.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 3be017d24d90 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadAppVersionsRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - PageNumber *int64 `queryParam:"style=form,explode=true,name=pageNumber"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` -} - -func (r *ReadAppVersionsRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -func (r *ReadAppVersionsRequest) GetPageNumber() *int64 { - if r == nil { - return nil - } - return r.PageNumber -} - -func (r *ReadAppVersionsRequest) GetPageSize() *int64 { - if r == nil { - return nil - } - return r.PageSize -} - -type ReadAppVersionsResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // App versions retrieved successfully - ListVersionsResponse *components.ListVersionsResponse - // Error - Error *components.Error -} - -func (r *ReadAppVersionsResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadAppVersionsResponse) GetListVersionsResponse() *components.ListVersionsResponse { - if r == nil { - return nil - } - return r.ListVersionsResponse -} - -func (r *ReadAppVersionsResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readcurrentappversion.go b/internal/deployserverclient/models/operations/readcurrentappversion.go deleted file mode 100644 index 5d01da8e..00000000 --- a/internal/deployserverclient/models/operations/readcurrentappversion.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 2236f4e2f610 - -package operations - -import ( - "encoding/json" - "fmt" - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" - "io" -) - -type From string - -const ( - FromState From = "state" -) - -func (e From) ToPointer() *From { - return &e -} -func (e *From) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "state": - *e = From(v) - return nil - default: - return fmt.Errorf("invalid value for From: %v", v) - } -} - -type ReadCurrentAppVersionRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` - From *From `queryParam:"style=form,explode=true,name=from"` -} - -func (r *ReadCurrentAppVersionRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -func (r *ReadCurrentAppVersionRequest) GetFrom() *From { - if r == nil { - return nil - } - return r.From -} - -type ReadCurrentAppVersionResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Current app version retrieved successfully - AppVersionResponse *components.AppVersionResponse - // Current app version retrieved successfully - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - TwoHundredApplicationGzipResponseStream io.ReadCloser - // Current app version retrieved successfully - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - TwoHundredApplicationYamlResponseStream io.ReadCloser - // Error - Error *components.Error -} - -func (r *ReadCurrentAppVersionResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadCurrentAppVersionResponse) GetAppVersionResponse() *components.AppVersionResponse { - if r == nil { - return nil - } - return r.AppVersionResponse -} - -func (r *ReadCurrentAppVersionResponse) GetTwoHundredApplicationGzipResponseStream() io.ReadCloser { - if r == nil { - return nil - } - return r.TwoHundredApplicationGzipResponseStream -} - -func (r *ReadCurrentAppVersionResponse) GetTwoHundredApplicationYamlResponseStream() io.ReadCloser { - if r == nil { - return nil - } - return r.TwoHundredApplicationYamlResponseStream -} - -func (r *ReadCurrentAppVersionResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readcurrentrun.go b/internal/deployserverclient/models/operations/readcurrentrun.go deleted file mode 100644 index ab1d0c30..00000000 --- a/internal/deployserverclient/models/operations/readcurrentrun.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 617b396abefc - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadCurrentRunRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (r *ReadCurrentRunRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -type ReadCurrentRunResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Current run retrieved successfully - RunResponse *components.RunResponse - // Error - Error *components.Error -} - -func (r *ReadCurrentRunResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadCurrentRunResponse) GetRunResponse() *components.RunResponse { - if r == nil { - return nil - } - return r.RunResponse -} - -func (r *ReadCurrentRunResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readdeployment.go b/internal/deployserverclient/models/operations/readdeployment.go new file mode 100644 index 00000000..43788beb --- /dev/null +++ b/internal/deployserverclient/models/operations/readdeployment.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: ae784249b40f + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "io" +) + +type ReadDeploymentInclude string + +const ( + ReadDeploymentIncludeState ReadDeploymentInclude = "state" +) + +func (e ReadDeploymentInclude) ToPointer() *ReadDeploymentInclude { + return &e +} +func (e *ReadDeploymentInclude) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "state": + *e = ReadDeploymentInclude(v) + return nil + default: + return fmt.Errorf("invalid value for ReadDeploymentInclude: %v", v) + } +} + +type ReadDeploymentRequest struct { + DeploymentID string `pathParam:"style=simple,explode=false,name=deploymentId"` + // Comma-separated list of related resources to include. + // - `state`: Include the live stack state reported by Formance Cloud + // for this deployment's bound stack. Note: this is the **live** + // projection from Membership, not a frozen per-deployment snapshot. + // + Include []ReadDeploymentInclude `queryParam:"style=form,explode=true,name=include"` +} + +func (r *ReadDeploymentRequest) GetDeploymentID() string { + if r == nil { + return "" + } + return r.DeploymentID +} + +func (r *ReadDeploymentRequest) GetInclude() []ReadDeploymentInclude { + if r == nil { + return nil + } + return r.Include +} + +type ReadDeploymentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Deployment retrieved successfully + DeploymentResponse *components.DeploymentResponse + // Deployment retrieved successfully + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser + // Error + Error *components.Error +} + +func (r *ReadDeploymentResponse) GetHTTPMeta() components.HTTPMetadata { + if r == nil { + return components.HTTPMetadata{} + } + return r.HTTPMeta +} + +func (r *ReadDeploymentResponse) GetDeploymentResponse() *components.DeploymentResponse { + if r == nil { + return nil + } + return r.DeploymentResponse +} + +func (r *ReadDeploymentResponse) GetResponseStream() io.ReadCloser { + if r == nil { + return nil + } + return r.ResponseStream +} + +func (r *ReadDeploymentResponse) GetError() *components.Error { + if r == nil { + return nil + } + return r.Error +} diff --git a/internal/deployserverclient/models/operations/readcurrentrunlogs.go b/internal/deployserverclient/models/operations/readdeploymentlogs.go similarity index 52% rename from internal/deployserverclient/models/operations/readcurrentrunlogs.go rename to internal/deployserverclient/models/operations/readdeploymentlogs.go index 7c9fda3f..0ac0a717 100644 --- a/internal/deployserverclient/models/operations/readcurrentrunlogs.go +++ b/internal/deployserverclient/models/operations/readdeploymentlogs.go @@ -1,5 +1,5 @@ // Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: bde8c9da719b +// @generated-id: b72515ab4199 package operations @@ -7,40 +7,40 @@ import ( "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" ) -type ReadCurrentRunLogsRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` +type ReadDeploymentLogsRequest struct { + DeploymentID string `pathParam:"style=simple,explode=false,name=deploymentId"` } -func (r *ReadCurrentRunLogsRequest) GetID() string { +func (r *ReadDeploymentLogsRequest) GetDeploymentID() string { if r == nil { return "" } - return r.ID + return r.DeploymentID } -type ReadCurrentRunLogsResponse struct { +type ReadDeploymentLogsResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` - // Current run logs retrieved successfully + // Deployment logs retrieved successfully ReadLogsResponse *components.ReadLogsResponse // Error Error *components.Error } -func (r *ReadCurrentRunLogsResponse) GetHTTPMeta() components.HTTPMetadata { +func (r *ReadDeploymentLogsResponse) GetHTTPMeta() components.HTTPMetadata { if r == nil { return components.HTTPMetadata{} } return r.HTTPMeta } -func (r *ReadCurrentRunLogsResponse) GetReadLogsResponse() *components.ReadLogsResponse { +func (r *ReadDeploymentLogsResponse) GetReadLogsResponse() *components.ReadLogsResponse { if r == nil { return nil } return r.ReadLogsResponse } -func (r *ReadCurrentRunLogsResponse) GetError() *components.Error { +func (r *ReadDeploymentLogsResponse) GetError() *components.Error { if r == nil { return nil } diff --git a/internal/deployserverclient/models/operations/readmanifest.go b/internal/deployserverclient/models/operations/readmanifest.go new file mode 100644 index 00000000..da0a84d4 --- /dev/null +++ b/internal/deployserverclient/models/operations/readmanifest.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 1c4b97e4c0d5 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type ReadManifestRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + // Comma-separated includes (e.g. "latest" to embed latest version content) + Include *string `queryParam:"style=form,explode=true,name=include"` +} + +func (r *ReadManifestRequest) GetManifestID() string { + if r == nil { + return "" + } + return r.ManifestID +} + +func (r *ReadManifestRequest) GetInclude() *string { + if r == nil { + return nil + } + return r.Include +} + +type ReadManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest retrieved successfully + ManifestResponse *components.ManifestResponse + // Error + Error *components.Error +} + +func (r *ReadManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if r == nil { + return components.HTTPMetadata{} + } + return r.HTTPMeta +} + +func (r *ReadManifestResponse) GetManifestResponse() *components.ManifestResponse { + if r == nil { + return nil + } + return r.ManifestResponse +} + +func (r *ReadManifestResponse) GetError() *components.Error { + if r == nil { + return nil + } + return r.Error +} diff --git a/internal/deployserverclient/models/operations/readmanifestversion.go b/internal/deployserverclient/models/operations/readmanifestversion.go new file mode 100644 index 00000000..586511fc --- /dev/null +++ b/internal/deployserverclient/models/operations/readmanifestversion.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 998f6b496360 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" + "io" +) + +type ReadManifestVersionRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + // Version number or "latest" + Version string `pathParam:"style=simple,explode=false,name=version"` +} + +func (r *ReadManifestVersionRequest) GetManifestID() string { + if r == nil { + return "" + } + return r.ManifestID +} + +func (r *ReadManifestVersionRequest) GetVersion() string { + if r == nil { + return "" + } + return r.Version +} + +type ReadManifestVersionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest version retrieved successfully + ManifestVersionResponse *components.ManifestVersionResponse + // Manifest version retrieved successfully + // The Close method must be called on this field, even if it is not used, to prevent resource leaks. + ResponseStream io.ReadCloser + // Error + Error *components.Error +} + +func (r *ReadManifestVersionResponse) GetHTTPMeta() components.HTTPMetadata { + if r == nil { + return components.HTTPMetadata{} + } + return r.HTTPMeta +} + +func (r *ReadManifestVersionResponse) GetManifestVersionResponse() *components.ManifestVersionResponse { + if r == nil { + return nil + } + return r.ManifestVersionResponse +} + +func (r *ReadManifestVersionResponse) GetResponseStream() io.ReadCloser { + if r == nil { + return nil + } + return r.ResponseStream +} + +func (r *ReadManifestVersionResponse) GetError() *components.Error { + if r == nil { + return nil + } + return r.Error +} diff --git a/internal/deployserverclient/models/operations/readrun.go b/internal/deployserverclient/models/operations/readrun.go deleted file mode 100644 index 2970dc1e..00000000 --- a/internal/deployserverclient/models/operations/readrun.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 87911583c9dd - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadRunRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (r *ReadRunRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -type ReadRunResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Run retrieved successfully - RunResponse *components.RunResponse - // Error - Error *components.Error -} - -func (r *ReadRunResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadRunResponse) GetRunResponse() *components.RunResponse { - if r == nil { - return nil - } - return r.RunResponse -} - -func (r *ReadRunResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readrunlogs.go b/internal/deployserverclient/models/operations/readrunlogs.go deleted file mode 100644 index 431dd2ca..00000000 --- a/internal/deployserverclient/models/operations/readrunlogs.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: c2d8dff135c8 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" -) - -type ReadRunLogsRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (r *ReadRunLogsRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -type ReadRunLogsResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Run logs retrieved successfully - ReadLogsResponse *components.ReadLogsResponse - // Error - Error *components.Error -} - -func (r *ReadRunLogsResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadRunLogsResponse) GetReadLogsResponse() *components.ReadLogsResponse { - if r == nil { - return nil - } - return r.ReadLogsResponse -} - -func (r *ReadRunLogsResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/readversion.go b/internal/deployserverclient/models/operations/readversion.go deleted file mode 100644 index 9dcc7bc3..00000000 --- a/internal/deployserverclient/models/operations/readversion.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: e87f29195fa2 - -package operations - -import ( - "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" - "io" -) - -type ReadVersionRequest struct { - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (r *ReadVersionRequest) GetID() string { - if r == nil { - return "" - } - return r.ID -} - -type ReadVersionResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // version retrieved successfully - AppVersionResponse *components.AppVersionResponse - // version retrieved successfully - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - TwoHundredApplicationGzipResponseStream io.ReadCloser - // version retrieved successfully - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - TwoHundredApplicationYamlResponseStream io.ReadCloser - // Error - Error *components.Error -} - -func (r *ReadVersionResponse) GetHTTPMeta() components.HTTPMetadata { - if r == nil { - return components.HTTPMetadata{} - } - return r.HTTPMeta -} - -func (r *ReadVersionResponse) GetAppVersionResponse() *components.AppVersionResponse { - if r == nil { - return nil - } - return r.AppVersionResponse -} - -func (r *ReadVersionResponse) GetTwoHundredApplicationGzipResponseStream() io.ReadCloser { - if r == nil { - return nil - } - return r.TwoHundredApplicationGzipResponseStream -} - -func (r *ReadVersionResponse) GetTwoHundredApplicationYamlResponseStream() io.ReadCloser { - if r == nil { - return nil - } - return r.TwoHundredApplicationYamlResponseStream -} - -func (r *ReadVersionResponse) GetError() *components.Error { - if r == nil { - return nil - } - return r.Error -} diff --git a/internal/deployserverclient/models/operations/updatemanifest.go b/internal/deployserverclient/models/operations/updatemanifest.go new file mode 100644 index 00000000..3b64059f --- /dev/null +++ b/internal/deployserverclient/models/operations/updatemanifest.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 5a5e3776c473 + +package operations + +import ( + "github.com/formancehq/fctl/internal/deployserverclient/v3/models/components" +) + +type UpdateManifestRequest struct { + ManifestID string `pathParam:"style=simple,explode=false,name=manifestId"` + UpdateManifestRequest components.UpdateManifestRequest `request:"mediaType=application/json"` +} + +func (u *UpdateManifestRequest) GetManifestID() string { + if u == nil { + return "" + } + return u.ManifestID +} + +func (u *UpdateManifestRequest) GetUpdateManifestRequest() components.UpdateManifestRequest { + if u == nil { + return components.UpdateManifestRequest{} + } + return u.UpdateManifestRequest +} + +type UpdateManifestResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Manifest updated successfully + ManifestResponse *components.ManifestResponse + // Error + Error *components.Error +} + +func (u *UpdateManifestResponse) GetHTTPMeta() components.HTTPMetadata { + if u == nil { + return components.HTTPMetadata{} + } + return u.HTTPMeta +} + +func (u *UpdateManifestResponse) GetManifestResponse() *components.ManifestResponse { + if u == nil { + return nil + } + return u.ManifestResponse +} + +func (u *UpdateManifestResponse) GetError() *components.Error { + if u == nil { + return nil + } + return u.Error +} diff --git a/openapi/deployserver.yaml b/openapi/deployserver.yaml index 6bcb0d43..6ea50aaa 100644 --- a/openapi/deployserver.yaml +++ b/openapi/deployserver.yaml @@ -1,34 +1,25 @@ openapi: 3.1.0 info: - title: Terraform HCP Proxy API + title: Formance Apps API contact: {} version: 0.1.0 servers: -- url: https://deploy.formance.cloud - description: Production server -- url: https://deploy-server.staging.formance.cloud - description: Staging server -- url: http://localhost:8080 - description: Local server + - url: https://deploy.formance.cloud + description: Production server + - url: https://deploy-server.staging.formance.cloud + description: Staging server + - url: http://localhost:8080 + description: Local server +security: + - bearerAuth: [] paths: /apps: get: summary: List organization apps operationId: listApps parameters: - - name: organizationId - in: query - required: true - schema: - type: string - - name: pageNumber - in: query - schema: - type: integer - - name: pageSize - in: query - schema: - type: integer + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Cursor' responses: '200': description: Apps retrieved successfully @@ -69,11 +60,11 @@ paths: summary: Update an app operationId: updateApp parameters: - - name: id - in: path - required: true - schema: - type: string + - name: id + in: path + required: true + schema: + type: string requestBody: required: true content: @@ -93,11 +84,25 @@ paths: summary: read app details operationId: readApp parameters: - - name: id - in: path - required: true - schema: - type: string + - name: id + in: path + required: true + schema: + type: string + - name: include + in: query + required: false + description: | + Comma-separated list of related resources to include. + - `state`: Include the live stack state reported by Formance Cloud + (a projection of the bound stack from Membership, not a snapshot + persisted by the proxy). + schema: + type: array + items: + type: string + enum: + - state responses: '200': description: App details retrieved successfully @@ -113,39 +118,106 @@ paths: $ref: '#/components/schemas/Error' delete: summary: Delete an app + description: | + Soft-deletes the app immediately and enqueues a destroy deployment to + clean up the app's resources on Formance Cloud via the openapi + reconciler's tear-down path. The app becomes invisible to all + subsequent reads. The destroy runs through the normal worker + pipeline; once it reaches a successful terminal status the worker + hard-deletes the app row. + + By default this returns 202 Accepted as soon as the destroy is + enqueued (or 202 with no body if no destroy was needed). Pass + `?wait=true` to block until the destroy reaches a terminal status. operationId: deleteApp parameters: - - name: id - in: path - required: true - schema: - type: string + - name: id + in: path + required: true + schema: + type: string + - name: wait + in: query + required: false + description: | + When `true`, the call blocks until the destroy deployment reaches a + terminal status. Default `false` (returns 202 Accepted). + schema: + type: boolean + default: false responses: + '202': + description: | + Soft-delete accepted. Cleanup runs asynchronously. The + `Location` header points at the destroy deployment if one was + enqueued. + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppResponse' '204': - description: App details retrieved successfully + description: | + Returned when `wait=true` and the destroy reached a terminal + status successfully (or when no destroy was needed at all). default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/current-state-version: - get: - summary: Get the current state version of an app - operationId: readAppCurrentStateVersion + /apps/{id}/manifest: + put: + summary: Bind an app to a manifest + operationId: attachAppManifest + description: | + Updates the app's `manifest_id` pointer. Idempotent — re-binding to the + same id is a no-op; rebinding to a different id moves the pointer. parameters: - - name: id - in: path + - name: id + in: path + required: true + schema: + type: string + requestBody: required: true - schema: - type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AttachManifestRequest' responses: - '200': - description: Current state version retrieved successfully + '204': + description: App bound to manifest + '400': + description: manifestId missing or empty content: application/json: schema: - $ref: '#/components/schemas/ReadStateResponse' + $ref: '#/components/schemas/Error' + '404': + description: Manifest not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + summary: Unbind an app from its manifest + operationId: detachAppManifest + description: Clears the app's `manifest_id` pointer. Idempotent. + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + '204': + description: App unbound from manifest default: description: Error content: @@ -157,19 +229,13 @@ paths: summary: Get all variables of an app operationId: readAppVariables parameters: - - name: id - in: path - required: true - schema: - type: string - - name: pageNumber - in: query - schema: - type: integer - - name: pageSize - in: query - schema: - type: integer + - name: id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Cursor' responses: '200': description: App variables retrieved successfully @@ -187,11 +253,11 @@ paths: summary: Create variable for an app operationId: createAppVariable parameters: - - name: id - in: path - required: true - schema: - type: string + - name: id + in: path + required: true + schema: + type: string requestBody: required: true content: @@ -216,16 +282,16 @@ paths: summary: Delete a variable from an app operationId: deleteAppVariable parameters: - - name: id - in: path - required: true - schema: - type: string - - name: variableId - in: path - required: true - schema: - type: string + - name: id + in: path + required: true + schema: + type: string + - name: variableId + in: path + required: true + schema: + type: string responses: '204': description: Variable deleted successfully @@ -235,78 +301,152 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/runs: - get: - summary: Get runs of an app - operationId: readAppRuns + /manifests: + post: + summary: Create a new manifest + operationId: createManifest parameters: - - name: id - in: path + - name: name + in: query + required: true + schema: + type: string + description: Name for the manifest + requestBody: required: true - schema: - type: string - - name: pageNumber - in: query - schema: - type: integer - - name: pageSize - in: query - schema: - type: integer + content: + application/yaml: + schema: + type: string + format: binary + description: YAML manifest content + application/json: + schema: + type: object + description: JSON manifest content + responses: + '201': + description: Manifest created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/CreateManifestResponse' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + summary: List manifests in the organization + operationId: listManifests + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Cursor' responses: '200': - description: App runs retrieved successfully + description: Manifests retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ListRunsResponse' + $ref: '#/components/schemas/ListManifestsResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/versions: + /manifests/{manifestId}: get: - summary: Get versions of an app - operationId: readAppVersions + summary: Read a manifest + operationId: readManifest parameters: - - name: id - in: path + - name: manifestId + in: path + required: true + schema: + type: string + - name: include + in: query + required: false + schema: + type: string + description: Comma-separated includes (e.g. "latest" to embed latest version content) + responses: + '200': + description: Manifest retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ManifestResponse' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + summary: Update manifest metadata + operationId: updateManifest + parameters: + - name: manifestId + in: path + required: true + schema: + type: string + requestBody: required: true - schema: - type: string - - name: pageNumber - in: query - schema: - type: integer - - name: pageSize - in: query - schema: - type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateManifestRequest' responses: '200': - description: App versions retrieved successfully + description: Manifest updated successfully content: application/json: schema: - $ref: '#/components/schemas/ListVersionsResponse' + $ref: '#/components/schemas/ManifestResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/deploy: + delete: + summary: Delete a manifest and all its versions + operationId: deleteManifest + parameters: + - name: manifestId + in: path + required: true + schema: + type: string + responses: + '204': + description: Manifest deleted successfully + '409': + description: Manifest is still referenced by deployments + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /manifests/{manifestId}/versions: post: - summary: Deploy a new configuration for an app - operationId: deployAppConfiguration + summary: Push a new version of a manifest + operationId: pushManifestVersion parameters: - - name: id - in: path - required: true - schema: - type: string + - name: manifestId + in: path + required: true + schema: + type: string requestBody: required: true content: @@ -317,207 +457,208 @@ paths: description: YAML manifest content application/json: schema: - $ref: '#/components/schemas/application' + type: object + description: JSON manifest content responses: - '202': - description: App configuration deployed successfully + '201': + description: Manifest version created successfully content: application/json: schema: - $ref: '#/components/schemas/RunResponse' + $ref: '#/components/schemas/ManifestVersionResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/run: get: - summary: Get the current run of an app - operationId: readCurrentRun + summary: List versions of a manifest + operationId: listManifestVersions parameters: - - name: id - in: path - required: true - schema: - type: string + - name: manifestId + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Cursor' responses: '200': - description: Current run retrieved successfully + description: Manifest versions retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/RunResponse' + $ref: '#/components/schemas/ListManifestVersionsResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /versions/{id}: + /manifests/{manifestId}/versions/{version}: get: - summary: Get a specific version - operationId: readVersion + summary: Get a specific manifest version with content + operationId: readManifestVersion parameters: - - name: id - in: path - required: true - schema: - type: string - - name: accept - in: header - required: false - description: | - The desired response format. - - `application/json`: Returns the version metadata in JSON format. - - `application/gzip`: Returns the version as a gzip archive. - - `application/yaml`: Returns the original manifest content. - schema: - type: string - enum: - - application/json - - application/gzip - - application/yaml + - name: manifestId + in: path + required: true + schema: + type: string + - name: version + in: path + required: true + description: Version number or "latest" + schema: + type: string + - name: accept + in: header + required: false + description: | + The desired response format. + - `application/json`: Returns the version metadata and content in JSON format. + - `application/x-yaml`: Returns the raw manifest content as YAML. + schema: + type: string + enum: + - application/json + - application/x-yaml responses: '200': - description: version retrieved successfully + description: Manifest version retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/AppVersionResponse' - application/gzip: - schema: - type: string - format: binary - description: Archive - application/yaml: + $ref: '#/components/schemas/ManifestVersionResponse' + application/x-yaml: schema: type: string format: binary - description: Original manifest content + description: Raw manifest YAML content default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /runs/{id}: - get: - summary: Get the run of a version - operationId: readRun - parameters: - - name: id - in: path + /deployments: + post: + summary: Create a deployment (triggers a run) + operationId: createDeployment + requestBody: required: true - schema: - type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDeploymentRequest' responses: - '200': - description: Run retrieved successfully + '201': + description: Deployment created successfully content: application/json: schema: - $ref: '#/components/schemas/RunResponse' + $ref: '#/components/schemas/DeploymentResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /runs/{id}/logs: get: - summary: Get logs of a run by its ID - operationId: readRunLogs + summary: List deployments + operationId: listDeployments parameters: - - name: id - in: path - required: true - schema: - type: string + - name: appId + in: query + schema: + type: string + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Cursor' responses: '200': - description: Run logs retrieved successfully + description: Deployments retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ReadLogsResponse' + $ref: '#/components/schemas/ListDeploymentsResponse' default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/run/logs: + /deployments/{deploymentId}: get: - summary: Get logs of the current run of an app - operationId: readCurrentRunLogs + summary: Get a single deployment + operationId: readDeployment parameters: - - name: id - in: path - required: true - schema: - type: string + - name: deploymentId + in: path + required: true + schema: + type: string + - name: accept + in: header + required: false + description: | + The desired response format. + - `application/json`: Returns the deployment metadata in JSON format. + - `application/yaml`: Returns the original application manifest content. + schema: + type: string + enum: + - application/json + - application/yaml + - name: include + in: query + required: false + description: | + Comma-separated list of related resources to include. + - `state`: Include the live stack state reported by Formance Cloud + for this deployment's bound stack. Note: this is the **live** + projection from Membership, not a frozen per-deployment snapshot. + schema: + type: array + items: + type: string + enum: + - state responses: '200': - description: Current run logs retrieved successfully + description: Deployment retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/ReadLogsResponse' + $ref: '#/components/schemas/DeploymentResponse' + application/yaml: + schema: + type: string + format: binary + description: Original application manifest content default: description: Error content: application/json: schema: $ref: '#/components/schemas/Error' - /apps/{id}/version: + /deployments/{deploymentId}/logs: get: - summary: Get the current version of an app - operationId: readCurrentAppVersion + summary: Get run logs for a deployment + operationId: readDeploymentLogs parameters: - - name: id - in: path - required: true - schema: - type: string - - name: accept - in: header - required: false - description: | - The desired response format. - - `application/json`: Returns the version metadata in JSON format. - - `application/gzip`: Returns the version as a gzip archive. - - `application/yaml`: Returns the original manifest content. - schema: - type: string - enum: - - application/json - - application/gzip - - application/yaml - - name: from - in: query - required: false - schema: - type: string - enum: - - state + - name: deploymentId + in: path + required: true + schema: + type: string responses: '200': - description: Current app version retrieved successfully + description: Deployment logs retrieved successfully content: application/json: schema: - $ref: '#/components/schemas/AppVersionResponse' - application/gzip: - schema: - type: string - format: binary - description: Archive - application/yaml: - schema: - type: string - format: binary - description: Original manifest content + $ref: '#/components/schemas/ReadLogsResponse' default: description: Error content: @@ -525,27 +666,66 @@ paths: schema: $ref: '#/components/schemas/Error' components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: | + Formance Cloud bearer token (JWT) issued by Membership. The proxy + validates the token and enforces scopes per operation; see the + per-operation `security` declarations (when present) for required + scopes. + parameters: + PageSize: + name: pageSize + in: query + required: false + description: | + Maximum number of items to return on the first page. Capped at 100; + ignored when `cursor` is supplied (subsequent pages reuse the page + size baked into the cursor token). Defaults to 100. + schema: + type: integer + minimum: 1 + maximum: 100 + Cursor: + name: cursor + in: query + required: false + description: | + Opaque pagination token returned in `cursor.next` / `cursor.previous` + on the previous page. Pass it back unchanged to fetch the adjacent + page. Mutually exclusive with `pageSize` after the first request. + schema: + type: string schemas: - ReadStateResponse: - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/State' State: type: object required: - - stack + - stack properties: stack: type: object - description: The stack details from the Terraform state + description: | + The live stack details reported by Formance Cloud (a projection of + the bound stack from Membership). Shape is a free-form object + mirroring the upstream stack resource. additionalProperties: true + DeleteAppResponse: + type: object + properties: + destroyDeploymentId: + type: string + description: | + ID of the destroy deployment enqueued to clean up the app's + resources. Empty when no destroy was needed (e.g. no prior + applied deployment). Use `GET /deployments/{id}` to poll its + status. ReadManifestResponse: type: object required: - - data + - data properties: data: type: string @@ -561,9 +741,9 @@ components: Log: type: object required: - - message - - timestamp - - module + - message + - timestamp + - module properties: message: type: string @@ -579,9 +759,9 @@ components: type: object description: Detailed log message required: - - severity - - detail - - summary + - severity + - detail + - summary properties: severity: type: string @@ -591,99 +771,57 @@ components: summary: type: string description: Brief summary of the log message - PaginationResponse: - type: object - properties: - currentPage: - type: integer - description: Current page number - previousPage: - type: integer - description: Previous page number - nextPage: - type: integer - description: Next page number - totalPages: - type: integer - description: Total number of pages - totalCount: - type: integer - description: Total number of items - CreateAppRequest: + Cursor: type: object + description: | + Cursor pagination envelope. `next` and `previous` are opaque tokens + produced by the server; pass them back as `?cursor=` to fetch the + adjacent page. `hasMore` is `true` when more results exist after the + current page. `pageSize` echoes the page size used for this page. required: - - organizationId + - hasMore + - data properties: - organizationId: + pageSize: + type: integer + description: Number of items requested for this page + hasMore: + type: boolean + description: True when more results exist after this page + previous: type: string - description: ID of the organization to which the app belongs + description: Opaque cursor token for the previous page (empty when none) + next: + type: string + description: Opaque cursor token for the next page (empty when none) ListAppsResponse: type: object required: - - data + - cursor properties: - data: + cursor: allOf: - - $ref: '#/components/schemas/PaginationResponse' - - type: object - required: - - items - properties: - items: - type: array - items: - $ref: '#/components/schemas/App' + - $ref: '#/components/schemas/Cursor' + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/App' AppResponse: type: object required: - - data + - data properties: data: $ref: '#/components/schemas/App' - ListRunsResponse: - type: object - required: - - data - properties: - data: - allOf: - - $ref: '#/components/schemas/PaginationResponse' - - type: object - required: - - items - properties: - items: - type: array - items: - $ref: '#/components/schemas/Run' - ListVersionsResponse: - type: object - required: - - data - properties: - data: - allOf: - - $ref: '#/components/schemas/PaginationResponse' - - type: object - required: - - items - properties: - items: - type: array - items: - $ref: '#/components/schemas/ConfigurationVersion' - AppVersionResponse: - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/ConfigurationVersion' App: type: object required: - - id - - name + - id + - name properties: id: type: string @@ -691,548 +829,351 @@ components: name: type: string description: Name of the app - currentConfigurationVersion: - $ref: '#/components/schemas/ConfigurationVersion' - currentRun: - $ref: '#/components/schemas/Run' - RunResponse: - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/Run' - Run: + stackId: + type: string + description: Optional existing stack ID claimed by this app + stackRegionId: + type: string + description: Stack region ID (set when the app's stack lives in a specific region) + state: + $ref: '#/components/schemas/State' + currentManifest: + $ref: '#/components/schemas/AppCurrentManifest' + AppCurrentManifest: type: object + description: | + The manifest the app is currently bound to (apps.manifest_id), with + catalog metadata and divergence vs the most recent applied deployment. + Populated by GET /apps/{id} when a manifest is bound. required: - - id - - status - - autoApply - - createdAt - - isDestroy - - hasChanges - - message - - planOnly - - refresh - - refreshOnly - - savePlan + - id + - name + - latestVersion properties: id: type: string - description: Unique identifier for the run - autoApply: - type: boolean - description: Whether the run was auto-applied - createdAt: + description: ID of the manifest the app is bound to + name: type: string - format: date-time - description: Timestamp when the run was created - isDestroy: - type: boolean - description: Whether the run is a destroy operation - hasChanges: - type: boolean - description: Whether the run has changes - message: + description: Name of the bound manifest + latestVersion: + type: integer + description: Latest version available in the manifest's lineage + divergence: + $ref: '#/components/schemas/AppManifestDivergence' + AppManifestDivergence: + type: object + description: | + Relationship between the app's bound manifest and what's currently + deployed (last `applied` deployment, ignoring destroys). + required: + - kind + - latestVersion + properties: + kind: type: string - description: Message associated with the run - planOnly: - type: boolean - description: Whether the run is a plan-only operation - refresh: - type: boolean - description: Whether the run is a refresh operation - refreshOnly: - type: boolean - description: Whether the run is a refresh-only operation - savePlan: - type: boolean - description: Whether the run saves the plan - status: + enum: + - undeployed + - synced + - behind + - rebound + description: | + - `undeployed`: the app has a manifest bound but no successful deployment yet. + - `synced`: deployed (manifestId, version) matches the bound manifest's latest version. + - `behind`: deployed manifest matches the bound manifest but on an older version. + - `rebound`: the app was rebound; deployed manifest is a different manifest. + deployedManifestId: type: string - description: Status of the run - configurationVersion: - $ref: '#/components/schemas/ConfigurationVersion' - ConfigurationVersion: + description: ID of the manifest reflected in the most recent applied deployment + deployedVersion: + type: integer + description: Version reflected in the most recent applied deployment + latestVersion: + type: integer + description: Latest version available in the bound manifest's lineage + AttachManifestRequest: type: object required: - - id - - status - - autoQueueRuns - - error - - errorMessage + - manifestId properties: - id: - type: string - description: Unique identifier for the configuration version - autoQueueRuns: - type: boolean - description: Auto queue runs when a new version is uploaded - error: + manifestId: type: string - description: Error code if the version is in an error state - errorMessage: + description: ID of the manifest to bind to the app + CreateAppRequest: + type: object + required: + - name + properties: + name: type: string - description: Error message if the version is in an error state - status: + description: Name of the app + stackId: type: string - enum: - - archived - - errored - - pending - - fetching - - uploaded - - '' + description: Optional existing stack ID to claim UpdateAppRequest: type: object + required: + - name + properties: + name: + type: string + description: Updated name for the app ReadVariablesResponse: type: object required: - - data + - cursor properties: - data: + cursor: allOf: - - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Variable' - - $ref: '#/components/schemas/PaginationResponse' + - $ref: '#/components/schemas/Cursor' + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Variable' CreateVariableRequest: type: object required: - - variable + - variable properties: variable: $ref: '#/components/schemas/VariableData' CreateVariableResponse: type: object required: - - data + - data properties: data: $ref: '#/components/schemas/Variable' VariableData: type: object required: - - key - - value - - sensitive + - key + - value properties: key: type: string - description: Key of the variable + description: | + Snake-case identifier (case-insensitive at the API boundary, + normalized to lowercase on storage to match `var.` in the + generated HCL). Either `MONEYCORP_API_KEY` or + `moneycorp_api_key` is accepted. value: type: string - description: Value of the variable + description: | + Value of the variable. Always treated as sensitive: `value` is + redacted (`REDACTED`) on every read endpoint. description: type: string description: Description of the variable - sensitive: - type: boolean - description: Whether the variable is sensitive Variable: allOf: - - $ref: '#/components/schemas/VariableData' - - type: object - required: - - id - properties: - id: - type: string - description: Unique identifier for the variable - Error: + - $ref: '#/components/schemas/VariableData' + - type: object + required: + - id + properties: + id: + type: string + description: Unique identifier for the variable + Manifest: type: object + required: + - id + - name + - latestVersion + - createdAt + - updatedAt properties: - errorCode: + id: type: string - errorMessage: + description: Unique identifier for the manifest + name: + type: string + description: Name of the manifest + latestVersion: + type: integer + description: Latest version number + createdAt: type: string + format: date-time + description: Timestamp when the manifest was created + updatedAt: + type: string + format: date-time + description: Timestamp when the manifest was last updated + ManifestVersion: + type: object required: - - errorCode - V2ChartAccountMetadata: + - manifestId + - version + - createdAt properties: - default: - type: - - 'null' - - string - type: object - V2ChartAccountRules: - type: object - DotSelf: + manifestId: + type: string + description: ID of the manifest this version belongs to + version: + type: integer + description: Version number + content: + type: string + format: byte + description: Manifest content (base64-encoded). Null when listing versions, present when reading a specific version. + createdAt: + type: string + format: date-time + description: Timestamp when the version was created + CreateManifestResponse: type: object - V2ChartSegment: - additionalProperties: true + required: + - data properties: - .metadata: - additionalProperties: - $ref: '#/components/schemas/V2ChartAccountMetadata' + data: type: object - .pattern: - type: - - 'null' - - string - .rules: - $ref: '#/components/schemas/V2ChartAccountRules' - .self: - $ref: '#/components/schemas/DotSelf' - type: object - V2TransactionTemplate: - properties: - description: - type: - - 'null' - - string - runtime: - type: - - 'null' - - string - script: - type: - - 'null' - - string + required: + - id + - version + - name + - createdAt + properties: + id: + type: string + version: + type: integer + name: + type: string + createdAt: + type: string + format: date-time + ManifestResponse: type: object - V2SchemaData: + required: + - data properties: - chart: - additionalProperties: - $ref: '#/components/schemas/V2ChartSegment' - type: - - object - - 'null' - transactions: - additionalProperties: - $ref: '#/components/schemas/V2TransactionTemplate' - type: object + data: + $ref: '#/components/schemas/Manifest' + ManifestVersionResponse: type: object - Ledger: required: - - name + - data properties: - name: - type: string - schema: - additionalProperties: - $ref: '#/components/schemas/V2SchemaData' - type: - - object - - 'null' + data: + $ref: '#/components/schemas/ManifestVersion' + ListManifestsResponse: type: object - Pool: + required: + - cursor properties: - accountIds: - items: - type: string - type: array - query: - additionalProperties: {} - type: object + cursor: + allOf: + - $ref: '#/components/schemas/Cursor' + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Manifest' + ListManifestVersionsResponse: type: object - ReconciliationLedger: required: - - name - - query + - cursor properties: - name: - type: string - query: - additionalProperties: {} - type: - - object - - 'null' + cursor: + allOf: + - $ref: '#/components/schemas/Cursor' + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/ManifestVersion' + DeploymentResource: type: object - ReconciliationPolicy: required: - - name - - ledger - - pool + - id + - appId + - status + - createdAt + - updatedAt properties: - ledger: - $ref: '#/components/schemas/ReconciliationLedger' - name: + id: type: string - pool: + appId: type: string - type: object - RegionSelector: - properties: - id: + manifestId: type: string - name: + manifestVersion: + type: integer + status: + type: string + createdAt: + type: string + format: date-time + updatedAt: type: string + format: date-time + state: + $ref: '#/components/schemas/State' + CreateDeploymentRequest: type: object - Webhook: required: - - name - - endpoint + - appId + - manifestId + - manifestVersion properties: - endpoint: - type: string - events: - items: - type: string - type: array - name: + appId: type: string - secret: + description: ID of the app to deploy to + manifestId: type: string + description: Manifest catalog ID + manifestVersion: + type: integer + description: Manifest version + DeploymentResponse: type: object - Ledgers: - items: - $ref: '#/components/schemas/Ledger' - type: - - 'null' - - array - Payments: + required: + - data properties: - connectors: - items: - required: - - name - - provider - properties: - configuration: - additionalProperties: {} - type: object - credentials: - additionalProperties: - type: string - type: object - name: - type: string - provider: - type: string - type: object - type: array - pools: - additionalProperties: - $ref: '#/components/schemas/Pool' - type: object + data: + $ref: '#/components/schemas/DeploymentResource' + ListDeploymentsResponse: type: object - Reconciliation: + required: + - cursor properties: - policies: - items: - $ref: '#/components/schemas/ReconciliationPolicy' - type: array + cursor: + allOf: + - $ref: '#/components/schemas/Cursor' + - type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/DeploymentResource' + UpdateManifestRequest: type: object - Stack: required: - - name - - region + - name properties: name: type: string - region: - $ref: '#/components/schemas/RegionSelector' - version: - type: string + description: Updated name for the manifest + Error: type: object - Webhooks: - items: - $ref: '#/components/schemas/Webhook' - type: - - 'null' - - array - application: - $schema: http://json-schema.org/draft-04/schema - required: - - stack - definitions: - DotSelf: - type: object - Ledger: - required: - - name - properties: - name: - type: string - schema: - additionalProperties: - $ref: '#/components/schemas/V2SchemaData' - type: - - object - - 'null' - type: object - Ledgers: - items: - $ref: '#/components/schemas/Ledger' - type: - - 'null' - - array - Payments: - properties: - connectors: - items: - required: - - name - - provider - properties: - configuration: - additionalProperties: {} - type: object - credentials: - additionalProperties: - type: string - type: object - name: - type: string - provider: - type: string - type: object - type: array - pools: - additionalProperties: - $ref: '#/components/schemas/Pool' - type: object - type: object - Pool: - properties: - accountIds: - items: - type: string - type: array - query: - additionalProperties: {} - type: object - type: object - Reconciliation: - properties: - policies: - items: - $ref: '#/components/schemas/ReconciliationPolicy' - type: array - type: object - ReconciliationLedger: - required: - - name - - query - properties: - name: - type: string - query: - additionalProperties: {} - type: - - object - - 'null' - type: object - ReconciliationPolicy: - required: - - name - - ledger - - pool - properties: - ledger: - $ref: '#/components/schemas/ReconciliationLedger' - name: - type: string - pool: - type: string - type: object - RegionSelector: - properties: - id: - type: string - name: - type: string - type: object - Stack: - required: - - name - - region - properties: - name: - type: string - region: - $ref: '#/components/schemas/RegionSelector' - version: - type: string - type: object - V2ChartAccountMetadata: - properties: - default: - type: - - 'null' - - string - type: object - V2ChartAccountRules: - type: object - V2ChartSegment: - additionalProperties: true - properties: - .metadata: - additionalProperties: - $ref: '#/components/schemas/V2ChartAccountMetadata' - type: object - .pattern: - type: - - 'null' - - string - .rules: - $ref: '#/components/schemas/V2ChartAccountRules' - .self: - $ref: '#/components/schemas/DotSelf' - type: object - V2SchemaData: - properties: - chart: - additionalProperties: - $ref: '#/components/schemas/V2ChartSegment' - type: - - object - - 'null' - transactions: - additionalProperties: - $ref: '#/components/schemas/V2TransactionTemplate' - type: object - type: object - V2TransactionTemplate: - properties: - description: - type: - - 'null' - - string - runtime: - type: - - 'null' - - string - script: - type: - - 'null' - - string - type: object - Webhook: - required: - - name - - endpoint - properties: - endpoint: - type: string - events: - items: - type: string - type: array - name: - type: string - secret: - type: string - type: object - Webhooks: - items: - $ref: '#/components/schemas/Webhook' - type: - - 'null' - - array properties: - ledgers: - $ref: '#/components/schemas/Ledgers' - payments: - $ref: '#/components/schemas/Payments' - reconciliation: - $ref: '#/components/schemas/Reconciliation' - stack: - $ref: '#/components/schemas/Stack' - webhooks: - $ref: '#/components/schemas/Webhooks' - type: object + errorCode: + type: string + errorMessage: + type: string + required: + - errorCode diff --git a/openapi/schemas/application.json b/openapi/schemas/application.json new file mode 100644 index 00000000..23f9b078 --- /dev/null +++ b/openapi/schemas/application.json @@ -0,0 +1,350 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "required": [ + "stack" + ], + "definitions": { + "DotSelf": { + "type": "object" + }, + "Ledger": { + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "schema": { + "additionalProperties": { + "$ref": "#/definitions/V2SchemaData" + }, + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "Ledgers": { + "items": { + "$ref": "#/definitions/Ledger" + }, + "type": [ + "null", + "array" + ] + }, + "Payments": { + "properties": { + "connectors": { + "items": { + "required": [ + "name", + "provider" + ], + "properties": { + "configuration": { + "additionalProperties": {}, + "type": "object" + }, + "credentials": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "pools": { + "additionalProperties": { + "$ref": "#/definitions/Pool" + }, + "type": "object" + } + }, + "type": "object" + }, + "Pool": { + "properties": { + "accountIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "additionalProperties": {}, + "type": "object" + } + }, + "type": "object" + }, + "Reconciliation": { + "properties": { + "policies": { + "items": { + "$ref": "#/definitions/ReconciliationPolicy" + }, + "type": "array" + } + }, + "type": "object" + }, + "ReconciliationLedger": { + "required": [ + "name", + "query" + ], + "properties": { + "name": { + "type": "string" + }, + "query": { + "additionalProperties": {}, + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "ReconciliationPolicy": { + "required": [ + "name", + "ledger", + "pool" + ], + "properties": { + "ledger": { + "$ref": "#/definitions/ReconciliationLedger" + }, + "name": { + "type": "string" + }, + "pool": { + "type": "string" + } + }, + "type": "object" + }, + "RegionSelector": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "Stack": { + "required": [ + "name", + "region" + ], + "properties": { + "name": { + "type": "string" + }, + "region": { + "$ref": "#/definitions/RegionSelector" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "V2ChartAccountMetadata": { + "properties": { + "default": { + "type": [ + "null", + "string" + ] + } + }, + "type": "object" + }, + "V2ChartAccountRules": { + "type": "object" + }, + "V2ChartSegment": { + "additionalProperties": true, + "properties": { + ".metadata": { + "additionalProperties": { + "$ref": "#/definitions/V2ChartAccountMetadata" + }, + "type": "object" + }, + ".pattern": { + "type": [ + "null", + "string" + ] + }, + ".rules": { + "$ref": "#/definitions/V2ChartAccountRules" + }, + ".self": { + "$ref": "#/definitions/DotSelf" + } + }, + "type": "object" + }, + "V2QueryTemplate": { + "properties": { + "body": { + "additionalProperties": {}, + "type": "object" + }, + "description": { + "type": [ + "null", + "string" + ] + }, + "params": { + "additionalProperties": {}, + "type": "object" + }, + "resource": { + "type": [ + "null", + "string" + ] + }, + "vars": { + "additionalProperties": { + "$ref": "#/definitions/V2QueryTemplateVar" + }, + "type": "object" + } + }, + "type": "object" + }, + "V2QueryTemplateVar": { + "properties": { + "default": {}, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "V2SchemaData": { + "properties": { + "chart": { + "additionalProperties": { + "$ref": "#/definitions/V2ChartSegment" + }, + "type": [ + "object", + "null" + ] + }, + "queries": { + "additionalProperties": { + "$ref": "#/definitions/V2QueryTemplate" + }, + "type": "object" + }, + "transactions": { + "additionalProperties": { + "$ref": "#/definitions/V2TransactionTemplate" + }, + "type": "object" + } + }, + "type": "object" + }, + "V2TransactionTemplate": { + "properties": { + "description": { + "type": [ + "null", + "string" + ] + }, + "runtime": { + "type": [ + "null", + "string" + ] + }, + "script": { + "type": [ + "null", + "string" + ] + } + }, + "type": "object" + }, + "Webhook": { + "required": [ + "name", + "endpoint" + ], + "properties": { + "endpoint": { + "type": "string" + }, + "events": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + }, + "secret": { + "type": "string" + } + }, + "type": "object" + }, + "Webhooks": { + "items": { + "$ref": "#/definitions/Webhook" + }, + "type": [ + "null", + "array" + ] + } + }, + "properties": { + "ledgers": { + "$ref": "#/definitions/Ledgers" + }, + "payments": { + "$ref": "#/definitions/Payments" + }, + "reconciliation": { + "$ref": "#/definitions/Reconciliation" + }, + "stack": { + "$ref": "#/definitions/Stack" + }, + "webhooks": { + "$ref": "#/definitions/Webhooks" + } + }, + "type": "object" +} \ No newline at end of file diff --git a/pkg/clients.go b/pkg/clients.go index ded49c47..a7f1a798 100644 --- a/pkg/clients.go +++ b/pkg/clients.go @@ -577,6 +577,11 @@ func NewAppDeployClient( organizationID string, ) (*deployserverclient.DeployServer, error) { + appAlias := GetString(cmd, DeployAppAliasFlag) + if appAlias == "" { + appAlias = DefaultDeployAppAlias + } + appToken, err := EnsureAppAccess( cmd, relyingParty, @@ -584,7 +589,7 @@ func NewAppDeployClient( profileName, profile, organizationID, - "deploy", + appAlias, []string{ "apps:Read", "apps:Write", diff --git a/pkg/flags.go b/pkg/flags.go index f476b13c..0df9d65a 100644 --- a/pkg/flags.go +++ b/pkg/flags.go @@ -22,8 +22,11 @@ const ( StackFlag = "stack" OrganizationFlag = "organization" FrameworkURIFlag = "framework-uri" + DeployAppAliasFlag = "deploy-app-alias" ) +const DefaultDeployAppAlias = "deploy" + func GetBool(cmd *cobra.Command, flagName string) bool { v, err := cmd.Flags().GetBool(flagName) if err != nil {