diff --git a/CLAUDE.md b/CLAUDE.md index cef8f99..97f2720 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -83,14 +83,21 @@ the API client and printer. (falls back to listing + case-insensitive name match when the arg doesn't look like a UUID). `login.go` accepts `--api-key` plus optional product URLs. - `cmd/wf.go` — the `eds wf` parent command; just groups `newAppCmd()`, - `newRunCmd()`, `newJobCmd()` as children. Doesn't hold any logic itself. + `newRunCmd()`, `newJobCmd()`, `newSpaceCmd()`, `newDBCmd()`, + `newVariableCmd()` and `newPipelineCmd()` as children. Doesn't hold any + logic itself. - `cmd/app.go`, `cmd/run.go`, `cmd/job.go` — Workflow Studio subcommand trees, nested under `eds wf`. `app.go` holds `eds wf app create|list|show| update|delete|deploy|deployments` (an **application** wires a repo+branch to a deploy pipeline; a **deployment** runs that pipeline and publishes it). `app create --repository` reuses `resolveRepoID` from `repo.go` to accept either a Repo-product UUID or name. `run.go`/`job.go` - are the lower-level primitives behind it. + are the lower-level primitives behind it. `db.go` holds `eds wf db + list|create|show|bind|reset-password|dsn|delete`: managed DBaaS databases + attached to application spaces. "Bind" moves a database to a space + (`--space-id`), and `dsn` returns the connection string containing the + password, so agents must not log it. `space.go`, `variable.go` and + `pipeline.go` are the remaining Workflow Studio subcommand trees. Note (observed empirically, not documented in the spec): `application.status` and `application.run.status` are separate lifecycles. Creating an application auto-triggers its first run; even after `run.status` reaches diff --git a/README.md b/README.md index db6dda3..b476baf 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,14 @@ eds wf space show show an application space eds wf space update --name update an application space eds wf space delete delete an application space +eds wf db list [--space-id S] [--search S] [--sort ...] [--limit N] [--offset N] list databases in a space +eds wf db create [--space-id S] create a managed database (Default space if omitted) +eds wf db show show a database +eds wf db bind --space-id bind (move) a database to another space +eds wf db reset-password reset the database user password +eds wf db dsn get the connection string with its password (secret) +eds wf db delete delete a database, its user and password + eds wf variable list --pipeline-id list variables for a pipeline eds wf variable create --pipeline-id create a variable eds wf variable update --pipeline-id update a variable @@ -180,6 +188,34 @@ eds wf app show "$APP_ID" --json | jq -r '.run.stages[].jobs[] | select(.status= app show` — use them directly when you need to inspect or control a particular run (e.g. `eds wf run stop`) or stream job logs (`eds wf job logs`). +## Managed databases (agent scenario) + +An agent can provision and wire up a managed DBaaS database without the UI: +create it, bind it to the space its application lives in, then read the DSN +and pass it to the application as a variable. + +```bash +export EDS_API_KEY="..." +export EDS_PROJECT_ID="..." + +# 1. Find the space of the service you are wiring the database to. +SPACE_ID=$(eds wf app show "$APP_ID" --json | jq -r '.space_id') + +# 2. Create the database (prints its id). +DB_ID=$(eds wf db create orders --space-id "$SPACE_ID" --json | jq -r '.id') + +# 3. If the database already existed, bind it to that service's space instead: +eds wf db bind "$DB_ID" --space-id "$SPACE_ID" + +# 4. Read the connection string (contains the password — never log it). +DSN=$(eds wf db dsn "$DB_ID" --json | jq -r '.dsn') +``` + +`eds wf db list`, `show`, `reset-password` and `delete` provide the remaining +operations. The same endpoints are available in the public API under +`/public-api/v1/project/{project_id}/application-db` (tag `databases`); each +CLI command maps to one public API method. + ## File upload / push This CLI does **not** implement a custom upload path. To push code, use diff --git a/cmd/db.go b/cmd/db.go new file mode 100644 index 0000000..3a02a4d --- /dev/null +++ b/cmd/db.go @@ -0,0 +1,272 @@ +package cmd + +import ( + "fmt" + + workflowclient "github.com/cloud-ru/evolution-devservices-cli/internal/workflow_client" + "github.com/spf13/cobra" +) + +type ( + dbCreateRequest = workflowclient.GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate + dbBindRequest = workflowclient.GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate +) + +// newDBCmd creates the parent `eds wf db` command. A database belongs to an +// application space: creating, binding (moving) it to a space, and reading its +// DSN are enough for an agent to wire a service to a managed database. +func newDBCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "db", + Short: "Manage Workflow Studio application databases", + Long: `Manage DBaaS databases attached to Workflow Studio application spaces. + +A database lives in an application space (Default if none is given). "Bind" +moves an existing database to another space, so the applications in that space +can use it. The DSN contains the database user password: treat it as a secret.`, + } + cmd.AddCommand(newDBListCmd()) + cmd.AddCommand(newDBCreateCmd()) + cmd.AddCommand(newDBShowCmd()) + cmd.AddCommand(newDBBindCmd()) + cmd.AddCommand(newDBResetPasswordCmd()) + cmd.AddCommand(newDBDSNCmd()) + cmd.AddCommand(newDBDeleteCmd()) + return cmd +} + +func newDBListCmd() *cobra.Command { + var spaceID, search, sort string + var limit, offset int + + cmd := &cobra.Command{ + Use: "list", + Short: "List databases in an application space", + Example: ` eds wf db list + eds wf db list --space-id 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c --search ord --limit 20`, + RunE: func(cmd *cobra.Command, _ []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + req := ctx.WorkflowClient.DatabasesAPI.ListApplicationDatabases(cmd.Context(), ctx.ProjectID) + if cmd.Flags().Changed("space-id") { + req = req.SpaceId(spaceID) + } + if cmd.Flags().Changed("search") { + req = req.Search(search) + } + if cmd.Flags().Changed("sort") { + req = req.Sort(sort) + } + if cmd.Flags().Changed("limit") { + req = req.Limit(limit) + } + if cmd.Flags().Changed("offset") { + req = req.Offset(offset) + } + + resp, _, err := req.Execute() + if err != nil { + return fmt.Errorf("workflow client database list: %w", err) + } + + return ctx.Printer.Print(resp) + }, + } + + cmd.Flags().StringVar(&spaceID, "space-id", "", "space ID (default: Default space)") + cmd.Flags().StringVar(&search, "search", "", "search by database name") + cmd.Flags().StringVar(&sort, "sort", "created_at_desc", "sort order: created_at_asc or created_at_desc") + cmd.Flags().IntVar(&limit, "limit", 10, "page size (0-100)") + cmd.Flags().IntVar(&offset, "offset", 0, "page offset") + return cmd +} + +func newDBCreateCmd() *cobra.Command { + var spaceID string + + cmd := &cobra.Command{ + Use: "create ", + Short: "Create a database in an application space", + Args: cobra.ExactArgs(1), + Example: ` eds wf db create orders --space-id 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + req := dbCreateRequest{Name: args[0]} + if spaceID != "" { + req.SpaceId = &spaceID + } + + resp, _, err := ctx.WorkflowClient.DatabasesAPI.CreateApplicationDatabase(cmd.Context(), ctx.ProjectID). + Request(req). + Execute() + if err != nil { + return fmt.Errorf("workflow client database create: %w", err) + } + + return ctx.Printer.Print(resp) + }, + } + + cmd.Flags().StringVar(&spaceID, "space-id", "", "space ID (default: Default space)") + return cmd +} + +func newDBShowCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "show ", + Short: "Show a database", + Args: cobra.ExactArgs(1), + Example: ` eds wf db show 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + resp, _, err := ctx.WorkflowClient.DatabasesAPI.GetApplicationDatabase(cmd.Context(), ctx.ProjectID, args[0]). + Execute() + if err != nil { + return fmt.Errorf("workflow client database get: %w", err) + } + + return ctx.Printer.Print(resp) + }, + } + + return cmd +} + +func newDBBindCmd() *cobra.Command { + var spaceID string + + cmd := &cobra.Command{ + Use: "bind ", + Short: "Bind a database to an application space (move it there)", + Args: cobra.ExactArgs(1), + Example: ` eds wf db bind 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c --space-id 1d2e3f4a-5b6c-4c5e-9a8f-6f1c2a0e3b7d`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + if spaceID == "" { + return fmt.Errorf("--space-id is required") + } + + resp, _, err := ctx.WorkflowClient.DatabasesAPI.BindApplicationDatabase(cmd.Context(), ctx.ProjectID, args[0]). + Request(dbBindRequest{SpaceId: spaceID}). + Execute() + if err != nil { + return fmt.Errorf("workflow client database bind: %w", err) + } + + return ctx.Printer.Print(resp) + }, + } + + cmd.Flags().StringVar(&spaceID, "space-id", "", "target space ID (required)") + return cmd +} + +func newDBResetPasswordCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "reset-password ", + Short: "Reset the database user password", + Args: cobra.ExactArgs(1), + Example: ` eds wf db reset-password 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + _, err = ctx.WorkflowClient.DatabasesAPI.ResetApplicationDatabasePassword(cmd.Context(), ctx.ProjectID, args[0]). + Execute() + if err != nil { + return fmt.Errorf("workflow client database reset password: %w", err) + } + + return nil + }, + } + + return cmd +} + +func newDBDSNCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "dsn ", + Short: "Get the database connection string with its password (secret)", + Args: cobra.ExactArgs(1), + Example: ` eds wf db dsn 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + resp, _, err := ctx.WorkflowClient.DatabasesAPI.GetApplicationDatabaseDSN(cmd.Context(), ctx.ProjectID, args[0]). + Execute() + if err != nil { + return fmt.Errorf("workflow client database dsn: %w", err) + } + + return ctx.Printer.Print(resp) + }, + } + + return cmd +} + +func newDBDeleteCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "delete ", + Short: "Delete a database, its user and password", + Args: cobra.ExactArgs(1), + Example: ` eds wf db delete 6f1c2a0e-3b7d-4c5e-9a8f-1d2e3f4a5b6c`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := resolveContext(cmd) + if err != nil { + return err + } + if err := ctx.ensureWorkflowAuth(cmd.Context()); err != nil { + return err + } + + _, err = ctx.WorkflowClient.DatabasesAPI.DeleteApplicationDatabase(cmd.Context(), ctx.ProjectID, args[0]). + Execute() + if err != nil { + return fmt.Errorf("workflow client database delete: %w", err) + } + + return nil + }, + } + + return cmd +} diff --git a/cmd/wf.go b/cmd/wf.go index b1cd6fd..c1622ad 100644 --- a/cmd/wf.go +++ b/cmd/wf.go @@ -16,6 +16,7 @@ func newWFCmd() *cobra.Command { cmd.AddCommand(newPipelineCmd()) cmd.AddCommand(newRunCmd()) cmd.AddCommand(newSpaceCmd()) + cmd.AddCommand(newDBCmd()) cmd.AddCommand(newVariableCmd()) cmd.AddCommand(newJobCmd()) return cmd diff --git a/internal/workflow_client/.openapi-generator/FILES b/internal/workflow_client/.openapi-generator/FILES index 7a61a57..4ea2477 100644 --- a/internal/workflow_client/.openapi-generator/FILES +++ b/internal/workflow_client/.openapi-generator/FILES @@ -3,6 +3,7 @@ README.md api/openapi.yaml api_application_space.go +api_databases.go api_pipelines.go api_services.go api_workflows.go @@ -10,6 +11,7 @@ client.go configuration.go git_push.sh model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application_db.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application_space.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_config_storage_type.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_deployment.go @@ -25,6 +27,8 @@ model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_requ model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_space_create.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_space_update.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_update.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_create.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_update.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_job_log_list.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_variable_create.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_variable_update.go @@ -35,6 +39,11 @@ model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_resp model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_space_get.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_space_list.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_space_update.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_create.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get_dsn.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_list.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_update.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_clone.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_create.go model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_list.go diff --git a/internal/workflow_client/README.md b/internal/workflow_client/README.md index 43d5021..cac5fcc 100644 --- a/internal/workflow_client/README.md +++ b/internal/workflow_client/README.md @@ -76,6 +76,13 @@ Class | Method | HTTP request | Description *ApplicationSpaceAPI* | [**GetApplicationSpace**](docs/ApplicationSpaceAPI.md#getapplicationspace) | **Get** /project/{project_id}/space/{space_id} | Get application space *ApplicationSpaceAPI* | [**ListApplicationSpaces**](docs/ApplicationSpaceAPI.md#listapplicationspaces) | **Get** /project/{project_id}/space/list | List application spaces *ApplicationSpaceAPI* | [**UpdateApplicationSpace**](docs/ApplicationSpaceAPI.md#updateapplicationspace) | **Patch** /project/{project_id}/space/{space_id} | Update application space +*DatabasesAPI* | [**BindApplicationDatabase**](docs/DatabasesAPI.md#bindapplicationdatabase) | **Patch** /project/{project_id}/application-db/{db_id} | Bind application database to a space +*DatabasesAPI* | [**CreateApplicationDatabase**](docs/DatabasesAPI.md#createapplicationdatabase) | **Post** /project/{project_id}/application-db | Create application database +*DatabasesAPI* | [**DeleteApplicationDatabase**](docs/DatabasesAPI.md#deleteapplicationdatabase) | **Delete** /project/{project_id}/application-db/{db_id} | Delete application database +*DatabasesAPI* | [**GetApplicationDatabase**](docs/DatabasesAPI.md#getapplicationdatabase) | **Get** /project/{project_id}/application-db/{db_id} | Get application database +*DatabasesAPI* | [**GetApplicationDatabaseDSN**](docs/DatabasesAPI.md#getapplicationdatabasedsn) | **Get** /project/{project_id}/application-db/{db_id}/dsn | Get application database connection string +*DatabasesAPI* | [**ListApplicationDatabases**](docs/DatabasesAPI.md#listapplicationdatabases) | **Get** /project/{project_id}/application-db/list | List application databases +*DatabasesAPI* | [**ResetApplicationDatabasePassword**](docs/DatabasesAPI.md#resetapplicationdatabasepassword) | **Post** /project/{project_id}/application-db/{db_id}/reset | Reset application database password *PipelinesAPI* | [**CreateVariable**](docs/PipelinesAPI.md#createvariable) | **Post** /project/{project_id}/pipeline/{pipeline_id}/variable | Create variable *PipelinesAPI* | [**DeleteVariable**](docs/PipelinesAPI.md#deletevariable) | **Delete** /project/{project_id}/pipeline/{pipeline_id}/variable | Delete variable *PipelinesAPI* | [**GetJob**](docs/PipelinesAPI.md#getjob) | **Get** /project/{project_id}/job/{job_id} | Get job @@ -110,6 +117,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationSpace](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationSpace.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment.md) @@ -125,6 +133,8 @@ Class | Method | HTTP request | Description - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationSpaceCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationSpaceCreate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationSpaceUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationSpaceUpdate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestVariableCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestVariableCreate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestVariableUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestVariableUpdate.md) @@ -135,6 +145,11 @@ Class | Method | HTTP request | Description - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceGet](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceGet.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceList.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationSpaceUpdate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseClone](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseClone.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate.md) - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList.md) diff --git a/internal/workflow_client/api_databases.go b/internal/workflow_client/api_databases.go new file mode 100644 index 0000000..b9453bc --- /dev/null +++ b/internal/workflow_client/api_databases.go @@ -0,0 +1,1253 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// DatabasesAPIService DatabasesAPI service +type DatabasesAPIService service + +type DatabasesAPIBindApplicationDatabaseRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + dbId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate +} + +// Request body with the target space_id +func (r DatabasesAPIBindApplicationDatabaseRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) DatabasesAPIBindApplicationDatabaseRequest { + r.request = &request + return r +} + +func (r DatabasesAPIBindApplicationDatabaseRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate, *http.Response, error) { + return r.ApiService.BindApplicationDatabaseExecute(r) +} + +/* +BindApplicationDatabase Bind application database to a space + +Move database to another application space so that applications in that space can use it + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param dbId Database ID + @return DatabasesAPIBindApplicationDatabaseRequest +*/ +func (a *DatabasesAPIService) BindApplicationDatabase(ctx context.Context, projectId string, dbId string) DatabasesAPIBindApplicationDatabaseRequest { + return DatabasesAPIBindApplicationDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + dbId: dbId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate +func (a *DatabasesAPIService) BindApplicationDatabaseExecute(r DatabasesAPIBindApplicationDatabaseRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.BindApplicationDatabase") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/{db_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"db_id"+"}", url.PathEscape(parameterValueToString(r.dbId, "dbId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DatabasesAPICreateApplicationDatabaseRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate +} + +// Request body +func (r DatabasesAPICreateApplicationDatabaseRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) DatabasesAPICreateApplicationDatabaseRequest { + r.request = &request + return r +} + +func (r DatabasesAPICreateApplicationDatabaseRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate, *http.Response, error) { + return r.ApiService.CreateApplicationDatabaseExecute(r) +} + +/* +CreateApplicationDatabase Create application database + +Create database in application space; without space_id the database is created in the Default space + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return DatabasesAPICreateApplicationDatabaseRequest +*/ +func (a *DatabasesAPIService) CreateApplicationDatabase(ctx context.Context, projectId string) DatabasesAPICreateApplicationDatabaseRequest { + return DatabasesAPICreateApplicationDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate +func (a *DatabasesAPIService) CreateApplicationDatabaseExecute(r DatabasesAPICreateApplicationDatabaseRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.CreateApplicationDatabase") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DatabasesAPIDeleteApplicationDatabaseRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + dbId string +} + +func (r DatabasesAPIDeleteApplicationDatabaseRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteApplicationDatabaseExecute(r) +} + +/* +DeleteApplicationDatabase Delete application database + +Delete database with its user and password + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param dbId Database ID + @return DatabasesAPIDeleteApplicationDatabaseRequest +*/ +func (a *DatabasesAPIService) DeleteApplicationDatabase(ctx context.Context, projectId string, dbId string) DatabasesAPIDeleteApplicationDatabaseRequest { + return DatabasesAPIDeleteApplicationDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + dbId: dbId, + } +} + +// Execute executes the request +func (a *DatabasesAPIService) DeleteApplicationDatabaseExecute(r DatabasesAPIDeleteApplicationDatabaseRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.DeleteApplicationDatabase") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/{db_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"db_id"+"}", url.PathEscape(parameterValueToString(r.dbId, "dbId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type DatabasesAPIGetApplicationDatabaseRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + dbId string +} + +func (r DatabasesAPIGetApplicationDatabaseRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet, *http.Response, error) { + return r.ApiService.GetApplicationDatabaseExecute(r) +} + +/* +GetApplicationDatabase Get application database + +Get application database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param dbId Database ID + @return DatabasesAPIGetApplicationDatabaseRequest +*/ +func (a *DatabasesAPIService) GetApplicationDatabase(ctx context.Context, projectId string, dbId string) DatabasesAPIGetApplicationDatabaseRequest { + return DatabasesAPIGetApplicationDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + dbId: dbId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet +func (a *DatabasesAPIService) GetApplicationDatabaseExecute(r DatabasesAPIGetApplicationDatabaseRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.GetApplicationDatabase") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/{db_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"db_id"+"}", url.PathEscape(parameterValueToString(r.dbId, "dbId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DatabasesAPIGetApplicationDatabaseDSNRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + dbId string +} + +func (r DatabasesAPIGetApplicationDatabaseDSNRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN, *http.Response, error) { + return r.ApiService.GetApplicationDatabaseDSNExecute(r) +} + +/* +GetApplicationDatabaseDSN Get application database connection string + +Get application database DSN with the user password; the response contains a secret + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param dbId Database ID + @return DatabasesAPIGetApplicationDatabaseDSNRequest +*/ +func (a *DatabasesAPIService) GetApplicationDatabaseDSN(ctx context.Context, projectId string, dbId string) DatabasesAPIGetApplicationDatabaseDSNRequest { + return DatabasesAPIGetApplicationDatabaseDSNRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + dbId: dbId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN +func (a *DatabasesAPIService) GetApplicationDatabaseDSNExecute(r DatabasesAPIGetApplicationDatabaseDSNRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.GetApplicationDatabaseDSN") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/{db_id}/dsn" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"db_id"+"}", url.PathEscape(parameterValueToString(r.dbId, "dbId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DatabasesAPIListApplicationDatabasesRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + spaceId *string + search *string + sort *string + limit *int + offset *int +} + +// Space ID (default: Default space) +func (r DatabasesAPIListApplicationDatabasesRequest) SpaceId(spaceId string) DatabasesAPIListApplicationDatabasesRequest { + r.spaceId = &spaceId + return r +} + +// Search +func (r DatabasesAPIListApplicationDatabasesRequest) Search(search string) DatabasesAPIListApplicationDatabasesRequest { + r.search = &search + return r +} + +// Sort Order +func (r DatabasesAPIListApplicationDatabasesRequest) Sort(sort string) DatabasesAPIListApplicationDatabasesRequest { + r.sort = &sort + return r +} + +// Limit +func (r DatabasesAPIListApplicationDatabasesRequest) Limit(limit int) DatabasesAPIListApplicationDatabasesRequest { + r.limit = &limit + return r +} + +// Offset +func (r DatabasesAPIListApplicationDatabasesRequest) Offset(offset int) DatabasesAPIListApplicationDatabasesRequest { + r.offset = &offset + return r +} + +func (r DatabasesAPIListApplicationDatabasesRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList, *http.Response, error) { + return r.ApiService.ListApplicationDatabasesExecute(r) +} + +/* +ListApplicationDatabases List application databases + +List databases of application space + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return DatabasesAPIListApplicationDatabasesRequest +*/ +func (a *DatabasesAPIService) ListApplicationDatabases(ctx context.Context, projectId string) DatabasesAPIListApplicationDatabasesRequest { + return DatabasesAPIListApplicationDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList +func (a *DatabasesAPIService) ListApplicationDatabasesExecute(r DatabasesAPIListApplicationDatabasesRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.ListApplicationDatabases") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/list" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.spaceId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "space_id", r.spaceId, "", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "", "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DatabasesAPIResetApplicationDatabasePasswordRequest struct { + ctx context.Context + ApiService *DatabasesAPIService + projectId string + dbId string +} + +func (r DatabasesAPIResetApplicationDatabasePasswordRequest) Execute() (*http.Response, error) { + return r.ApiService.ResetApplicationDatabasePasswordExecute(r) +} + +/* +ResetApplicationDatabasePassword Reset application database password + +Reset application database password + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param dbId Database ID + @return DatabasesAPIResetApplicationDatabasePasswordRequest +*/ +func (a *DatabasesAPIService) ResetApplicationDatabasePassword(ctx context.Context, projectId string, dbId string) DatabasesAPIResetApplicationDatabasePasswordRequest { + return DatabasesAPIResetApplicationDatabasePasswordRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + dbId: dbId, + } +} + +// Execute executes the request +func (a *DatabasesAPIService) ResetApplicationDatabasePasswordExecute(r DatabasesAPIResetApplicationDatabasePasswordRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatabasesAPIService.ResetApplicationDatabasePassword") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application-db/{db_id}/reset" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"db_id"+"}", url.PathEscape(parameterValueToString(r.dbId, "dbId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/internal/workflow_client/client.go b/internal/workflow_client/client.go index 94c0346..7d49ee4 100644 --- a/internal/workflow_client/client.go +++ b/internal/workflow_client/client.go @@ -50,6 +50,8 @@ type APIClient struct { ApplicationSpaceAPI *ApplicationSpaceAPIService + DatabasesAPI *DatabasesAPIService + PipelinesAPI *PipelinesAPIService ServicesAPI *ServicesAPIService @@ -74,6 +76,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.ApplicationSpaceAPI = (*ApplicationSpaceAPIService)(&c.common) + c.DatabasesAPI = (*DatabasesAPIService)(&c.common) c.PipelinesAPI = (*PipelinesAPIService)(&c.common) c.ServicesAPI = (*ServicesAPIService)(&c.common) c.WorkflowsAPI = (*WorkflowsAPIService)(&c.common) diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application_db.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application_db.go new file mode 100644 index 0000000..616eb06 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application_db.go @@ -0,0 +1,304 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDBWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDBWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetSpaceId() string { + if o == nil || IsNil(o.SpaceId) { + var ret string + return ret + } + return *o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetSpaceIdOk() (*string, bool) { + if o == nil || IsNil(o.SpaceId) { + return nil, false + } + return o.SpaceId, true +} + +// HasSpaceId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasSpaceId() bool { + if o != nil && !IsNil(o.SpaceId) { + return true + } + + return false +} + +// SetSpaceId gets a reference to the given string and assigns it to the SpaceId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_create.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_create.go new file mode 100644 index 0000000..af29229 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_create.go @@ -0,0 +1,192 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate struct { + Name string `json:"name"` + SpaceId *string `json:"space_id,omitempty"` +} + +type _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate(name string) *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate{} + this.Name = name + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate{} + return &this +} + +// GetName returns the Name field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) SetName(v string) { + o.Name = v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) GetSpaceId() string { + if o == nil || IsNil(o.SpaceId) { + var ret string + return ret + } + return *o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) GetSpaceIdOk() (*string, bool) { + if o == nil || IsNil(o.SpaceId) { + return nil, false + } + return o.SpaceId, true +} + +// HasSpaceId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) HasSpaceId() bool { + if o != nil && !IsNil(o.SpaceId) { + return true + } + + return false +} + +// SetSpaceId gets a reference to the given string and assigns it to the SpaceId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) SetSpaceId(v string) { + o.SpaceId = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + return toSerialize, nil +} + +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate := _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) + + if err != nil { + return err + } + + *o = GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate(varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) + + return err +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_update.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_update.go new file mode 100644 index 0000000..ff382db --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_applicationdb_update.go @@ -0,0 +1,156 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate struct { + SpaceId string `json:"space_id"` +} + +type _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate(spaceId string) *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate{} + this.SpaceId = spaceId + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate{} + return &this +} + +// GetSpaceId returns the SpaceId field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) GetSpaceId() string { + if o == nil { + var ret string + return ret + } + + return o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) GetSpaceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SpaceId, true +} + +// SetSpaceId sets field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) SetSpaceId(v string) { + o.SpaceId = v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["space_id"] = o.SpaceId + return toSerialize, nil +} + +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "space_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate := _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) + + if err != nil { + return err + } + + *o = GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate(varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) + + return err +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationdbUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_create.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_create.go new file mode 100644 index 0000000..5eea8df --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_create.go @@ -0,0 +1,304 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetSpaceId() string { + if o == nil || IsNil(o.SpaceId) { + var ret string + return ret + } + return *o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetSpaceIdOk() (*string, bool) { + if o == nil || IsNil(o.SpaceId) { + return nil, false + } + return o.SpaceId, true +} + +// HasSpaceId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasSpaceId() bool { + if o != nil && !IsNil(o.SpaceId) { + return true + } + + return false +} + +// SetSpaceId gets a reference to the given string and assigns it to the SpaceId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get.go new file mode 100644 index 0000000..075d3f4 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get.go @@ -0,0 +1,304 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetSpaceId() string { + if o == nil || IsNil(o.SpaceId) { + var ret string + return ret + } + return *o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetSpaceIdOk() (*string, bool) { + if o == nil || IsNil(o.SpaceId) { + return nil, false + } + return o.SpaceId, true +} + +// HasSpaceId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasSpaceId() bool { + if o != nil && !IsNil(o.SpaceId) { + return true + } + + return false +} + +// SetSpaceId gets a reference to the given string and assigns it to the SpaceId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get_dsn.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get_dsn.go new file mode 100644 index 0000000..242758a --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_get_dsn.go @@ -0,0 +1,124 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN struct { + Dsn *string `json:"dsn,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSNWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSNWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN{} + return &this +} + +// GetDsn returns the Dsn field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) GetDsn() string { + if o == nil || IsNil(o.Dsn) { + var ret string + return ret + } + return *o.Dsn +} + +// GetDsnOk returns a tuple with the Dsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) GetDsnOk() (*string, bool) { + if o == nil || IsNil(o.Dsn) { + return nil, false + } + return o.Dsn, true +} + +// HasDsn returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) HasDsn() bool { + if o != nil && !IsNil(o.Dsn) { + return true + } + + return false +} + +// SetDsn gets a reference to the given string and assigns it to the Dsn field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) SetDsn(v string) { + o.Dsn = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dsn) { + toSerialize["dsn"] = o.Dsn + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbGetDSN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_list.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_list.go new file mode 100644 index 0000000..dd2ddbd --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_list.go @@ -0,0 +1,160 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList struct { + Databases []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB `json:"databases,omitempty"` + Total *int `json:"total,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbListWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbListWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList{} + return &this +} + +// GetDatabases returns the Databases field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) GetDatabases() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB { + if o == nil || IsNil(o.Databases) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB + return ret + } + return o.Databases +} + +// GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) GetDatabasesOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB, bool) { + if o == nil || IsNil(o.Databases) { + return nil, false + } + return o.Databases, true +} + +// HasDatabases returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) HasDatabases() bool { + if o != nil && !IsNil(o.Databases) { + return true + } + + return false +} + +// SetDatabases gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB and assigns it to the Databases field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) SetDatabases(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationDB) { + o.Databases = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) GetTotal() int { + if o == nil || IsNil(o.Total) { + var ret int + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) GetTotalOk() (*int, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int and assigns it to the Total field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) SetTotal(v int) { + o.Total = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Databases) { + toSerialize["databases"] = o.Databases + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_update.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_update.go new file mode 100644 index 0000000..827f47a --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_applicationdb_update.go @@ -0,0 +1,304 @@ +/* +Pipelines Public API + +Pipelines Public API + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package workflowclient + +import ( + "encoding/json" +) + +// checks if the GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetSpaceId() string { + if o == nil || IsNil(o.SpaceId) { + var ret string + return ret + } + return *o.SpaceId +} + +// GetSpaceIdOk returns a tuple with the SpaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetSpaceIdOk() (*string, bool) { + if o == nil || IsNil(o.SpaceId) { + return nil, false + } + return o.SpaceId, true +} + +// HasSpaceId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasSpaceId() bool { + if o != nil && !IsNil(o.SpaceId) { + return true + } + + return false +} + +// SetSpaceId gets a reference to the given string and assigns it to the SpaceId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationdbUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/skills/eds/SKILL.md b/skills/eds/SKILL.md index 2ffb21a..748ccd1 100644 --- a/skills/eds/SKILL.md +++ b/skills/eds/SKILL.md @@ -1,6 +1,6 @@ --- name: evolution-devservices-cli -description: Manage cloud.ru developer tools products via the `eds` CLI — git repositories (Repo product, "eds repo") and deploy/publish pipelines (Workflow Studio product, "eds wf"). Use when the user asks to list, create, inspect, delete or clone repositories, to push/pull code, or to create/deploy/monitor a Workflow Studio application. +description: Manage cloud.ru developer tools products via the `eds` CLI — git repositories (Repo product, "eds repo"), deploy/publish pipelines and managed databases (Workflow Studio product, "eds wf"). Use when the user asks to list, create, inspect, delete or clone repositories, to push/pull code, to create/deploy/monitor a Workflow Studio application, or to create/bind/inspect a managed database and obtain its connection string. --- # Evolution DevServices CLI (eds) — Agent Skill @@ -17,8 +17,9 @@ It produces stable JSON output, accepts configuration through environment variables, and is safe to invoke from automation. This skill teaches an AI agent how to drive the CLI for the common -tasks: repository discovery/creation/inspection/deletion/cloning, and -Workflow Studio application creation/deployment/monitoring. +tasks: repository discovery/creation/inspection/deletion/cloning, Workflow +Studio application creation/deployment/monitoring, and managed database +provisioning/binding/connection-string retrieval. ## When to use this skill @@ -39,10 +40,17 @@ user wants to: live URL once it succeeds), - inspect or control a specific pipeline run or job (stop, retry, read logs). +Reach for `eds wf db *` whenever the user wants to: + +- **create a managed DBaaS database** for a service, +- **bind (move) a database to the application space** that service lives in, +- read the database's **connection string (DSN)** and hand it to the service, +- list, inspect, reset the password of, or delete a managed database. + Use `eds config` to inspect the active configuration / project id. -Do **not** use `eds` for non-git, non-deploy operations (model cards, -datasets, merge requests). Those are out of scope for this CLI. +Do **not** use `eds` for non-git, non-deploy, non-database operations (model +cards, datasets, merge requests). Those are out of scope for this CLI. ## Tool contract @@ -76,6 +84,13 @@ Errors go to stderr and the process exits non-zero. | `eds wf space show ` | Show an application space | | `eds wf space update --name ` | Update an application space | | `eds wf space delete ` | Delete an application space | +| `eds wf db list [--space-id S] [--search S] [--sort created_at_asc\|created_at_desc] [--limit N] [--offset N]` | List databases in an application space | +| `eds wf db create [--space-id S]` | Create a managed database (Default space if omitted); prints its id | +| `eds wf db show ` | Show a database | +| `eds wf db bind --space-id ` | Bind (move) a database to another application space | +| `eds wf db reset-password ` | Reset the database user password | +| `eds wf db dsn ` | Get the connection string with its password (secret — do not log) | +| `eds wf db delete ` | Delete a database, its user and password (irreversible) | | `eds wf variable list --pipeline-id ` | List variables for a pipeline | | `eds wf variable create --pipeline-id ` | Create a pipeline variable | | `eds wf variable update --pipeline-id ` | Update a pipeline variable | @@ -269,6 +284,34 @@ echo "url: $URL" To redeploy later (e.g. after a new push), skip straight to `eds wf app deploy "$APP_ID"` — the application already exists. +### Create a managed database and wire it to a service + +Use the public API behind `eds wf db` instead of the UI. A database belongs +to an application space, so "bind to a service" means moving it into the +space where that service's application lives. + +```bash +export EDS_API_KEY=... +export EDS_PROJECT_ID=... + +# 1. Find the service's space (from its application). +SPACE_ID=$(eds wf app show "$APP_ID" --json | jq -r '.space_id') + +# 2. Create the database and remember its id. +DB_ID=$(eds wf db create orders --space-id "$SPACE_ID" --json | jq -r '.id') + +# 3. If the database already exists, bind it to that space instead. +eds wf db bind "$DB_ID" --space-id "$SPACE_ID" + +# 4. Get the connection string. It contains the password: keep it out of +# logs and pass it to the service through a secret/variable. +DSN=$(eds wf db dsn "$DB_ID" --json | jq -r '.dsn') +``` + +`eds wf db list`, `show`, `reset-password`, and `delete` cover the remaining +operations. Do not retry `reset-password`/`delete` blindly: mutations are +serialized per database and a concurrent operation returns 409 Conflict. + ### Dockerfile requirements for Workflow Studio (Container Apps) The runtime executes containers as **non-root with a read-only-ish root @@ -325,6 +368,8 @@ exit=1 ## Limits and non-features - Only `type=git` repositories are created (model/dataset are out of scope). +- `eds wf db dsn` returns the database password. Never echo it into logs or + tool output that is shown to other users; pass it straight to the service. - `--ssh` requires the host's SSH public key to be registered separately (not handled by this CLI). - No custom upload mechanism: use `git push` after `eds repo clone`.