diff --git a/.openapi-generator.yaml b/.openapi-generator.yaml new file mode 100644 index 0000000..83ff6a1 --- /dev/null +++ b/.openapi-generator.yaml @@ -0,0 +1,14 @@ +packageName: workflowclient +withGoMod: false +structPrefix: true +typeMappings: + integer: int + +generateInterfaces: false +hideGenerationTimestamp: true + +globalProperties: + apiTests: false + modelTests: false + apiDocs: false + modelDocs: false diff --git a/Makefile b/Makefile index a6d7105..7443ee3 100644 --- a/Makefile +++ b/Makefile @@ -179,3 +179,6 @@ help: @echo " install go install into \$$GOBIN" @echo " test, vet, tidy standard Go targets" @echo " clean remove ./bin and ./dist" + +openapi-generator: + openapi-generator-cli generate -i openapi-public.yaml -g go -o ./internal/workflow_client -c .openapi-generator.yaml diff --git a/cmd/helpers.go b/cmd/helpers.go index 51a04a6..4f1e481 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -6,6 +6,7 @@ import ( "os" "time" + workflowclient "github.com/cloud-ru/evolution-devservices-cli/internal/workflow_client" "github.com/spf13/cobra" "github.com/cloud-ru/evolution-devservices-cli/internal/config" @@ -23,11 +24,13 @@ const workflowTokenExpiryBuffer = 30 * time.Second // runtimeContext holds the resolved configuration, API clients and printer // for a single command invocation. type runtimeContext struct { - Cfg *config.Config - API *repoapi.Client - WorkflowAPI *workflowapi.Client - Printer *output.Printer - Quiet bool + Cfg *config.Config + API *repoapi.Client + WorkflowAPI *workflowapi.Client + Printer *output.Printer + Quiet bool + ProjectID string + WorkflowClient *workflowclient.APIClient } // resolveContext loads config, applies flag/env overrides and constructs @@ -72,12 +75,17 @@ func resolveContext(cmd *cobra.Command) (*runtimeContext, error) { format = output.FormatJSON } + workflowClientCfg := workflowclient.NewConfiguration() + workflowClientCfg.AddDefaultHeader("Authorization", "Bearer "+cfg.WorkflowAccessToken) + rt := &runtimeContext{ - Cfg: cfg, - API: repoapi.New(cfg.APIURL, cfg.APIKey, cfg.ProjectID), - WorkflowAPI: workflowapi.New(cfg.WorkflowAPIURL, cfg.WorkflowAccessToken, cfg.ProjectID), - Printer: output.New(format), - Quiet: quiet, + Cfg: cfg, + API: repoapi.New(cfg.APIURL, cfg.APIKey, cfg.ProjectID), + WorkflowAPI: workflowapi.New(cfg.WorkflowAPIURL, cfg.WorkflowAccessToken, cfg.ProjectID), + Printer: output.New(format), + Quiet: quiet, + ProjectID: cfg.ProjectID, + WorkflowClient: workflowclient.NewAPIClient(workflowClientCfg), } // TEMPORARY: some prod environments don't yet accept X-API-KEY for the @@ -144,6 +152,7 @@ func (r *runtimeContext) ensureWorkflowAuth(ctx context.Context) error { r.Cfg.WorkflowTokenExpiresAt = expiresAt r.Cfg.WorkflowAccessTokenKeyID = r.Cfg.WorkflowKeyID r.WorkflowAPI.SetToken(tok.AccessToken) + r.WorkflowClient.GetConfig().DefaultHeader["Authorization"] = "Bearer " + tok.AccessToken // Cache the token on disk (best-effort: a caching failure shouldn't // fail the command, since we already have a valid token in memory). diff --git a/cmd/job.go b/cmd/job.go index 521cf33..f7d7c3e 100644 --- a/cmd/job.go +++ b/cmd/job.go @@ -1,10 +1,10 @@ package cmd import ( - "bufio" "fmt" - "strings" + "time" + workflowclient "github.com/cloud-ru/evolution-devservices-cli/internal/workflow_client" "github.com/spf13/cobra" "github.com/cloud-ru/evolution-devservices-cli/internal/output" @@ -115,14 +115,15 @@ func newJobListCmd() *cobra.Command { } func newJobLogsCmd() *cobra.Command { + var ( + limit int + beforeTime string + ) + cmd := &cobra.Command{ Use: "logs ", - Short: "Stream logs for a job", + Short: "Get logs for a job", Args: cobra.ExactArgs(1), - Long: `logs opens the job's log stream (server-sent events) and prints -each log line to stdout as it arrives. For a finished job the stream ends -as soon as the buffered log has been sent; for a running job it stays open -until the job finishes or the command is interrupted (Ctrl-C).`, RunE: func(cmd *cobra.Command, args []string) error { ctx, err := resolveContext(cmd) if err != nil { @@ -132,25 +133,28 @@ until the job finishes or the command is interrupted (Ctrl-C).`, return err } - body, err := ctx.WorkflowAPI.StreamJobLogs(cmd.Context(), args[0]) + resp, _, err := ctx.WorkflowClient.WorkflowsAPI. + ProjectProjectIdJobJobIdLogListPost(cmd.Context(), ctx.ProjectID, args[0]). + Request(workflowclient.GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList{ + BeforeTime: &beforeTime, + Limit: &limit, + }).Execute() if err != nil { - return err + return fmt.Errorf("workflow client logs: %w", err) } - defer body.Close() - scanner := bufio.NewScanner(body) - scanner.Buffer(make([]byte, 64*1024), 1024*1024) - for scanner.Scan() { - line := scanner.Text() - if !strings.HasPrefix(line, "data:") { - // Skip SSE "event:" lines, ":" heartbeat comments and blank separators. - continue - } - fmt.Fprintln(cmd.OutOrStdout(), strings.TrimSpace(strings.TrimPrefix(line, "data:"))) + err = ctx.Printer.PrintJSON(resp) + if err != nil { + return fmt.Errorf("print json: %w", err) } - return scanner.Err() + + return nil }, } + + cmd.Flags().IntVar(&limit, "limit", 10, "page size, default is 10") + cmd.Flags().StringVar(&beforeTime, "before", time.Now().Format(time.RFC3339), "RFC3339 time, default is now") + return cmd } diff --git a/internal/workflow_client/.gitignore b/internal/workflow_client/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/internal/workflow_client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/internal/workflow_client/.openapi-generator-ignore b/internal/workflow_client/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/internal/workflow_client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/internal/workflow_client/.openapi-generator/FILES b/internal/workflow_client/.openapi-generator/FILES new file mode 100644 index 0000000..aa7fda6 --- /dev/null +++ b/internal/workflow_client/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_pipelines.go +api_services.go +api_workflows.go +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_config_storage_type.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_deployment.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job_status.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline_type.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_repo_config_storage.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run_status.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_stage.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_create.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_job_log_list.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_create.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_get.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_list.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 +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_response.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_log_list.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_logs.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_pipeline_run.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_run_get.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_bad_request.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_conflict.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_internal.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_not_found.go +model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_unauthorized.go +response.go +utils.go diff --git a/internal/workflow_client/.openapi-generator/VERSION b/internal/workflow_client/.openapi-generator/VERSION new file mode 100644 index 0000000..0783219 --- /dev/null +++ b/internal/workflow_client/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.24.0 diff --git a/internal/workflow_client/.travis.yml b/internal/workflow_client/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/internal/workflow_client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/internal/workflow_client/README.md b/internal/workflow_client/README.md new file mode 100644 index 0000000..5fc6e6f --- /dev/null +++ b/internal/workflow_client/README.md @@ -0,0 +1,169 @@ +# Go API client for workflowclient + +Pipelines Public API + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0 +- Package version: 1.0.0 +- Generator version: 7.24.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Import the package in a go file in your project and run `go mod tidy`: + +```go +import workflowclient "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `workflowclient.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), workflowclient.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `workflowclient.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), workflowclient.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `workflowclient.ContextOperationServerIndices` and `workflowclient.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), workflowclient.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), workflowclient.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://pipeline.cloud.ru/public-api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PipelinesAPI* | [**ProjectProjectIdJobJobIdLogListPost**](docs/PipelinesAPI.md#projectprojectidjobjobidloglistpost) | **Post** /project/{project_id}/job/{job_id}/log/list | Get job log entries +*PipelinesAPI* | [**ProjectProjectIdPipelinePipelineIdRunPost**](docs/PipelinesAPI.md#projectprojectidpipelinepipelineidrunpost) | **Post** /project/{project_id}/pipeline/{pipeline_id}/run | Run pipeline +*PipelinesAPI* | [**ProjectProjectIdRunRunIdGet**](docs/PipelinesAPI.md#projectprojectidrunrunidget) | **Get** /project/{project_id}/run/{run_id} | Get run +*PipelinesAPI* | [**ProjectProjectIdRunRunIdStopPost**](docs/PipelinesAPI.md#projectprojectidrunrunidstoppost) | **Post** /project/{project_id}/run/{run_id}/stop | Stop run +*ServicesAPI* | [**ProjectProjectIdApplicationApplicationIdDelete**](docs/ServicesAPI.md#projectprojectidapplicationapplicationiddelete) | **Delete** /project/{project_id}/application/{application_id} | Delete application +*ServicesAPI* | [**ProjectProjectIdApplicationApplicationIdDeploymentListGet**](docs/ServicesAPI.md#projectprojectidapplicationapplicationiddeploymentlistget) | **Get** /project/{project_id}/application/{application_id}/deployment/list | List deployments +*ServicesAPI* | [**ProjectProjectIdApplicationApplicationIdDeploymentPost**](docs/ServicesAPI.md#projectprojectidapplicationapplicationiddeploymentpost) | **Post** /project/{project_id}/application/{application_id}/deployment | Create deployment +*ServicesAPI* | [**ProjectProjectIdApplicationApplicationIdGet**](docs/ServicesAPI.md#projectprojectidapplicationapplicationidget) | **Get** /project/{project_id}/application/{application_id} | Get application +*ServicesAPI* | [**ProjectProjectIdApplicationApplicationIdPatch**](docs/ServicesAPI.md#projectprojectidapplicationapplicationidpatch) | **Patch** /project/{project_id}/application/{application_id} | Update application +*ServicesAPI* | [**ProjectProjectIdApplicationListGet**](docs/ServicesAPI.md#projectprojectidapplicationlistget) | **Get** /project/{project_id}/application/list | List applications +*ServicesAPI* | [**ProjectProjectIdApplicationPost**](docs/ServicesAPI.md#projectprojectidapplicationpost) | **Post** /project/{project_id}/application | Create application +*WorkflowsAPI* | [**ProjectProjectIdJobJobIdLogListPost**](docs/WorkflowsAPI.md#projectprojectidjobjobidloglistpost) | **Post** /project/{project_id}/job/{job_id}/log/list | Get job log entries +*WorkflowsAPI* | [**ProjectProjectIdPipelinePipelineIdRunPost**](docs/WorkflowsAPI.md#projectprojectidpipelinepipelineidrunpost) | **Post** /project/{project_id}/pipeline/{pipeline_id}/run | Run pipeline +*WorkflowsAPI* | [**ProjectProjectIdRunRunIdGet**](docs/WorkflowsAPI.md#projectprojectidrunrunidget) | **Get** /project/{project_id}/run/{run_id} | Get run +*WorkflowsAPI* | [**ProjectProjectIdRunRunIdStopPost**](docs/WorkflowsAPI.md#projectprojectidrunrunidstoppost) | **Post** /project/{project_id}/run/{run_id}/stop | Stop run + + +## Documentation For Models + + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound.md) + - [GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized](docs/GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### BearerAuth + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: BearerAuth and passed in as the auth context for each request. + +Example + +```go +auth := context.WithValue( + context.Background(), + workflowclient.ContextAPIKeys, + map[string]workflowclient.APIKey{ + "BearerAuth": {Key: "API_KEY_STRING"}, + }, + ) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/internal/workflow_client/api_pipelines.go b/internal/workflow_client/api_pipelines.go new file mode 100644 index 0000000..7b8a952 --- /dev/null +++ b/internal/workflow_client/api_pipelines.go @@ -0,0 +1,706 @@ +/* +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" +) + +// PipelinesAPIService PipelinesAPI service +type PipelinesAPIService service + +type PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest struct { + ctx context.Context + ApiService *PipelinesAPIService + projectId string + jobId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList +} + +// Request body +func (r PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest { + r.request = &request + return r +} + +func (r PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList, *http.Response, error) { + return r.ApiService.ProjectProjectIdJobJobIdLogListPostExecute(r) +} + +/* +ProjectProjectIdJobJobIdLogListPost Get job log entries + +Get paginated job log entries + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param jobId Job ID + @return PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest +*/ +func (a *PipelinesAPIService) ProjectProjectIdJobJobIdLogListPost(ctx context.Context, projectId string, jobId string) PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest { + return PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + jobId: jobId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList +func (a *PipelinesAPIService) ProjectProjectIdJobJobIdLogListPostExecute(r PipelinesAPIProjectProjectIdJobJobIdLogListPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PipelinesAPIService.ProjectProjectIdJobJobIdLogListPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/job/{job_id}/log/list" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", url.PathEscape(parameterValueToString(r.jobId, "jobId")), -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 PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest struct { + ctx context.Context + ApiService *PipelinesAPIService + projectId string + pipelineId string + branch *string +} + +// Branch +func (r PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest) Branch(branch string) PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest { + r.branch = &branch + return r +} + +func (r PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun, *http.Response, error) { + return r.ApiService.ProjectProjectIdPipelinePipelineIdRunPostExecute(r) +} + +/* +ProjectProjectIdPipelinePipelineIdRunPost Run pipeline + +Run pipeline + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param pipelineId Pipeline ID + @return PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest +*/ +func (a *PipelinesAPIService) ProjectProjectIdPipelinePipelineIdRunPost(ctx context.Context, projectId string, pipelineId string) PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest { + return PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + pipelineId: pipelineId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun +func (a *PipelinesAPIService) ProjectProjectIdPipelinePipelineIdRunPostExecute(r PipelinesAPIProjectProjectIdPipelinePipelineIdRunPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PipelinesAPIService.ProjectProjectIdPipelinePipelineIdRunPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/pipeline/{pipeline_id}/run" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipeline_id"+"}", url.PathEscape(parameterValueToString(r.pipelineId, "pipelineId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.branch == nil { + return localVarReturnValue, nil, reportError("branch is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "branch", r.branch, "", "") + // 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 PipelinesAPIProjectProjectIdRunRunIdGetRequest struct { + ctx context.Context + ApiService *PipelinesAPIService + projectId string + runId string +} + +func (r PipelinesAPIProjectProjectIdRunRunIdGetRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet, *http.Response, error) { + return r.ApiService.ProjectProjectIdRunRunIdGetExecute(r) +} + +/* +ProjectProjectIdRunRunIdGet Get run + +Get run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param runId Run ID + @return PipelinesAPIProjectProjectIdRunRunIdGetRequest +*/ +func (a *PipelinesAPIService) ProjectProjectIdRunRunIdGet(ctx context.Context, projectId string, runId string) PipelinesAPIProjectProjectIdRunRunIdGetRequest { + return PipelinesAPIProjectProjectIdRunRunIdGetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + runId: runId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet +func (a *PipelinesAPIService) ProjectProjectIdRunRunIdGetExecute(r PipelinesAPIProjectProjectIdRunRunIdGetRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PipelinesAPIService.ProjectProjectIdRunRunIdGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/run/{run_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"run_id"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -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 PipelinesAPIProjectProjectIdRunRunIdStopPostRequest struct { + ctx context.Context + ApiService *PipelinesAPIService + projectId string + runId string +} + +func (r PipelinesAPIProjectProjectIdRunRunIdStopPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ProjectProjectIdRunRunIdStopPostExecute(r) +} + +/* +ProjectProjectIdRunRunIdStopPost Stop run + +Stop run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param runId Run ID + @return PipelinesAPIProjectProjectIdRunRunIdStopPostRequest +*/ +func (a *PipelinesAPIService) ProjectProjectIdRunRunIdStopPost(ctx context.Context, projectId string, runId string) PipelinesAPIProjectProjectIdRunRunIdStopPostRequest { + return PipelinesAPIProjectProjectIdRunRunIdStopPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + runId: runId, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *PipelinesAPIService) ProjectProjectIdRunRunIdStopPostExecute(r PipelinesAPIProjectProjectIdRunRunIdStopPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PipelinesAPIService.ProjectProjectIdRunRunIdStopPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/run/{run_id}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"run_id"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -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 +} diff --git a/internal/workflow_client/api_services.go b/internal/workflow_client/api_services.go new file mode 100644 index 0000000..ebe04d8 --- /dev/null +++ b/internal/workflow_client/api_services.go @@ -0,0 +1,1294 @@ +/* +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" +) + +// ServicesAPIService ServicesAPI service +type ServicesAPIService service + +type ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + applicationId string +} + +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationApplicationIdDeleteExecute(r) +} + +/* +ProjectProjectIdApplicationApplicationIdDelete Delete application + +Delete application and related deployments + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param applicationId Application ID + @return ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDelete(ctx context.Context, projectId string, applicationId string) ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest { + return ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + applicationId: applicationId, + } +} + +// Execute executes the request +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDeleteExecute(r ServicesAPIProjectProjectIdApplicationApplicationIdDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationApplicationIdDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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{"*/*"} + + // 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 == 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 ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + applicationId string + limit *int + offset *int + search *string + sort *string +} + +// Limit +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) Limit(limit int) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest { + r.limit = &limit + return r +} + +// Offset +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) Offset(offset int) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest { + r.offset = &offset + return r +} + +// Search +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) Search(search string) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest { + r.search = &search + return r +} + +// Sort Order +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) Sort(sort string) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest { + r.sort = &sort + return r +} + +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList, *http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationApplicationIdDeploymentListGetExecute(r) +} + +/* +ProjectProjectIdApplicationApplicationIdDeploymentListGet List deployments + +List deployments for application + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param applicationId Application ID + @return ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDeploymentListGet(ctx context.Context, projectId string, applicationId string) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest { + return ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDeploymentListGetExecute(r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentListGetRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationApplicationIdDeploymentListGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/{application_id}/deployment/list" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "", "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "", "") + } + // 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 ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + applicationId string + request *map[string]interface{} +} + +// Deployment create request +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest) Request(request map[string]interface{}) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest { + r.request = &request + return r +} + +func (r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate, *http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationApplicationIdDeploymentPostExecute(r) +} + +/* +ProjectProjectIdApplicationApplicationIdDeploymentPost Create deployment + +Create deployment (run workflow) for application + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param applicationId Application ID + @return ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDeploymentPost(ctx context.Context, projectId string, applicationId string) ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest { + return ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdDeploymentPostExecute(r ServicesAPIProjectProjectIdApplicationApplicationIdDeploymentPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationApplicationIdDeploymentPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/{application_id}/deployment" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + applicationId string +} + +func (r ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet, *http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationApplicationIdGetExecute(r) +} + +/* +ProjectProjectIdApplicationApplicationIdGet Get application + +Get application by ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param applicationId Application ID + @return ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdGet(ctx context.Context, projectId string, applicationId string) ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest { + return ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdGetExecute(r ServicesAPIProjectProjectIdApplicationApplicationIdGetRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationApplicationIdGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + applicationId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate +} + +// Application update request +func (r ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest { + r.request = &request + return r +} + +func (r ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest) Execute() (*http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationApplicationIdPatchExecute(r) +} + +/* +ProjectProjectIdApplicationApplicationIdPatch Update application + +Update application metadata + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param applicationId Application ID + @return ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdPatch(ctx context.Context, projectId string, applicationId string) ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest { + return ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + applicationId: applicationId, + } +} + +// Execute executes the request +func (a *ServicesAPIService) ProjectProjectIdApplicationApplicationIdPatchExecute(r ServicesAPIProjectProjectIdApplicationApplicationIdPatchRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationApplicationIdPatch") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return 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 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 ServicesAPIProjectProjectIdApplicationListGetRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + limit *int + offset *int + search *string + sort *string + spaceId *string +} + +// Limit +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) Limit(limit int) ServicesAPIProjectProjectIdApplicationListGetRequest { + r.limit = &limit + return r +} + +// Offset +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) Offset(offset int) ServicesAPIProjectProjectIdApplicationListGetRequest { + r.offset = &offset + return r +} + +// Search +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) Search(search string) ServicesAPIProjectProjectIdApplicationListGetRequest { + r.search = &search + return r +} + +// Sort Order +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) Sort(sort string) ServicesAPIProjectProjectIdApplicationListGetRequest { + r.sort = &sort + return r +} + +// Space ID (default: Default space) +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) SpaceId(spaceId string) ServicesAPIProjectProjectIdApplicationListGetRequest { + r.spaceId = &spaceId + return r +} + +func (r ServicesAPIProjectProjectIdApplicationListGetRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList, *http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationListGetExecute(r) +} + +/* +ProjectProjectIdApplicationListGet List applications + +List applications + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ServicesAPIProjectProjectIdApplicationListGetRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationListGet(ctx context.Context, projectId string) ServicesAPIProjectProjectIdApplicationListGetRequest { + return ServicesAPIProjectProjectIdApplicationListGetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList +func (a *ServicesAPIService) ProjectProjectIdApplicationListGetExecute(r ServicesAPIProjectProjectIdApplicationListGetRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationListGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application/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.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "", "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "", "") + } + if r.spaceId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "space_id", r.spaceId, "", "") + } + // 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 ServicesAPIProjectProjectIdApplicationPostRequest struct { + ctx context.Context + ApiService *ServicesAPIService + projectId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate +} + +// Application create request +func (r ServicesAPIProjectProjectIdApplicationPostRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) ServicesAPIProjectProjectIdApplicationPostRequest { + r.request = &request + return r +} + +func (r ServicesAPIProjectProjectIdApplicationPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate, *http.Response, error) { + return r.ApiService.ProjectProjectIdApplicationPostExecute(r) +} + +/* +ProjectProjectIdApplicationPost Create application + +Create application from repository URL + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @return ServicesAPIProjectProjectIdApplicationPostRequest +*/ +func (a *ServicesAPIService) ProjectProjectIdApplicationPost(ctx context.Context, projectId string) ServicesAPIProjectProjectIdApplicationPostRequest { + return ServicesAPIProjectProjectIdApplicationPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate +func (a *ServicesAPIService) ProjectProjectIdApplicationPostExecute(r ServicesAPIProjectProjectIdApplicationPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServicesAPIService.ProjectProjectIdApplicationPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/application" + 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 +} diff --git a/internal/workflow_client/api_workflows.go b/internal/workflow_client/api_workflows.go new file mode 100644 index 0000000..2476831 --- /dev/null +++ b/internal/workflow_client/api_workflows.go @@ -0,0 +1,706 @@ +/* +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" +) + +// WorkflowsAPIService WorkflowsAPI service +type WorkflowsAPIService service + +type WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest struct { + ctx context.Context + ApiService *WorkflowsAPIService + projectId string + jobId string + request *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList +} + +// Request body +func (r WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest) Request(request GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest { + r.request = &request + return r +} + +func (r WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList, *http.Response, error) { + return r.ApiService.ProjectProjectIdJobJobIdLogListPostExecute(r) +} + +/* +ProjectProjectIdJobJobIdLogListPost Get job log entries + +Get paginated job log entries + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param jobId Job ID + @return WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest +*/ +func (a *WorkflowsAPIService) ProjectProjectIdJobJobIdLogListPost(ctx context.Context, projectId string, jobId string) WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest { + return WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + jobId: jobId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList +func (a *WorkflowsAPIService) ProjectProjectIdJobJobIdLogListPostExecute(r WorkflowsAPIProjectProjectIdJobJobIdLogListPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WorkflowsAPIService.ProjectProjectIdJobJobIdLogListPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/job/{job_id}/log/list" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", url.PathEscape(parameterValueToString(r.jobId, "jobId")), -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 WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest struct { + ctx context.Context + ApiService *WorkflowsAPIService + projectId string + pipelineId string + branch *string +} + +// Branch +func (r WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest) Branch(branch string) WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest { + r.branch = &branch + return r +} + +func (r WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun, *http.Response, error) { + return r.ApiService.ProjectProjectIdPipelinePipelineIdRunPostExecute(r) +} + +/* +ProjectProjectIdPipelinePipelineIdRunPost Run pipeline + +Run pipeline + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param pipelineId Pipeline ID + @return WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest +*/ +func (a *WorkflowsAPIService) ProjectProjectIdPipelinePipelineIdRunPost(ctx context.Context, projectId string, pipelineId string) WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest { + return WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + pipelineId: pipelineId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun +func (a *WorkflowsAPIService) ProjectProjectIdPipelinePipelineIdRunPostExecute(r WorkflowsAPIProjectProjectIdPipelinePipelineIdRunPostRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WorkflowsAPIService.ProjectProjectIdPipelinePipelineIdRunPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/pipeline/{pipeline_id}/run" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipeline_id"+"}", url.PathEscape(parameterValueToString(r.pipelineId, "pipelineId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.branch == nil { + return localVarReturnValue, nil, reportError("branch is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "branch", r.branch, "", "") + // 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 WorkflowsAPIProjectProjectIdRunRunIdGetRequest struct { + ctx context.Context + ApiService *WorkflowsAPIService + projectId string + runId string +} + +func (r WorkflowsAPIProjectProjectIdRunRunIdGetRequest) Execute() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet, *http.Response, error) { + return r.ApiService.ProjectProjectIdRunRunIdGetExecute(r) +} + +/* +ProjectProjectIdRunRunIdGet Get run + +Get run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param runId Run ID + @return WorkflowsAPIProjectProjectIdRunRunIdGetRequest +*/ +func (a *WorkflowsAPIService) ProjectProjectIdRunRunIdGet(ctx context.Context, projectId string, runId string) WorkflowsAPIProjectProjectIdRunRunIdGetRequest { + return WorkflowsAPIProjectProjectIdRunRunIdGetRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + runId: runId, + } +} + +// Execute executes the request +// +// @return GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet +func (a *WorkflowsAPIService) ProjectProjectIdRunRunIdGetExecute(r WorkflowsAPIProjectProjectIdRunRunIdGetRequest) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WorkflowsAPIService.ProjectProjectIdRunRunIdGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/run/{run_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"run_id"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -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 WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest struct { + ctx context.Context + ApiService *WorkflowsAPIService + projectId string + runId string +} + +func (r WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ProjectProjectIdRunRunIdStopPostExecute(r) +} + +/* +ProjectProjectIdRunRunIdStopPost Stop run + +Stop run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project ID + @param runId Run ID + @return WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest +*/ +func (a *WorkflowsAPIService) ProjectProjectIdRunRunIdStopPost(ctx context.Context, projectId string, runId string) WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest { + return WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + runId: runId, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *WorkflowsAPIService) ProjectProjectIdRunRunIdStopPostExecute(r WorkflowsAPIProjectProjectIdRunRunIdStopPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WorkflowsAPIService.ProjectProjectIdRunRunIdStopPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/project/{project_id}/run/{run_id}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"run_id"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -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 +} diff --git a/internal/workflow_client/client.go b/internal/workflow_client/client.go new file mode 100644 index 0000000..8e6efdf --- /dev/null +++ b/internal/workflow_client/client.go @@ -0,0 +1,667 @@ +/* +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" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Pipelines Public API API v1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + PipelinesAPI *PipelinesAPIService + + ServicesAPI *ServicesAPIService + + WorkflowsAPI *WorkflowsAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.PipelinesAPI = (*PipelinesAPIService)(&c.common) + c.ServicesAPI = (*ServicesAPIService)(&c.common) + c.WorkflowsAPI = (*WorkflowsAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/internal/workflow_client/configuration.go b/internal/workflow_client/configuration.go new file mode 100644 index 0000000..b0835bd --- /dev/null +++ b/internal/workflow_client/configuration.go @@ -0,0 +1,217 @@ +/* +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 ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://pipeline.cloud.ru/public-api/v1", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/internal/workflow_client/git_push.sh b/internal/workflow_client/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/internal/workflow_client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application.go new file mode 100644 index 0000000..06a410b --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_application.go @@ -0,0 +1,592 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + RepositoryId *string `json:"repository_id,omitempty"` + RepositoryUrl *string `json:"repository_url,omitempty"` + Run *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun `json:"run,omitempty"` + RunId *string `json:"run_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + Status *string `json:"status,omitempty"` + TemplateId *string `json:"template_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplicationWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetBranch(v string) { + o.Branch = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetName(v string) { + o.Name = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRepositoryUrl() string { + if o == nil || IsNil(o.RepositoryUrl) { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRepositoryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryUrl) { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasRepositoryUrl() bool { + if o != nil && !IsNil(o.RepositoryUrl) { + return true + } + + return false +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// GetRun returns the Run field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRun() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + if o == nil || IsNil(o.Run) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + return ret + } + return *o.Run +} + +// GetRunOk returns a tuple with the Run field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRunOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun, bool) { + if o == nil || IsNil(o.Run) { + return nil, false + } + return o.Run, true +} + +// HasRun returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasRun() bool { + if o != nil && !IsNil(o.Run) { + return true + } + + return false +} + +// SetRun gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun and assigns it to the Run field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetRun(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + o.Run = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetRunId(v string) { + o.RunId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetStatus(v string) { + o.Status = &v +} + +// GetTemplateId returns the TemplateId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetTemplateId() string { + if o == nil || IsNil(o.TemplateId) { + var ret string + return ret + } + return *o.TemplateId +} + +// GetTemplateIdOk returns a tuple with the TemplateId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) GetTemplateIdOk() (*string, bool) { + if o == nil || IsNil(o.TemplateId) { + return nil, false + } + return o.TemplateId, true +} + +// HasTemplateId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) HasTemplateId() bool { + if o != nil && !IsNil(o.TemplateId) { + return true + } + + return false +} + +// SetTemplateId gets a reference to the given string and assigns it to the TemplateId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetTemplateId(v string) { + o.TemplateId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + 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.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + if !IsNil(o.RepositoryUrl) { + toSerialize["repository_url"] = o.RepositoryUrl + } + if !IsNil(o.Run) { + toSerialize["run"] = o.Run + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TemplateId) { + toSerialize["template_id"] = o.TemplateId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) 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_model_config_storage_type.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_config_storage_type.go new file mode 100644 index 0000000..d183bde --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_config_storage_type.go @@ -0,0 +1,110 @@ +/* +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" + "fmt" +) + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType the model 'GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType' +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType string + +// List of git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.ConfigStorageType +const ( + DBConfigStorageType GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType = "db" + RepoConfigStorageType GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType = "repo" +) + +// All allowed values of GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType enum +var AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeEnumValues = []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType{ + "db", + "repo", +} + +func (v *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType(value) + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType", value) +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeFromValue returns a pointer to a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeFromValue(v string) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType, error) { + ev := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType: valid values are %v", v, AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) IsValid() bool { + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.ConfigStorageType value +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) Ptr() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType { + return &v +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) 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_model_deployment.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_deployment.go new file mode 100644 index 0000000..cb1e6b7 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_deployment.go @@ -0,0 +1,376 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment struct { + Application *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication `json:"application,omitempty"` + ApplicationId *string `json:"application_id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Run *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun `json:"run,omitempty"` + RunId *string `json:"run_id,omitempty"` + ShortName *string `json:"short_name,omitempty"` + Url *string `json:"url,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeploymentWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeploymentWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment{} + return &this +} + +// GetApplication returns the Application field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetApplication() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + if o == nil || IsNil(o.Application) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication + return ret + } + return *o.Application +} + +// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetApplicationOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication, bool) { + if o == nil || IsNil(o.Application) { + return nil, false + } + return o.Application, true +} + +// HasApplication returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasApplication() bool { + if o != nil && !IsNil(o.Application) { + return true + } + + return false +} + +// SetApplication gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication and assigns it to the Application field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetApplication(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) { + o.Application = &v +} + +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetApplicationId() string { + if o == nil || IsNil(o.ApplicationId) { + var ret string + return ret + } + return *o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetApplicationIdOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationId) { + return nil, false + } + return o.ApplicationId, true +} + +// HasApplicationId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasApplicationId() bool { + if o != nil && !IsNil(o.ApplicationId) { + return true + } + + return false +} + +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetApplicationId(v string) { + o.ApplicationId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetId(v string) { + o.Id = &v +} + +// GetRun returns the Run field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetRun() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + if o == nil || IsNil(o.Run) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + return ret + } + return *o.Run +} + +// GetRunOk returns a tuple with the Run field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetRunOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun, bool) { + if o == nil || IsNil(o.Run) { + return nil, false + } + return o.Run, true +} + +// HasRun returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasRun() bool { + if o != nil && !IsNil(o.Run) { + return true + } + + return false +} + +// SetRun gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun and assigns it to the Run field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetRun(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + o.Run = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetRunId(v string) { + o.RunId = &v +} + +// GetShortName returns the ShortName field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetShortName() string { + if o == nil || IsNil(o.ShortName) { + var ret string + return ret + } + return *o.ShortName +} + +// GetShortNameOk returns a tuple with the ShortName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetShortNameOk() (*string, bool) { + if o == nil || IsNil(o.ShortName) { + return nil, false + } + return o.ShortName, true +} + +// HasShortName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasShortName() bool { + if o != nil && !IsNil(o.ShortName) { + return true + } + + return false +} + +// SetShortName gets a reference to the given string and assigns it to the ShortName field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetShortName(v string) { + o.ShortName = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) SetUrl(v string) { + o.Url = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Application) { + toSerialize["application"] = o.Application + } + if !IsNil(o.ApplicationId) { + toSerialize["application_id"] = o.ApplicationId + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Run) { + toSerialize["run"] = o.Run + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.ShortName) { + toSerialize["short_name"] = o.ShortName + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) 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_model_job.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job.go new file mode 100644 index 0000000..62435b4 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job.go @@ -0,0 +1,520 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob struct { + CreatedAt *string `json:"created_at,omitempty"` + DataPlaneExecName *string `json:"data_plane_exec_name,omitempty"` + DataPlaneJobName *string `json:"data_plane_job_name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RunId *string `json:"run_id,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + StageId *string `json:"stage_id,omitempty"` + Status *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus `json:"status,omitempty"` + TemporalWorkflowId *string `json:"temporal_workflow_id,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetDataPlaneExecName returns the DataPlaneExecName field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetDataPlaneExecName() string { + if o == nil || IsNil(o.DataPlaneExecName) { + var ret string + return ret + } + return *o.DataPlaneExecName +} + +// GetDataPlaneExecNameOk returns a tuple with the DataPlaneExecName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetDataPlaneExecNameOk() (*string, bool) { + if o == nil || IsNil(o.DataPlaneExecName) { + return nil, false + } + return o.DataPlaneExecName, true +} + +// HasDataPlaneExecName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasDataPlaneExecName() bool { + if o != nil && !IsNil(o.DataPlaneExecName) { + return true + } + + return false +} + +// SetDataPlaneExecName gets a reference to the given string and assigns it to the DataPlaneExecName field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetDataPlaneExecName(v string) { + o.DataPlaneExecName = &v +} + +// GetDataPlaneJobName returns the DataPlaneJobName field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetDataPlaneJobName() string { + if o == nil || IsNil(o.DataPlaneJobName) { + var ret string + return ret + } + return *o.DataPlaneJobName +} + +// GetDataPlaneJobNameOk returns a tuple with the DataPlaneJobName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetDataPlaneJobNameOk() (*string, bool) { + if o == nil || IsNil(o.DataPlaneJobName) { + return nil, false + } + return o.DataPlaneJobName, true +} + +// HasDataPlaneJobName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasDataPlaneJobName() bool { + if o != nil && !IsNil(o.DataPlaneJobName) { + return true + } + + return false +} + +// SetDataPlaneJobName gets a reference to the given string and assigns it to the DataPlaneJobName field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetDataPlaneJobName(v string) { + o.DataPlaneJobName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetName(v string) { + o.Name = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetRunId(v string) { + o.RunId = &v +} + +// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetSequenceNumber() int { + if o == nil || IsNil(o.SequenceNumber) { + var ret int + return ret + } + return *o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetSequenceNumberOk() (*int, bool) { + if o == nil || IsNil(o.SequenceNumber) { + return nil, false + } + return o.SequenceNumber, true +} + +// HasSequenceNumber returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasSequenceNumber() bool { + if o != nil && !IsNil(o.SequenceNumber) { + return true + } + + return false +} + +// SetSequenceNumber gets a reference to the given int and assigns it to the SequenceNumber field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetSequenceNumber(v int) { + o.SequenceNumber = &v +} + +// GetStageId returns the StageId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetStageId() string { + if o == nil || IsNil(o.StageId) { + var ret string + return ret + } + return *o.StageId +} + +// GetStageIdOk returns a tuple with the StageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetStageIdOk() (*string, bool) { + if o == nil || IsNil(o.StageId) { + return nil, false + } + return o.StageId, true +} + +// HasStageId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasStageId() bool { + if o != nil && !IsNil(o.StageId) { + return true + } + + return false +} + +// SetStageId gets a reference to the given string and assigns it to the StageId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetStageId(v string) { + o.StageId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetStatus() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus { + if o == nil || IsNil(o.Status) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetStatusOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetStatus(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) { + o.Status = &v +} + +// GetTemporalWorkflowId returns the TemporalWorkflowId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetTemporalWorkflowId() string { + if o == nil || IsNil(o.TemporalWorkflowId) { + var ret string + return ret + } + return *o.TemporalWorkflowId +} + +// GetTemporalWorkflowIdOk returns a tuple with the TemporalWorkflowId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetTemporalWorkflowIdOk() (*string, bool) { + if o == nil || IsNil(o.TemporalWorkflowId) { + return nil, false + } + return o.TemporalWorkflowId, true +} + +// HasTemporalWorkflowId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasTemporalWorkflowId() bool { + if o != nil && !IsNil(o.TemporalWorkflowId) { + return true + } + + return false +} + +// SetTemporalWorkflowId gets a reference to the given string and assigns it to the TemporalWorkflowId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetTemporalWorkflowId(v string) { + o.TemporalWorkflowId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetType(v string) { + o.Type = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.DataPlaneExecName) { + toSerialize["data_plane_exec_name"] = o.DataPlaneExecName + } + if !IsNil(o.DataPlaneJobName) { + toSerialize["data_plane_job_name"] = o.DataPlaneJobName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.SequenceNumber) { + toSerialize["sequence_number"] = o.SequenceNumber + } + if !IsNil(o.StageId) { + toSerialize["stage_id"] = o.StageId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TemporalWorkflowId) { + toSerialize["temporal_workflow_id"] = o.TemporalWorkflowId + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) 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_model_job_status.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job_status.go new file mode 100644 index 0000000..0c5e65b --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_job_status.go @@ -0,0 +1,116 @@ +/* +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" + "fmt" +) + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus the model 'GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus' +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus string + +// List of git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.JobStatus +const ( + JobStatusPending GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus = "pending" + JobStatusRunning GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus = "running" + JobStatusDone GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus = "done" + JobStatusCanceled GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus = "canceled" + JobStatusFailed GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus = "failed" +) + +// All allowed values of GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus enum +var AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusEnumValues = []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus{ + "pending", + "running", + "done", + "canceled", + "failed", +} + +func (v *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus(value) + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus", value) +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusFromValue returns a pointer to a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusFromValue(v string) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus, error) { + ev := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus: valid values are %v", v, AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) IsValid() bool { + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.JobStatus value +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) Ptr() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus { + return &v +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) 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_model_pipeline.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline.go new file mode 100644 index 0000000..8575fe8 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline.go @@ -0,0 +1,558 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline struct { + Config *string `json:"config,omitempty"` + ConfigStorageType *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType `json:"config_storage_type,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + CreatorId *string `json:"creator_id,omitempty"` + EnvironmentId *string `json:"environment_id,omitempty"` + Id *string `json:"id,omitempty"` + // Deprecated + ManifestName *string `json:"manifest_name,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + RepoConfigStorage *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage `json:"repo_config_storage,omitempty"` + // Deprecated + RepositoryId *string `json:"repository_id,omitempty"` + Type *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType `json:"type,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetConfig() string { + if o == nil || IsNil(o.Config) { + var ret string + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetConfigOk() (*string, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given string and assigns it to the Config field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetConfig(v string) { + o.Config = &v +} + +// GetConfigStorageType returns the ConfigStorageType field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetConfigStorageType() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType { + if o == nil || IsNil(o.ConfigStorageType) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType + return ret + } + return *o.ConfigStorageType +} + +// GetConfigStorageTypeOk returns a tuple with the ConfigStorageType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetConfigStorageTypeOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType, bool) { + if o == nil || IsNil(o.ConfigStorageType) { + return nil, false + } + return o.ConfigStorageType, true +} + +// HasConfigStorageType returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasConfigStorageType() bool { + if o != nil && !IsNil(o.ConfigStorageType) { + return true + } + + return false +} + +// SetConfigStorageType gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType and assigns it to the ConfigStorageType field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetConfigStorageType(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelConfigStorageType) { + o.ConfigStorageType = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetCreatorId returns the CreatorId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetCreatorId() string { + if o == nil || IsNil(o.CreatorId) { + var ret string + return ret + } + return *o.CreatorId +} + +// GetCreatorIdOk returns a tuple with the CreatorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetCreatorIdOk() (*string, bool) { + if o == nil || IsNil(o.CreatorId) { + return nil, false + } + return o.CreatorId, true +} + +// HasCreatorId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasCreatorId() bool { + if o != nil && !IsNil(o.CreatorId) { + return true + } + + return false +} + +// SetCreatorId gets a reference to the given string and assigns it to the CreatorId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetCreatorId(v string) { + o.CreatorId = &v +} + +// GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetEnvironmentId() string { + if o == nil || IsNil(o.EnvironmentId) { + var ret string + return ret + } + return *o.EnvironmentId +} + +// GetEnvironmentIdOk returns a tuple with the EnvironmentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetEnvironmentIdOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentId) { + return nil, false + } + return o.EnvironmentId, true +} + +// HasEnvironmentId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasEnvironmentId() bool { + if o != nil && !IsNil(o.EnvironmentId) { + return true + } + + return false +} + +// SetEnvironmentId gets a reference to the given string and assigns it to the EnvironmentId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetEnvironmentId(v string) { + o.EnvironmentId = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetId(v string) { + o.Id = &v +} + +// GetManifestName returns the ManifestName field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetManifestName() string { + if o == nil || IsNil(o.ManifestName) { + var ret string + return ret + } + return *o.ManifestName +} + +// GetManifestNameOk returns a tuple with the ManifestName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetManifestNameOk() (*string, bool) { + if o == nil || IsNil(o.ManifestName) { + return nil, false + } + return o.ManifestName, true +} + +// HasManifestName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasManifestName() bool { + if o != nil && !IsNil(o.ManifestName) { + return true + } + + return false +} + +// SetManifestName gets a reference to the given string and assigns it to the ManifestName field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetManifestName(v string) { + o.ManifestName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRepoConfigStorage returns the RepoConfigStorage field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetRepoConfigStorage() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage { + if o == nil || IsNil(o.RepoConfigStorage) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage + return ret + } + return *o.RepoConfigStorage +} + +// GetRepoConfigStorageOk returns a tuple with the RepoConfigStorage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetRepoConfigStorageOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage, bool) { + if o == nil || IsNil(o.RepoConfigStorage) { + return nil, false + } + return o.RepoConfigStorage, true +} + +// HasRepoConfigStorage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasRepoConfigStorage() bool { + if o != nil && !IsNil(o.RepoConfigStorage) { + return true + } + + return false +} + +// SetRepoConfigStorage gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage and assigns it to the RepoConfigStorage field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetRepoConfigStorage(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) { + o.RepoConfigStorage = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetType() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType { + if o == nil || IsNil(o.Type) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) GetTypeOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType and assigns it to the Type field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetType(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) { + o.Type = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.ConfigStorageType) { + toSerialize["config_storage_type"] = o.ConfigStorageType + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatorId) { + toSerialize["creator_id"] = o.CreatorId + } + if !IsNil(o.EnvironmentId) { + toSerialize["environment_id"] = o.EnvironmentId + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ManifestName) { + toSerialize["manifest_name"] = o.ManifestName + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.RepoConfigStorage) { + toSerialize["repo_config_storage"] = o.RepoConfigStorage + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) 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_model_pipeline_type.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline_type.go new file mode 100644 index 0000000..97ed38e --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_pipeline_type.go @@ -0,0 +1,110 @@ +/* +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" + "fmt" +) + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType the model 'GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType' +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType string + +// List of git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.PipelineType +const ( + PipelineTypeCICD GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType = "cicd" + PipelineTypeWorkflow GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType = "workflow" +) + +// All allowed values of GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType enum +var AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeEnumValues = []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType{ + "cicd", + "workflow", +} + +func (v *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType(value) + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType", value) +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeFromValue returns a pointer to a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeFromValue(v string) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType, error) { + ev := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType: valid values are %v", v, AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) IsValid() bool { + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.PipelineType value +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) Ptr() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType { + return &v +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipelineType) 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_model_repo_config_storage.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_repo_config_storage.go new file mode 100644 index 0000000..26144e1 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_repo_config_storage.go @@ -0,0 +1,268 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage struct { + Branch *string `json:"branch,omitempty"` + Id *string `json:"id,omitempty"` + ManifestPath *string `json:"manifest_path,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + RepositoryId *string `json:"repository_id,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorageWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorageWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) SetBranch(v string) { + o.Branch = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) SetId(v string) { + o.Id = &v +} + +// GetManifestPath returns the ManifestPath field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetManifestPath() string { + if o == nil || IsNil(o.ManifestPath) { + var ret string + return ret + } + return *o.ManifestPath +} + +// GetManifestPathOk returns a tuple with the ManifestPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetManifestPathOk() (*string, bool) { + if o == nil || IsNil(o.ManifestPath) { + return nil, false + } + return o.ManifestPath, true +} + +// HasManifestPath returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) HasManifestPath() bool { + if o != nil && !IsNil(o.ManifestPath) { + return true + } + + return false +} + +// SetManifestPath gets a reference to the given string and assigns it to the ManifestPath field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) SetManifestPath(v string) { + o.ManifestPath = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ManifestPath) { + toSerialize["manifest_path"] = o.ManifestPath + } + if !IsNil(o.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRepoConfigStorage) 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_model_run.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run.go new file mode 100644 index 0000000..0e86d64 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run.go @@ -0,0 +1,521 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Pipeline *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline `json:"pipeline,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + Stages []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage `json:"stages,omitempty"` + Status *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus `json:"status,omitempty"` + StatusMessage *string `json:"status_message,omitempty"` + // TODO: Should we save this? + TemporalRunId *string `json:"temporal_run_id,omitempty"` + TemporalWorkflowId *string `json:"temporal_workflow_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetBranch(v string) { + o.Branch = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetId(v string) { + o.Id = &v +} + +// GetPipeline returns the Pipeline field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetPipeline() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + if o == nil || IsNil(o.Pipeline) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline + return ret + } + return *o.Pipeline +} + +// GetPipelineOk returns a tuple with the Pipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetPipelineOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline, bool) { + if o == nil || IsNil(o.Pipeline) { + return nil, false + } + return o.Pipeline, true +} + +// HasPipeline returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasPipeline() bool { + if o != nil && !IsNil(o.Pipeline) { + return true + } + + return false +} + +// SetPipeline gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline and assigns it to the Pipeline field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetPipeline(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) { + o.Pipeline = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetSnapshot returns the Snapshot field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetSnapshot() string { + if o == nil || IsNil(o.Snapshot) { + var ret string + return ret + } + return *o.Snapshot +} + +// GetSnapshotOk returns a tuple with the Snapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetSnapshotOk() (*string, bool) { + if o == nil || IsNil(o.Snapshot) { + return nil, false + } + return o.Snapshot, true +} + +// HasSnapshot returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasSnapshot() bool { + if o != nil && !IsNil(o.Snapshot) { + return true + } + + return false +} + +// SetSnapshot gets a reference to the given string and assigns it to the Snapshot field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetSnapshot(v string) { + o.Snapshot = &v +} + +// GetStages returns the Stages field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStages() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + if o == nil || IsNil(o.Stages) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage + return ret + } + return o.Stages +} + +// GetStagesOk returns a tuple with the Stages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStagesOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage, bool) { + if o == nil || IsNil(o.Stages) { + return nil, false + } + return o.Stages, true +} + +// HasStages returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasStages() bool { + if o != nil && !IsNil(o.Stages) { + return true + } + + return false +} + +// SetStages gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage and assigns it to the Stages field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetStages(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) { + o.Stages = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStatus() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus { + if o == nil || IsNil(o.Status) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStatusOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetStatus(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) { + o.Status = &v +} + +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStatusMessage() string { + if o == nil || IsNil(o.StatusMessage) { + var ret string + return ret + } + return *o.StatusMessage +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetStatusMessageOk() (*string, bool) { + if o == nil || IsNil(o.StatusMessage) { + return nil, false + } + return o.StatusMessage, true +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasStatusMessage() bool { + if o != nil && !IsNil(o.StatusMessage) { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetStatusMessage(v string) { + o.StatusMessage = &v +} + +// GetTemporalRunId returns the TemporalRunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetTemporalRunId() string { + if o == nil || IsNil(o.TemporalRunId) { + var ret string + return ret + } + return *o.TemporalRunId +} + +// GetTemporalRunIdOk returns a tuple with the TemporalRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetTemporalRunIdOk() (*string, bool) { + if o == nil || IsNil(o.TemporalRunId) { + return nil, false + } + return o.TemporalRunId, true +} + +// HasTemporalRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasTemporalRunId() bool { + if o != nil && !IsNil(o.TemporalRunId) { + return true + } + + return false +} + +// SetTemporalRunId gets a reference to the given string and assigns it to the TemporalRunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetTemporalRunId(v string) { + o.TemporalRunId = &v +} + +// GetTemporalWorkflowId returns the TemporalWorkflowId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetTemporalWorkflowId() string { + if o == nil || IsNil(o.TemporalWorkflowId) { + var ret string + return ret + } + return *o.TemporalWorkflowId +} + +// GetTemporalWorkflowIdOk returns a tuple with the TemporalWorkflowId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) GetTemporalWorkflowIdOk() (*string, bool) { + if o == nil || IsNil(o.TemporalWorkflowId) { + return nil, false + } + return o.TemporalWorkflowId, true +} + +// HasTemporalWorkflowId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) HasTemporalWorkflowId() bool { + if o != nil && !IsNil(o.TemporalWorkflowId) { + return true + } + + return false +} + +// SetTemporalWorkflowId gets a reference to the given string and assigns it to the TemporalWorkflowId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetTemporalWorkflowId(v string) { + o.TemporalWorkflowId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Pipeline) { + toSerialize["pipeline"] = o.Pipeline + } + if !IsNil(o.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.Snapshot) { + toSerialize["snapshot"] = o.Snapshot + } + if !IsNil(o.Stages) { + toSerialize["stages"] = o.Stages + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.StatusMessage) { + toSerialize["status_message"] = o.StatusMessage + } + if !IsNil(o.TemporalRunId) { + toSerialize["temporal_run_id"] = o.TemporalRunId + } + if !IsNil(o.TemporalWorkflowId) { + toSerialize["temporal_workflow_id"] = o.TemporalWorkflowId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) 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_model_run_status.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run_status.go new file mode 100644 index 0000000..bdc1efb --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_run_status.go @@ -0,0 +1,116 @@ +/* +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" + "fmt" +) + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus the model 'GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus' +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus string + +// List of git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.RunStatus +const ( + RunStatusPending GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus = "pending" + RunStatusRunning GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus = "running" + RunStatusDone GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus = "done" + RunStatusCanceled GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus = "canceled" + RunStatusFailed GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus = "failed" +) + +// All allowed values of GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus enum +var AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusEnumValues = []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus{ + "pending", + "running", + "done", + "canceled", + "failed", +} + +func (v *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus(value) + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus", value) +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusFromValue returns a pointer to a valid GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusFromValue(v string) (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus, error) { + ev := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus: valid values are %v", v, AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) IsValid() bool { + for _, existing := range AllowedGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model.RunStatus value +func (v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) Ptr() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus { + return &v +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) 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_model_stage.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_stage.go new file mode 100644 index 0000000..c476b17 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_model_stage.go @@ -0,0 +1,341 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage struct { + CreatedAt *string `json:"created_at,omitempty"` + // ID UUID v7 + Id *string `json:"id,omitempty"` + Jobs []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob `json:"jobs,omitempty"` + Name *string `json:"name,omitempty"` + RunId *string `json:"run_id,omitempty"` + Status *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus `json:"status,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStageWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStageWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetId(v string) { + o.Id = &v +} + +// GetJobs returns the Jobs field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetJobs() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob { + if o == nil || IsNil(o.Jobs) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob + return ret + } + return o.Jobs +} + +// GetJobsOk returns a tuple with the Jobs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetJobsOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob, bool) { + if o == nil || IsNil(o.Jobs) { + return nil, false + } + return o.Jobs, true +} + +// HasJobs returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) HasJobs() bool { + if o != nil && !IsNil(o.Jobs) { + return true + } + + return false +} + +// SetJobs gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob and assigns it to the Jobs field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetJobs(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJob) { + o.Jobs = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetName(v string) { + o.Name = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetRunId(v string) { + o.RunId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetStatus() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus { + if o == nil || IsNil(o.Status) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) GetStatusOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetStatus(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelJobStatus) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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.Jobs) { + toSerialize["jobs"] = o.Jobs + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) 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_application_create.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_create.go new file mode 100644 index 0000000..cd1b7ef --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_create.go @@ -0,0 +1,300 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate struct { + Branch string `json:"branch"` + Name *string `json:"name,omitempty"` + RepositoryId *string `json:"repository_id,omitempty"` + RepositoryUrl *string `json:"repository_url,omitempty"` + SpaceId *string `json:"space_id,omitempty"` +} + +type _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate(branch string) *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate{} + this.Branch = branch + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate{} + return &this +} + +// GetBranch returns the Branch field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetBranch() string { + if o == nil { + var ret string + return ret + } + + return o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetBranchOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Branch, true +} + +// SetBranch sets field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) SetBranch(v string) { + o.Branch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) SetName(v string) { + o.Name = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetRepositoryUrl() string { + if o == nil || IsNil(o.RepositoryUrl) { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) GetRepositoryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryUrl) { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) HasRepositoryUrl() bool { + if o != nil && !IsNil(o.RepositoryUrl) { + return true + } + + return false +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) SetSpaceId(v string) { + o.SpaceId = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["branch"] = o.Branch + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + if !IsNil(o.RepositoryUrl) { + toSerialize["repository_url"] = o.RepositoryUrl + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + return toSerialize, nil +} + +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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{ + "branch", + } + + 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) + } + } + + varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate := _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) + + if err != nil { + return err + } + + *o = GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate(varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) + + return err +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationCreate) 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_application_update.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_update.go new file mode 100644 index 0000000..174a08d --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_application_update.go @@ -0,0 +1,220 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate struct { + Branch string `json:"branch"` + Name *string `json:"name,omitempty"` + SpaceId string `json:"space_id"` +} + +type _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate(branch string, spaceId string) *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate{} + this.Branch = branch + this.SpaceId = spaceId + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate{} + return &this +} + +// GetBranch returns the Branch field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) GetBranch() string { + if o == nil { + var ret string + return ret + } + + return o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) GetBranchOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Branch, true +} + +// SetBranch sets field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) SetBranch(v string) { + o.Branch = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) SetName(v string) { + o.Name = &v +} + +// GetSpaceId returns the SpaceId field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) GetSpaceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SpaceId, true +} + +// SetSpaceId sets field value +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) SetSpaceId(v string) { + o.SpaceId = v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["branch"] = o.Branch + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["space_id"] = o.SpaceId + return toSerialize, nil +} + +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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{ + "branch", + "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) + } + } + + varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate := _GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) + + if err != nil { + return err + } + + *o = GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate(varGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) + + return err +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestApplicationUpdate) 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_job_log_list.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_job_log_list.go new file mode 100644 index 0000000..b42621c --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_request_job_log_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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList struct { + BeforeTime *string `json:"before_time,omitempty"` + Limit *int `json:"limit,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogListWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogListWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList{} + return &this +} + +// GetBeforeTime returns the BeforeTime field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) GetBeforeTime() string { + if o == nil || IsNil(o.BeforeTime) { + var ret string + return ret + } + return *o.BeforeTime +} + +// GetBeforeTimeOk returns a tuple with the BeforeTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) GetBeforeTimeOk() (*string, bool) { + if o == nil || IsNil(o.BeforeTime) { + return nil, false + } + return o.BeforeTime, true +} + +// HasBeforeTime returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) HasBeforeTime() bool { + if o != nil && !IsNil(o.BeforeTime) { + return true + } + + return false +} + +// SetBeforeTime gets a reference to the given string and assigns it to the BeforeTime field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) SetBeforeTime(v string) { + o.BeforeTime = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) GetLimit() int { + if o == nil || IsNil(o.Limit) { + var ret int + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) GetLimitOk() (*int, bool) { + if o == nil || IsNil(o.Limit) { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) HasLimit() bool { + if o != nil && !IsNil(o.Limit) { + return true + } + + return false +} + +// SetLimit gets a reference to the given int and assigns it to the Limit field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) SetLimit(v int) { + o.Limit = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BeforeTime) { + toSerialize["before_time"] = o.BeforeTime + } + if !IsNil(o.Limit) { + toSerialize["limit"] = o.Limit + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationRequestJobLogList) 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_application_create.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_create.go new file mode 100644 index 0000000..59e1f70 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_create.go @@ -0,0 +1,592 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + RepositoryId *string `json:"repository_id,omitempty"` + RepositoryUrl *string `json:"repository_url,omitempty"` + Run *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun `json:"run,omitempty"` + RunId *string `json:"run_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + Status *string `json:"status,omitempty"` + TemplateId *string `json:"template_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetBranch(v string) { + o.Branch = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetName(v string) { + o.Name = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRepositoryUrl() string { + if o == nil || IsNil(o.RepositoryUrl) { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRepositoryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryUrl) { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasRepositoryUrl() bool { + if o != nil && !IsNil(o.RepositoryUrl) { + return true + } + + return false +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// GetRun returns the Run field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRun() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + if o == nil || IsNil(o.Run) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + return ret + } + return *o.Run +} + +// GetRunOk returns a tuple with the Run field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRunOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun, bool) { + if o == nil || IsNil(o.Run) { + return nil, false + } + return o.Run, true +} + +// HasRun returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasRun() bool { + if o != nil && !IsNil(o.Run) { + return true + } + + return false +} + +// SetRun gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun and assigns it to the Run field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetRun(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + o.Run = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetRunId(v string) { + o.RunId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetStatus(v string) { + o.Status = &v +} + +// GetTemplateId returns the TemplateId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetTemplateId() string { + if o == nil || IsNil(o.TemplateId) { + var ret string + return ret + } + return *o.TemplateId +} + +// GetTemplateIdOk returns a tuple with the TemplateId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) GetTemplateIdOk() (*string, bool) { + if o == nil || IsNil(o.TemplateId) { + return nil, false + } + return o.TemplateId, true +} + +// HasTemplateId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) HasTemplateId() bool { + if o != nil && !IsNil(o.TemplateId) { + return true + } + + return false +} + +// SetTemplateId gets a reference to the given string and assigns it to the TemplateId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetTemplateId(v string) { + o.TemplateId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + 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.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + if !IsNil(o.RepositoryUrl) { + toSerialize["repository_url"] = o.RepositoryUrl + } + if !IsNil(o.Run) { + toSerialize["run"] = o.Run + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TemplateId) { + toSerialize["template_id"] = o.TemplateId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationCreate) 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_application_get.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_get.go new file mode 100644 index 0000000..76596fa --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_get.go @@ -0,0 +1,592 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + RepositoryId *string `json:"repository_id,omitempty"` + RepositoryUrl *string `json:"repository_url,omitempty"` + Run *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun `json:"run,omitempty"` + RunId *string `json:"run_id,omitempty"` + SpaceId *string `json:"space_id,omitempty"` + Status *string `json:"status,omitempty"` + TemplateId *string `json:"template_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGetWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGetWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetBranch(v string) { + o.Branch = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetName(v string) { + o.Name = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetRepositoryId returns the RepositoryId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRepositoryId() string { + if o == nil || IsNil(o.RepositoryId) { + var ret string + return ret + } + return *o.RepositoryId +} + +// GetRepositoryIdOk returns a tuple with the RepositoryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRepositoryIdOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryId) { + return nil, false + } + return o.RepositoryId, true +} + +// HasRepositoryId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasRepositoryId() bool { + if o != nil && !IsNil(o.RepositoryId) { + return true + } + + return false +} + +// SetRepositoryId gets a reference to the given string and assigns it to the RepositoryId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetRepositoryId(v string) { + o.RepositoryId = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRepositoryUrl() string { + if o == nil || IsNil(o.RepositoryUrl) { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRepositoryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryUrl) { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasRepositoryUrl() bool { + if o != nil && !IsNil(o.RepositoryUrl) { + return true + } + + return false +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// GetRun returns the Run field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRun() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + if o == nil || IsNil(o.Run) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + return ret + } + return *o.Run +} + +// GetRunOk returns a tuple with the Run field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRunOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun, bool) { + if o == nil || IsNil(o.Run) { + return nil, false + } + return o.Run, true +} + +// HasRun returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasRun() bool { + if o != nil && !IsNil(o.Run) { + return true + } + + return false +} + +// SetRun gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun and assigns it to the Run field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetRun(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + o.Run = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetRunId(v string) { + o.RunId = &v +} + +// GetSpaceId returns the SpaceId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetSpaceId(v string) { + o.SpaceId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetStatus(v string) { + o.Status = &v +} + +// GetTemplateId returns the TemplateId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetTemplateId() string { + if o == nil || IsNil(o.TemplateId) { + var ret string + return ret + } + return *o.TemplateId +} + +// GetTemplateIdOk returns a tuple with the TemplateId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) GetTemplateIdOk() (*string, bool) { + if o == nil || IsNil(o.TemplateId) { + return nil, false + } + return o.TemplateId, true +} + +// HasTemplateId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) HasTemplateId() bool { + if o != nil && !IsNil(o.TemplateId) { + return true + } + + return false +} + +// SetTemplateId gets a reference to the given string and assigns it to the TemplateId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetTemplateId(v string) { + o.TemplateId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + 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.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.RepositoryId) { + toSerialize["repository_id"] = o.RepositoryId + } + if !IsNil(o.RepositoryUrl) { + toSerialize["repository_url"] = o.RepositoryUrl + } + if !IsNil(o.Run) { + toSerialize["run"] = o.Run + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.SpaceId) { + toSerialize["space_id"] = o.SpaceId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TemplateId) { + toSerialize["template_id"] = o.TemplateId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationGet) 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_application_list.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_list.go new file mode 100644 index 0000000..d67e7b7 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_application_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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList struct { + Applications []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication `json:"applications,omitempty"` + Total *int `json:"total,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationListWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationListWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList{} + return &this +} + +// GetApplications returns the Applications field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) GetApplications() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + if o == nil || IsNil(o.Applications) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication + return ret + } + return o.Applications +} + +// GetApplicationsOk returns a tuple with the Applications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) GetApplicationsOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication, bool) { + if o == nil || IsNil(o.Applications) { + return nil, false + } + return o.Applications, true +} + +// HasApplications returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) HasApplications() bool { + if o != nil && !IsNil(o.Applications) { + return true + } + + return false +} + +// SetApplications gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication and assigns it to the Applications field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) SetApplications(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) { + o.Applications = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) SetTotal(v int) { + o.Total = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Applications) { + toSerialize["applications"] = o.Applications + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseApplicationList) 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_deployment_create.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_create.go new file mode 100644 index 0000000..5035358 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_create.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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate struct { + Deployment *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment `json:"deployment,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreateWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreateWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate{} + return &this +} + +// GetDeployment returns the Deployment field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) GetDeployment() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment { + if o == nil || IsNil(o.Deployment) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment + return ret + } + return *o.Deployment +} + +// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) GetDeploymentOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment, bool) { + if o == nil || IsNil(o.Deployment) { + return nil, false + } + return o.Deployment, true +} + +// HasDeployment returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) HasDeployment() bool { + if o != nil && !IsNil(o.Deployment) { + return true + } + + return false +} + +// SetDeployment gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment and assigns it to the Deployment field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) SetDeployment(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelDeployment) { + o.Deployment = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Deployment) { + toSerialize["deployment"] = o.Deployment + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentCreate) 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_deployment_list.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_list.go new file mode 100644 index 0000000..4126491 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList struct { + Deployments []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse `json:"deployments,omitempty"` + Total *int `json:"total,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentListWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentListWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList{} + return &this +} + +// GetDeployments returns the Deployments field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) GetDeployments() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse { + if o == nil || IsNil(o.Deployments) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse + return ret + } + return o.Deployments +} + +// GetDeploymentsOk returns a tuple with the Deployments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) GetDeploymentsOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse, bool) { + if o == nil || IsNil(o.Deployments) { + return nil, false + } + return o.Deployments, true +} + +// HasDeployments returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) HasDeployments() bool { + if o != nil && !IsNil(o.Deployments) { + return true + } + + return false +} + +// SetDeployments gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse and assigns it to the Deployments field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) SetDeployments(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) { + o.Deployments = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) SetTotal(v int) { + o.Total = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Deployments) { + toSerialize["deployments"] = o.Deployments + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentList) 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_deployment_response.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_response.go new file mode 100644 index 0000000..6bdb87e --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_deployment_response.go @@ -0,0 +1,376 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse struct { + Application *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication `json:"application,omitempty"` + ApplicationId *string `json:"application_id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Run *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun `json:"run,omitempty"` + RunId *string `json:"run_id,omitempty"` + ShortName *string `json:"short_name,omitempty"` + Url *string `json:"url,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponseWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponseWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse{} + return &this +} + +// GetApplication returns the Application field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetApplication() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication { + if o == nil || IsNil(o.Application) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication + return ret + } + return *o.Application +} + +// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetApplicationOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication, bool) { + if o == nil || IsNil(o.Application) { + return nil, false + } + return o.Application, true +} + +// HasApplication returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasApplication() bool { + if o != nil && !IsNil(o.Application) { + return true + } + + return false +} + +// SetApplication gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication and assigns it to the Application field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetApplication(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelApplication) { + o.Application = &v +} + +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetApplicationId() string { + if o == nil || IsNil(o.ApplicationId) { + var ret string + return ret + } + return *o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetApplicationIdOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationId) { + return nil, false + } + return o.ApplicationId, true +} + +// HasApplicationId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasApplicationId() bool { + if o != nil && !IsNil(o.ApplicationId) { + return true + } + + return false +} + +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetApplicationId(v string) { + o.ApplicationId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetId(v string) { + o.Id = &v +} + +// GetRun returns the Run field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetRun() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun { + if o == nil || IsNil(o.Run) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun + return ret + } + return *o.Run +} + +// GetRunOk returns a tuple with the Run field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetRunOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun, bool) { + if o == nil || IsNil(o.Run) { + return nil, false + } + return o.Run, true +} + +// HasRun returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasRun() bool { + if o != nil && !IsNil(o.Run) { + return true + } + + return false +} + +// SetRun gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun and assigns it to the Run field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetRun(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRun) { + o.Run = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetRunId(v string) { + o.RunId = &v +} + +// GetShortName returns the ShortName field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetShortName() string { + if o == nil || IsNil(o.ShortName) { + var ret string + return ret + } + return *o.ShortName +} + +// GetShortNameOk returns a tuple with the ShortName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetShortNameOk() (*string, bool) { + if o == nil || IsNil(o.ShortName) { + return nil, false + } + return o.ShortName, true +} + +// HasShortName returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasShortName() bool { + if o != nil && !IsNil(o.ShortName) { + return true + } + + return false +} + +// SetShortName gets a reference to the given string and assigns it to the ShortName field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetShortName(v string) { + o.ShortName = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) SetUrl(v string) { + o.Url = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Application) { + toSerialize["application"] = o.Application + } + if !IsNil(o.ApplicationId) { + toSerialize["application_id"] = o.ApplicationId + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Run) { + toSerialize["run"] = o.Run + } + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId + } + if !IsNil(o.ShortName) { + toSerialize["short_name"] = o.ShortName + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseDeploymentResponse) 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_job_log_list.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_log_list.go new file mode 100644 index 0000000..b85ac4e --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_log_list.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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList struct { + Logs []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs `json:"logs,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogListWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogListWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList{} + return &this +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) GetLogs() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs { + if o == nil || IsNil(o.Logs) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) GetLogsOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs and assigns it to the Logs field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) SetLogs(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) { + o.Logs = v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogList) 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_job_logs.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_logs.go new file mode 100644 index 0000000..fe31ae8 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_job_logs.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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs struct { + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogsWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogsWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) SetMessage(v string) { + o.Message = &v +} + +// GetTime returns the Time field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) GetTime() string { + if o == nil || IsNil(o.Time) { + var ret string + return ret + } + return *o.Time +} + +// GetTimeOk returns a tuple with the Time field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) GetTimeOk() (*string, bool) { + if o == nil || IsNil(o.Time) { + return nil, false + } + return o.Time, true +} + +// HasTime returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) HasTime() bool { + if o != nil && !IsNil(o.Time) { + return true + } + + return false +} + +// SetTime gets a reference to the given string and assigns it to the Time field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) SetTime(v string) { + o.Time = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Time) { + toSerialize["time"] = o.Time + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseJobLogs) 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_pipeline_run.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_pipeline_run.go new file mode 100644 index 0000000..ad3be1f --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_pipeline_run.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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun struct { + Id *string `json:"id,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRunWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRunWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) SetId(v string) { + o.Id = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponsePipelineRun) 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_run_get.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_run_get.go new file mode 100644 index 0000000..20e2b6e --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_application_response_run_get.go @@ -0,0 +1,521 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet struct for GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet +type GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Pipeline *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline `json:"pipeline,omitempty"` + PipelineId *string `json:"pipeline_id,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + Stages []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage `json:"stages,omitempty"` + Status *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus `json:"status,omitempty"` + StatusMessage *string `json:"status_message,omitempty"` + // TODO: Should we save this? + TemporalRunId *string `json:"temporal_run_id,omitempty"` + TemporalWorkflowId *string `json:"temporal_workflow_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGetWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGetWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetBranch() string { + if o == nil || IsNil(o.Branch) { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetBranchOk() (*string, bool) { + if o == nil || IsNil(o.Branch) { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasBranch() bool { + if o != nil && !IsNil(o.Branch) { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetBranch(v string) { + o.Branch = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetId(v string) { + o.Id = &v +} + +// GetPipeline returns the Pipeline field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetPipeline() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline { + if o == nil || IsNil(o.Pipeline) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline + return ret + } + return *o.Pipeline +} + +// GetPipelineOk returns a tuple with the Pipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetPipelineOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline, bool) { + if o == nil || IsNil(o.Pipeline) { + return nil, false + } + return o.Pipeline, true +} + +// HasPipeline returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasPipeline() bool { + if o != nil && !IsNil(o.Pipeline) { + return true + } + + return false +} + +// SetPipeline gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline and assigns it to the Pipeline field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetPipeline(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelPipeline) { + o.Pipeline = &v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetPipelineId() string { + if o == nil || IsNil(o.PipelineId) { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetPipelineIdOk() (*string, bool) { + if o == nil || IsNil(o.PipelineId) { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasPipelineId() bool { + if o != nil && !IsNil(o.PipelineId) { + return true + } + + return false +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetSnapshot returns the Snapshot field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetSnapshot() string { + if o == nil || IsNil(o.Snapshot) { + var ret string + return ret + } + return *o.Snapshot +} + +// GetSnapshotOk returns a tuple with the Snapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetSnapshotOk() (*string, bool) { + if o == nil || IsNil(o.Snapshot) { + return nil, false + } + return o.Snapshot, true +} + +// HasSnapshot returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasSnapshot() bool { + if o != nil && !IsNil(o.Snapshot) { + return true + } + + return false +} + +// SetSnapshot gets a reference to the given string and assigns it to the Snapshot field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetSnapshot(v string) { + o.Snapshot = &v +} + +// GetStages returns the Stages field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStages() []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage { + if o == nil || IsNil(o.Stages) { + var ret []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage + return ret + } + return o.Stages +} + +// GetStagesOk returns a tuple with the Stages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStagesOk() ([]GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage, bool) { + if o == nil || IsNil(o.Stages) { + return nil, false + } + return o.Stages, true +} + +// HasStages returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasStages() bool { + if o != nil && !IsNil(o.Stages) { + return true + } + + return false +} + +// SetStages gets a reference to the given []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage and assigns it to the Stages field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetStages(v []GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelStage) { + o.Stages = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStatus() GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus { + if o == nil || IsNil(o.Status) { + var ret GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStatusOk() (*GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus and assigns it to the Status field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetStatus(v GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationModelRunStatus) { + o.Status = &v +} + +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStatusMessage() string { + if o == nil || IsNil(o.StatusMessage) { + var ret string + return ret + } + return *o.StatusMessage +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetStatusMessageOk() (*string, bool) { + if o == nil || IsNil(o.StatusMessage) { + return nil, false + } + return o.StatusMessage, true +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasStatusMessage() bool { + if o != nil && !IsNil(o.StatusMessage) { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetStatusMessage(v string) { + o.StatusMessage = &v +} + +// GetTemporalRunId returns the TemporalRunId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetTemporalRunId() string { + if o == nil || IsNil(o.TemporalRunId) { + var ret string + return ret + } + return *o.TemporalRunId +} + +// GetTemporalRunIdOk returns a tuple with the TemporalRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetTemporalRunIdOk() (*string, bool) { + if o == nil || IsNil(o.TemporalRunId) { + return nil, false + } + return o.TemporalRunId, true +} + +// HasTemporalRunId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasTemporalRunId() bool { + if o != nil && !IsNil(o.TemporalRunId) { + return true + } + + return false +} + +// SetTemporalRunId gets a reference to the given string and assigns it to the TemporalRunId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetTemporalRunId(v string) { + o.TemporalRunId = &v +} + +// GetTemporalWorkflowId returns the TemporalWorkflowId field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetTemporalWorkflowId() string { + if o == nil || IsNil(o.TemporalWorkflowId) { + var ret string + return ret + } + return *o.TemporalWorkflowId +} + +// GetTemporalWorkflowIdOk returns a tuple with the TemporalWorkflowId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) GetTemporalWorkflowIdOk() (*string, bool) { + if o == nil || IsNil(o.TemporalWorkflowId) { + return nil, false + } + return o.TemporalWorkflowId, true +} + +// HasTemporalWorkflowId returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) HasTemporalWorkflowId() bool { + if o != nil && !IsNil(o.TemporalWorkflowId) { + return true + } + + return false +} + +// SetTemporalWorkflowId gets a reference to the given string and assigns it to the TemporalWorkflowId field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetTemporalWorkflowId(v string) { + o.TemporalWorkflowId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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 *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Branch) { + toSerialize["branch"] = o.Branch + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Pipeline) { + toSerialize["pipeline"] = o.Pipeline + } + if !IsNil(o.PipelineId) { + toSerialize["pipeline_id"] = o.PipelineId + } + if !IsNil(o.Snapshot) { + toSerialize["snapshot"] = o.Snapshot + } + if !IsNil(o.Stages) { + toSerialize["stages"] = o.Stages + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.StatusMessage) { + toSerialize["status_message"] = o.StatusMessage + } + if !IsNil(o.TemporalRunId) { + toSerialize["temporal_run_id"] = o.TemporalRunId + } + if !IsNil(o.TemporalWorkflowId) { + toSerialize["temporal_workflow_id"] = o.TemporalWorkflowId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet(val *GitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalApplicationResponseRunGet) 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_errors_bad_request.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_bad_request.go new file mode 100644 index 0000000..749f054 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_bad_request.go @@ -0,0 +1,162 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest struct for GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest +type GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest struct { + // Args contains arguments for message + Arguments map[string]map[string]interface{} `json:"arguments,omitempty"` + // Message is text that can be displayed to the user. It should not contain any specific background information about protocols, databases, programming languages, etc. + Message *string `json:"message,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequestWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequestWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest{} + return &this +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) GetArguments() map[string]map[string]interface{} { + if o == nil || IsNil(o.Arguments) { + var ret map[string]map[string]interface{} + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) GetArgumentsOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Arguments) { + return map[string]map[string]interface{}{}, false + } + return o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) HasArguments() bool { + if o != nil && !IsNil(o.Arguments) { + return true + } + + return false +} + +// SetArguments gets a reference to the given map[string]map[string]interface{} and assigns it to the Arguments field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) SetArguments(v map[string]map[string]interface{}) { + o.Arguments = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) SetMessage(v string) { + o.Message = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Arguments) { + toSerialize["arguments"] = o.Arguments + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsBadRequest) 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_errors_conflict.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_conflict.go new file mode 100644 index 0000000..d5fa916 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_conflict.go @@ -0,0 +1,125 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict struct for GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict +type GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict struct { + // Message is text that can be displayed to the user. It should not contain any specific background information about protocols, databases, programming languages, etc. + Message *string `json:"message,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflictWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflictWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) SetMessage(v string) { + o.Message = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsConflict) 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_errors_internal.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_internal.go new file mode 100644 index 0000000..71915eb --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_internal.go @@ -0,0 +1,125 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal struct for GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal +type GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal struct { + // Message is text that can be displayed to the user. It should not contain any specific background information about protocols, databases, programming languages, etc. + Message *string `json:"message,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternalWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternalWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) SetMessage(v string) { + o.Message = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsInternal) 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_errors_not_found.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_not_found.go new file mode 100644 index 0000000..94f3648 --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_not_found.go @@ -0,0 +1,125 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound struct for GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound +type GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound struct { + // Message is text that can be displayed to the user. It should not contain any specific background information about protocols, databases, programming languages, etc. + Message *string `json:"message,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFoundWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFoundWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) SetMessage(v string) { + o.Message = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsNotFound) 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_errors_unauthorized.go b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_unauthorized.go new file mode 100644 index 0000000..80d46cb --- /dev/null +++ b/internal/workflow_client/model_git_sbercloud_tech_dsworks_services_pipeline_src_internal_errors_unauthorized.go @@ -0,0 +1,125 @@ +/* +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 GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized{} + +// GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized struct for GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized +type GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized struct { + // Message is text that can be displayed to the user. It should not contain any specific background information about protocols, databases, programming languages, etc. + Message *string `json:"message,omitempty"` +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized{} + return &this +} + +// NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorizedWithDefaults instantiates a new GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized 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 NewGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorizedWithDefaults() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized { + this := GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) SetMessage(v string) { + o.Message = &v +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized struct { + value *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized + isSet bool +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) Get() *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized { + return v.value +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) Set(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) { + v.value = val + v.isSet = true +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) IsSet() bool { + return v.isSet +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized(val *GitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized { + return &NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized{value: val, isSet: true} +} + +func (v NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGitSbercloudTechDsworksServicesPipelineSrcInternalErrorsUnauthorized) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/workflow_client/response.go b/internal/workflow_client/response.go new file mode 100644 index 0000000..1cd9f29 --- /dev/null +++ b/internal/workflow_client/response.go @@ -0,0 +1,47 @@ +/* +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 ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/internal/workflow_client/utils.go b/internal/workflow_client/utils.go new file mode 100644 index 0000000..3f86f38 --- /dev/null +++ b/internal/workflow_client/utils.go @@ -0,0 +1,361 @@ +/* +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" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/skill/SKILL.md b/skill/SKILL.md index a6d5479..083a7b2 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -49,27 +49,27 @@ Every command supports `--json` for machine-readable output. When the output is piped to another command, JSON is selected automatically. Errors go to stderr and the process exits non-zero. -| Command | Purpose | -| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `eds version` | Print the installed CLI version | -| `eds config` | Print effective configuration | -| `eds repo list [--search S] [--sort name_asc\|name_desc\|updated_at_asc\|updated_at_desc] [--limit N] [--offset N] [--json]` | List repositories in the configured project | -| `eds repo create [--description "..."] [--visibility private\|shadow] [--json]` | Create a new git repository | -| `eds repo show [--json]` | Show details: id, default_branch, size, clone URLs | -| `eds repo delete [--force] [--json]` | Delete (irreversible; requires confirmation unless `--force`) | -| `eds repo clone [dir] [--ssh] [--target DIR]` | Clone via local `git` CLI | -| `eds wf app create --repository R\|--repository-url URL --branch B [--json]` | Create a Workflow Studio application from a repo + branch | -| `eds wf app list [--search S] [--sort created_at_asc\|created_at_desc] [--json]` | List applications | -| `eds wf app show [--json]` | Show application details (status, run_id, pipeline_id, ...) | -| `eds wf app update --branch B [--name N] [--json]` | Update an application's name/branch | -| `eds wf app delete [--force] [--json]` | Delete an application and its deployments (irreversible) | -| `eds wf app deploy [--json]` | Run the pipeline and publish (the "deploy" action) | -| `eds wf app deployments [--json]` | List publish history for an application | -| `eds wf app status [--json]` | Convenience: run status + stage/job breakdown + live URL | -| `eds wf run show [--json]` / `eds wf run list [--pipeline-id ID] [--json]` / `eds wf run stop ` | Inspect/control a pipeline run | -| `eds wf job show [--json]` / `eds wf job list --run-id ID [--json]` / `eds wf job logs ` / `eds wf job retry\|stop ` | Inspect/control a job (logs streams to stdout) | -| `eds login --repo-api-key --project [--repo-api-url URL]` / `eds login --wf-key-id --wf-secret --project ` | Persist credentials (one-time setup; two independent credential pairs) | -| `eds repo * --repo-use-wf-auth` (or `EDS_REPO_USE_WF_AUTH=1`) | TEMPORARY: authenticate Repo calls with the Workflow Studio Bearer token instead of `X-API-KEY`, for environments where the Repo API key isn't accepted yet | +| Command | Purpose | +|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `eds version` | Print the installed CLI version | +| `eds config` | Print effective configuration | +| `eds repo list [--search S] [--sort name_asc\|name_desc\|updated_at_asc\|updated_at_desc] [--limit N] [--offset N] [--json]` | List repositories in the configured project | +| `eds repo create [--description "..."] [--visibility private\|shadow] [--json]` | Create a new git repository | +| `eds repo show [--json]` | Show details: id, default_branch, size, clone URLs | +| `eds repo delete [--force] [--json]` | Delete (irreversible; requires confirmation unless `--force`) | +| `eds repo clone [dir] [--ssh] [--target DIR]` | Clone via local `git` CLI | +| `eds wf app create --repository R\|--repository-url URL --branch B [--json]` | Create a Workflow Studio application from a repo + branch | +| `eds wf app list [--search S] [--sort created_at_asc\|created_at_desc] [--json]` | List applications | +| `eds wf app show [--json]` | Show application details (status, run_id, pipeline_id, ...) | +| `eds wf app update --branch B [--name N] [--json]` | Update an application's name/branch | +| `eds wf app delete [--force] [--json]` | Delete an application and its deployments (irreversible) | +| `eds wf app deploy [--json]` | Run the pipeline and publish (the "deploy" action) | +| `eds wf app deployments [--json]` | List publish history for an application | +| `eds wf app status [--json]` | Convenience: run status + stage/job breakdown + live URL | +| `eds wf run show [--json]` / `eds wf run list [--pipeline-id ID] [--json]` / `eds wf run stop ` | Inspect/control a pipeline run | +| `eds wf job show [--json]` / `eds wf job list --run-id ID [--json]` / `eds wf job logs ` / `eds wf job retry\|stop ` | Inspect/control a job | +| `eds login --repo-api-key --project [--repo-api-url URL]` / `eds login --wf-key-id --wf-secret --project ` | Persist credentials (one-time setup; two independent credential pairs) | +| `eds repo * --repo-use-wf-auth` (or `EDS_REPO_USE_WF_AUTH=1`) | TEMPORARY: authenticate Repo calls with the Workflow Studio Bearer token instead of `X-API-KEY`, for environments where the Repo API key isn't accepted yet | The `` argument on `eds repo *` and `--repository` on `eds wf app create` are resolved automatically: UUIDs are used as-is, names