From 496b60ba44ee78c06af8c5a308b108d1440a8a28 Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Wed, 24 Aug 2022 23:25:25 +0200 Subject: [PATCH] Add support for lookaside rpm import, introduce CLI and machine-to-machine callers support Signed-off-by: Mustafa Gezen --- WORKSPACE | 8 +- go.mod | 6 +- go.sum | 1 + initdb/main.go | 5 + obsidian/impl/v1/oauth2.go | 3 + peridot/builder/v1/workflow/BUILD.bazel | 1 + peridot/builder/v1/workflow/build.go | 4 +- peridot/builder/v1/workflow/infrastructure.go | 55 +- peridot/builder/v1/workflow/lookaside.go | 128 ++ peridot/builder/v1/workflow/rpmimport.go | 222 ++- peridot/builder/v1/workflow/workflow.go | 3 +- peridot/cmd/v1/peridot/BUILD.bazel | 33 + peridot/cmd/v1/peridot/build.go | 37 + peridot/cmd/v1/peridot/build_rpm_import.go | 159 ++ peridot/cmd/v1/peridot/lookaside.go | 37 + peridot/cmd/v1/peridot/lookaside_upload.go | 65 + peridot/cmd/v1/peridot/main.go | 106 ++ peridot/cmd/v1/peridot/utils.go | 126 ++ peridot/cmd/v1/peridotbuilder/main.go | 19 +- peridot/cmd/v1/peridotephemeral/main.go | 2 + peridot/db/db.go | 2 +- peridot/db/psql/task.go | 4 +- peridot/impl/v1/BUILD.bazel | 1 + peridot/impl/v1/build.go | 74 + peridot/impl/v1/project.go | 68 +- peridot/impl/v1/server.go | 22 +- peridot/impl/v1/task.go | 46 +- ...make_project_id_optional_in_tasks.down.sql | 1 + ...5_make_project_id_optional_in_tasks.up.sql | 1 + peridot/proto/v1/BUILD.bazel | 12 + peridot/proto/v1/build.proto | 37 +- peridot/proto/v1/package.proto | 2 +- peridot/proto/v1/project.proto | 14 + peridot/proto/v1/task.proto | 4 +- secparse/admin/impl/server.go | 2 +- utils/BUILD.bazel | 1 + utils/interceptors.go | 29 +- utils/pointer.go | 12 + utils/slice.go | 11 + .../x/oauth2/clientcredentials/BUILD.bazel | 13 + .../clientcredentials/clientcredentials.go | 120 ++ vendor/modules.txt | 5 + .../peridotopenapi/.gitignore | 24 + .../peridotopenapi/.openapi-generator-ignore | 23 + .../peridotopenapi/.travis.yml | 8 + .../peridotopenapi/BUILD.bazel | 82 + .../peridotopenapi/README.md | 205 +++ .../peridotopenapi/api_build_service.go | 1153 +++++++++++++ .../peridotopenapi/api_import_service.go | 1004 +++++++++++ .../peridotopenapi/api_package_service.go | 357 ++++ .../peridotopenapi/api_project_service.go | 1483 +++++++++++++++++ .../peridotopenapi/api_search_service.go | 161 ++ .../peridotopenapi/api_task_service.go | 574 +++++++ .../peridotopenapi/client.go | 550 ++++++ .../peridotopenapi/configuration.go | 230 +++ .../peridotopenapi/git_push.sh | 58 + .../peridotopenapi/go.mod | 7 + .../peridotopenapi/go.sum | 13 + .../peridotopenapi/model_api_http_body.go | 190 +++ ...ssage_for_import_service_import_package.go | 223 +++ .../peridotopenapi/model_inline_object.go | 115 ++ .../peridotopenapi/model_inline_object_1.go | 115 ++ .../peridotopenapi/model_inline_object_2.go | 367 ++++ .../peridotopenapi/model_inline_object_3.go | 153 ++ .../peridotopenapi/model_inline_object_4.go | 153 ++ .../peridotopenapi/model_inline_object_5.go | 151 ++ .../peridotopenapi/model_inline_object_6.go | 151 ++ .../peridotopenapi/model_inline_object_7.go | 115 ++ .../peridotopenapi/model_inline_object_8.go | 115 ++ .../peridotopenapi/model_protobuf_any.go | 116 ++ .../peridotopenapi/model_rpc_status.go | 187 +++ .../model_stream_result_of_api_http_body.go | 151 ++ ...del_stream_result_of_v1_search_response.go | 151 ++ .../peridotopenapi/model_v1_async_task.go | 187 +++ .../peridotopenapi/model_v1_batch_filter.go | 119 ++ .../peridotopenapi/model_v1_build.go | 300 ++++ .../peridotopenapi/model_v1_build_batch.go | 368 ++++ .../peridotopenapi/model_v1_build_filters.go | 119 ++ .../model_v1_create_project_request.go | 115 ++ .../model_v1_create_project_response.go | 115 ++ .../model_v1_get_build_batch_response.go | 403 +++++ .../model_v1_get_build_response.go | 115 ++ .../model_v1_get_import_batch_response.go | 403 +++++ .../model_v1_get_import_response.go | 115 ++ .../model_v1_get_package_response.go | 115 ++ ...del_v1_get_project_credentials_response.go | 115 ++ .../model_v1_get_project_response.go | 115 ++ .../model_v1_get_repository_response.go | 115 ++ .../model_v1_get_task_response.go | 115 ++ .../peridotopenapi/model_v1_import.go | 300 ++++ .../peridotopenapi/model_v1_import_batch.go | 368 ++++ ...l_v1_import_batch_retry_failed_response.go | 115 ++ .../model_v1_import_package_batch_response.go | 115 ++ .../model_v1_import_package_request.go | 260 +++ .../model_v1_import_revision.go | 331 ++++ .../model_v1_list_build_batches_response.go | 223 +++ .../model_v1_list_builds_response.go | 223 +++ .../model_v1_list_import_batches_response.go | 223 +++ .../model_v1_list_imports_response.go | 223 +++ .../model_v1_list_packages_response.go | 223 +++ .../model_v1_list_projects_response.go | 223 +++ .../model_v1_list_repositories_response.go | 115 ++ .../model_v1_list_tasks_response.go | 223 +++ .../model_v1_lookaside_file_upload_request.go | 115 ++ .../peridotopenapi/model_v1_package.go | 264 +++ .../model_v1_package_filters.go | 295 ++++ .../peridotopenapi/model_v1_package_type.go | 91 + .../peridotopenapi/model_v1_project.go | 872 ++++++++++ .../peridotopenapi/model_v1_repository.go | 477 ++++++ .../peridotopenapi/model_v1_search_request.go | 151 ++ .../model_v1_search_response.go | 115 ++ ...del_v1_set_project_credentials_response.go | 115 ++ .../model_v1_submit_build_batch_response.go | 115 ++ .../model_v1_submit_build_request.go | 404 +++++ .../peridotopenapi/model_v1_subtask.go | 520 ++++++ .../peridotopenapi/model_v1_task_status.go | 88 + .../peridotopenapi/model_v1_task_type.go | 102 ++ .../model_v1_update_project_response.go | 115 ++ .../model_v1_version_release.go | 151 ++ .../peridotopenapi/response.go | 47 + .../peridotopenapi/utils.go | 328 ++++ 121 files changed, 20269 insertions(+), 81 deletions(-) create mode 100644 peridot/builder/v1/workflow/lookaside.go create mode 100644 peridot/cmd/v1/peridot/BUILD.bazel create mode 100644 peridot/cmd/v1/peridot/build.go create mode 100644 peridot/cmd/v1/peridot/build_rpm_import.go create mode 100644 peridot/cmd/v1/peridot/lookaside.go create mode 100644 peridot/cmd/v1/peridot/lookaside_upload.go create mode 100644 peridot/cmd/v1/peridot/main.go create mode 100644 peridot/cmd/v1/peridot/utils.go create mode 100644 peridot/migrate/20220823145405_make_project_id_optional_in_tasks.down.sql create mode 100644 peridot/migrate/20220823145405_make_project_id_optional_in_tasks.up.sql create mode 100644 vendor/golang.org/x/oauth2/clientcredentials/BUILD.bazel create mode 100644 vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/.gitignore create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/.openapi-generator-ignore create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/.travis.yml create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/BUILD.bazel create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/README.md create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_build_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_import_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_package_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_project_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_search_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/api_task_service.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/client.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/configuration.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/git_push.sh create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/go.mod create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/go.sum create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_api_http_body.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_import_package_request_is_the_request_message_for_import_service_import_package.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_1.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_2.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_3.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_4.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_5.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_6.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_7.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_8.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_protobuf_any.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_rpc_status.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_api_http_body.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_v1_search_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_async_task.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_batch_filter.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_batch.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_filters.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_request.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_batch_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_batch_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_package_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_credentials_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_repository_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_task_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch_retry_failed_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_batch_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_request.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_revision.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_build_batches_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_builds_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_import_batches_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_imports_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_packages_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_projects_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_repositories_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_tasks_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_lookaside_file_upload_request.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_filters.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_type.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_project.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_repository.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_request.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_set_project_credentials_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_batch_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_request.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_subtask.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_status.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_type.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_update_project_response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_version_release.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/response.go create mode 100644 vendor/openapi.peridot.resf.org/peridotopenapi/utils.go diff --git a/WORKSPACE b/WORKSPACE index 86014a5..910a025 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -54,7 +54,7 @@ go_rules_dependencies() go_register_toolchains( nogo = "@peridot//:nogo", - version = "1.17.7", + version = "1.18.3", ) go_repository( @@ -164,10 +164,10 @@ go_repositories() # --start protoc_gen_validate-- http_archive( name = "com_envoyproxy_protoc_gen_validate", - sha256 = "51ba05210a1a2940530455e01c010daa26d504f4b14855a452716772ea39090c", - strip_prefix = "protoc-gen-validate-0.6.3", + sha256 = "4c692c62e16c168049bca2b2972b0a25222870cf53e61be30b50d761e58728bd", + strip_prefix = "protoc-gen-validate-0.6.7", urls = [ - "https://github.com/envoyproxy/protoc-gen-validate/archive/v0.6.3.tar.gz", + "https://github.com/envoyproxy/protoc-gen-validate/archive/v0.6.7.tar.gz", ], ) diff --git a/go.mod b/go.mod index e5d482d..24fe27d 100644 --- a/go.mod +++ b/go.mod @@ -55,6 +55,7 @@ require ( k8s.io/api v0.22.1 k8s.io/apimachinery v0.22.1 k8s.io/client-go v0.22.1 + openapi.peridot.resf.org/peridotopenapi v0.0.0-00010101000000-000000000000 // indirect peridot.resf.org/common v0.0.0-00010101000000-000000000000 peridot.resf.org/obsidian/pb v0.0.0-00010101000000-000000000000 peridot.resf.org/peridot/keykeeper/pb v0.0.0-00010101000000-000000000000 @@ -65,7 +66,10 @@ require ( ) // Manual replace -replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt/v4 v4.4.2 +replace ( + github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt/v4 v4.4.2 + openapi.peridot.resf.org/peridotopenapi => ./bazel-bin/peridot/proto/v1/client_go +) // sync-replace-start replace ( diff --git a/go.sum b/go.sum index e76a2a1..7fb4109 100644 --- a/go.sum +++ b/go.sum @@ -849,6 +849,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/initdb/main.go b/initdb/main.go index 6b6c475..a7a89c2 100644 --- a/initdb/main.go +++ b/initdb/main.go @@ -64,11 +64,16 @@ func init() { pf := root.PersistentFlags() pf.String("target.db", "", "target db to initialize") + pf.Bool("skip", false, "Whether to skip InitDB without removing it as an init container") utils.AddFlags(pf, cnf) } func mn(_ *cobra.Command, _ []string) { + if viper.GetBool("skip") { + os.Exit(0) + } + ctx := context.TODO() targetDB := viper.GetString("target.db") diff --git a/obsidian/impl/v1/oauth2.go b/obsidian/impl/v1/oauth2.go index 787269f..9d2bc0b 100644 --- a/obsidian/impl/v1/oauth2.go +++ b/obsidian/impl/v1/oauth2.go @@ -61,6 +61,9 @@ func callbackForwarder(callbackURL string) string { // this section contained a callback forwarder, but cannot be published // todo(mustafa): evaluate other ways to make it easier for dev if env == "dev" || env == "" { + if fwd := os.Getenv("OBSIDIAN_CALLBACK_FORWARDER"); fwd != "" { + return fmt.Sprintf("%s/%s", fwd, callbackURL) + } return callbackURL } return callbackURL diff --git a/peridot/builder/v1/workflow/BUILD.bazel b/peridot/builder/v1/workflow/BUILD.bazel index 0574514..064d8b8 100644 --- a/peridot/builder/v1/workflow/BUILD.bazel +++ b/peridot/builder/v1/workflow/BUILD.bazel @@ -8,6 +8,7 @@ go_library( "hashed_repositories.go", "import.go", "infrastructure.go", + "lookaside.go", "module.go", "rpmimport.go", "srpm.go", diff --git a/peridot/builder/v1/workflow/build.go b/peridot/builder/v1/workflow/build.go index efde007..a96fbd5 100644 --- a/peridot/builder/v1/workflow/build.go +++ b/peridot/builder/v1/workflow/build.go @@ -612,7 +612,7 @@ func (c *Controller) BuildWorkflow(ctx workflow.Context, req *peridotpb.SubmitBu return nil, err } - subtask, err := c.db.GetTask(uploadSRPMResult.Subtask.ID.String(), project.ID.String()) + subtask, err := c.db.GetTask(uploadSRPMResult.Subtask.ID.String(), utils.Pointer(project.ID.String())) if err != nil { setInternalError(errorDetails, err) return nil, err @@ -721,7 +721,7 @@ func (c *Controller) BuildWorkflow(ctx workflow.Context, req *peridotpb.SubmitBu if result.Skip { continue } - subtask, err := c.db.GetTask(result.Subtask.ID.String(), project.ID.String()) + subtask, err := c.db.GetTask(result.Subtask.ID.String(), utils.Pointer(project.ID.String())) if err != nil { ret.err = fmt.Errorf("failed to get task: %s", err) return diff --git a/peridot/builder/v1/workflow/infrastructure.go b/peridot/builder/v1/workflow/infrastructure.go index 6f1ac38..37768a7 100644 --- a/peridot/builder/v1/workflow/infrastructure.go +++ b/peridot/builder/v1/workflow/infrastructure.go @@ -54,6 +54,7 @@ import ( "peridot.resf.org/peridot/db/models" peridotpb "peridot.resf.org/peridot/pb" "peridot.resf.org/utils" + "runtime" "strings" "time" ) @@ -78,6 +79,19 @@ func archToGoArch(arch string) string { return arch } +func goArchToArch(arch string) string { + switch arch { + case "arm64": + return "aarch64" + case "ppc64le": + return "ppc64le" + case "s390x": + return "s390x" + default: + return "x86_64" + } +} + func (c *Controller) genNameWorker(buildID, purpose string) string { return strings.ReplaceAll(fmt.Sprintf("pb-%s-%s", buildID, purpose), "_", "-") } @@ -89,13 +103,20 @@ func (c *Controller) genNameWorker(buildID, purpose string) string { func (c *Controller) provisionWorker(ctx workflow.Context, req *ProvisionWorkerRequest) (string, func(), error) { queue := c.mainQueue - projects, err := c.db.ListProjects(&peridotpb.ProjectFilters{ - Id: wrapperspb.String(req.ProjectId), - }) - if err != nil { - return "", nil, fmt.Errorf("could not list projects: %v", err) + var project *models.Project + if req.ProjectId != "" { + projects, err := c.db.ListProjects(&peridotpb.ProjectFilters{ + Id: wrapperspb.String(req.ProjectId), + }) + if err != nil { + return "", nil, fmt.Errorf("could not list projects: %v", err) + } + project = &projects[0] + } else { + project = &models.Project{ + Archs: []string{goArchToArch(runtime.GOARCH)}, + } } - project := projects[0] // Normalize arch string imageArch := req.Arch @@ -149,7 +170,7 @@ func (c *Controller) provisionWorker(ctx workflow.Context, req *ProvisionWorkerR ctx = workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{ TaskQueue: queue, }) - err = workflow.ExecuteChildWorkflow(ctx, c.ProvisionWorkerWorkflow, req, queue, imageArch).Get(ctx, &podName) + err := workflow.ExecuteChildWorkflow(ctx, c.ProvisionWorkerWorkflow, req, queue, imageArch).Get(ctx, &podName) if err != nil { var applicationErr *temporal.ApplicationError if errors.As(err, &applicationErr) { @@ -181,7 +202,11 @@ func (c *Controller) provisionWorker(ctx workflow.Context, req *ProvisionWorkerR func (c *Controller) ProvisionWorkerWorkflow(ctx workflow.Context, req *ProvisionWorkerRequest, queue string, imageArch string) (string, error) { var task models.Task taskSideEffect := workflow.SideEffect(ctx, func(ctx workflow.Context) interface{} { - task, err := c.db.CreateTask(nil, "noarch", peridotpb.TaskType_TASK_TYPE_WORKER_PROVISION, &req.ProjectId, &req.TaskId) + var projectId *string + if req.ProjectId != "" { + projectId = &req.ProjectId + } + task, err := c.db.CreateTask(nil, "noarch", peridotpb.TaskType_TASK_TYPE_WORKER_PROVISION, projectId, &req.TaskId) if err != nil { return nil } @@ -192,7 +217,7 @@ func (c *Controller) ProvisionWorkerWorkflow(ctx workflow.Context, req *Provisio if err != nil { return "", err } - if !task.ProjectId.Valid { + if task.ID.String() == "" { return "", fmt.Errorf("could not create task") } @@ -234,7 +259,11 @@ func (c *Controller) ProvisionWorkerWorkflow(ctx workflow.Context, req *Provisio func (c *Controller) DestroyWorkerWorkflow(ctx workflow.Context, req *ProvisionWorkerRequest) error { var task models.Task taskSideEffect := workflow.SideEffect(ctx, func(ctx workflow.Context) interface{} { - task, err := c.db.CreateTask(nil, "noarch", peridotpb.TaskType_TASK_TYPE_WORKER_DESTROY, &req.ProjectId, &req.TaskId) + var projectId *string + if req.ProjectId != "" { + projectId = &req.ProjectId + } + task, err := c.db.CreateTask(nil, "noarch", peridotpb.TaskType_TASK_TYPE_WORKER_DESTROY, projectId, &req.TaskId) if err != nil { return nil } @@ -245,7 +274,7 @@ func (c *Controller) DestroyWorkerWorkflow(ctx workflow.Context, req *ProvisionW if err != nil { return err } - if !task.ProjectId.Valid { + if task.ID.String() == "" { return fmt.Errorf("could not create task") } @@ -570,6 +599,10 @@ func (c *Controller) CreateK8sPodActivity(ctx context.Context, req *ProvisionWor Name: "BYC_NS", Value: os.Getenv("BYC_NS"), }, + { + Name: "BYC_FORCE_NS", + Value: os.Getenv("BYC_FORCE_NS"), + }, { Name: "LOCALSTACK_ENDPOINT", Value: os.Getenv("LOCALSTACK_ENDPOINT"), diff --git a/peridot/builder/v1/workflow/lookaside.go b/peridot/builder/v1/workflow/lookaside.go new file mode 100644 index 0000000..429fb5f --- /dev/null +++ b/peridot/builder/v1/workflow/lookaside.go @@ -0,0 +1,128 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package workflow + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "go.temporal.io/sdk/activity" + "go.temporal.io/sdk/temporal" + "go.temporal.io/sdk/workflow" + "peridot.resf.org/peridot/db/models" + peridotpb "peridot.resf.org/peridot/pb" + "strings" + "time" +) + +func (c *Controller) LookasideFileUploadWorkflow(ctx workflow.Context, req *peridotpb.LookasideFileUploadRequest, task *models.Task) (*peridotpb.LookasideFileUploadTask, error) { + ret := &peridotpb.LookasideFileUploadTask{} + deferTask, errorDetails, err := c.commonCreateTask(task, ret) + defer deferTask() + if err != nil { + return nil, err + } + + task.Status = peridotpb.TaskStatus_TASK_STATUS_FAILED + + uploadTaskQueue, cleanupWorker, err := c.provisionWorker(ctx, &ProvisionWorkerRequest{ + TaskId: task.ID.String(), + ParentTaskId: task.ParentTaskId, + Purpose: "lookaside", + Arch: "noarch", + }) + if err != nil { + setInternalError(errorDetails, err) + return nil, err + } + defer cleanupWorker() + + uploadCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ + StartToCloseTimeout: time.Hour, + HeartbeatTimeout: 20 * time.Second, + TaskQueue: uploadTaskQueue, + RetryPolicy: &temporal.RetryPolicy{ + MaximumAttempts: 1, + }, + }) + err = workflow.ExecuteActivity(uploadCtx, c.LookasideFileUploadActivity, req, task.ID.String()).Get(ctx, ret) + if err != nil { + setActivityError(errorDetails, err) + return nil, err + } + + task.Status = peridotpb.TaskStatus_TASK_STATUS_SUCCEEDED + + return ret, nil +} + +func (c *Controller) LookasideFileUploadActivity(ctx context.Context, req *peridotpb.LookasideFileUploadRequest, taskID string) (*peridotpb.LookasideFileUploadTask, error) { + go func() { + for { + activity.RecordHeartbeat(ctx) + time.Sleep(4 * time.Second) + } + }() + + base64DecodedFile, err := base64.StdEncoding.DecodeString(req.File) + if err != nil { + return nil, err + } + + hasher := sha256.New() + _, err = hasher.Write(base64DecodedFile) + if err != nil { + return nil, err + } + sha256Sum := hex.EncodeToString(hasher.Sum(nil)) + + exists, err := c.storage.Exists(sha256Sum) + if err != nil { + if !strings.Contains(err.Error(), "NotFound") { + return nil, err + } + } + if exists { + return &peridotpb.LookasideFileUploadTask{ + Digest: sha256Sum, + }, nil + } + + _, err = c.storage.PutObjectBytes(sha256Sum, base64DecodedFile) + if err != nil { + return nil, err + } + + return &peridotpb.LookasideFileUploadTask{ + Digest: sha256Sum, + }, nil +} diff --git a/peridot/builder/v1/workflow/rpmimport.go b/peridot/builder/v1/workflow/rpmimport.go index 8fe8771..3988a0c 100644 --- a/peridot/builder/v1/workflow/rpmimport.go +++ b/peridot/builder/v1/workflow/rpmimport.go @@ -54,6 +54,7 @@ import ( yumrepofspb "peridot.resf.org/peridot/yumrepofs/pb" "peridot.resf.org/secparse/rpmutils" "peridot.resf.org/utils" + "strings" "time" ) @@ -61,6 +62,11 @@ type RpmImportActivityTaskStage1 struct { Build *models.Build } +type RpmImportUploadWrapper struct { + Upload *UploadActivityResult + TaskID string +} + func (c *Controller) RpmImportWorkflow(ctx workflow.Context, req *peridotpb.RpmImportRequest, task *models.Task) (*peridotpb.RpmImportTask, error) { var ret peridotpb.RpmImportTask deferTask, errorDetails, err := c.commonCreateTask(task, &ret) @@ -93,7 +99,7 @@ func (c *Controller) RpmImportWorkflow(ctx workflow.Context, req *peridotpb.RpmI MaximumAttempts: 1, }, }) - err = workflow.ExecuteActivity(importCtx, c.RpmImportActivity, req, task.ID.String()).Get(ctx, &importRes) + err = workflow.ExecuteActivity(importCtx, c.RpmImportActivity, req, task.ID.String(), false).Get(ctx, &importRes) if err != nil { setActivityError(errorDetails, err) return nil, err @@ -149,7 +155,139 @@ func (c *Controller) RpmImportWorkflow(ctx workflow.Context, req *peridotpb.RpmI return &ret, nil } -func (c *Controller) RpmImportActivity(ctx context.Context, req *peridotpb.RpmImportRequest, taskID string) (*RpmImportActivityTaskStage1, error) { +func (c *Controller) RpmLookasideBatchImportWorkflow(ctx workflow.Context, req *peridotpb.RpmLookasideBatchImportRequest, task *models.Task) (*peridotpb.RpmLookasideBatchImportTask, error) { + var ret peridotpb.RpmLookasideBatchImportTask + deferTask, errorDetails, err := c.commonCreateTask(task, &ret) + defer deferTask() + if err != nil { + return nil, err + } + + task.Status = peridotpb.TaskStatus_TASK_STATUS_FAILED + + importTaskQueue, cleanupWorker, err := c.provisionWorker(ctx, &ProvisionWorkerRequest{ + TaskId: task.ID.String(), + ParentTaskId: task.ParentTaskId, + Purpose: "batchrpmimport", + Arch: "noarch", + ProjectId: req.ProjectId, + }) + if err != nil { + setInternalError(errorDetails, err) + return nil, err + } + defer cleanupWorker() + + taskID := task.ID.String() + var importResults []*RpmImportActivityTaskStage1 + var taskIDs []string + taskIDBuildMap := map[string]*RpmImportActivityTaskStage1{} + for _, blob := range req.LookasideBlobs { + var archTask models.Task + archTaskEffect := workflow.SideEffect(ctx, func(ctx workflow.Context) interface{} { + newTask, err := c.db.CreateTask(nil, "noarch", peridotpb.TaskType_TASK_TYPE_RPM_IMPORT, &req.ProjectId, &taskID) + if err != nil { + return &models.Task{} + } + + _ = c.db.SetTaskStatus(newTask.ID.String(), peridotpb.TaskStatus_TASK_STATUS_RUNNING) + return newTask + }) + err := archTaskEffect.Get(&archTask) + if err != nil || !archTask.ProjectId.Valid { + return nil, fmt.Errorf("failed to create rpm task: %s", err) + } + taskIDs = append(taskIDs, archTask.ID.String()) + + var importRes RpmImportActivityTaskStage1 + importCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ + StartToCloseTimeout: time.Hour, + HeartbeatTimeout: 20 * time.Second, + TaskQueue: importTaskQueue, + RetryPolicy: &temporal.RetryPolicy{ + MaximumAttempts: 1, + }, + }) + blobReq := &peridotpb.RpmImportRequest{ + ProjectId: req.ProjectId, + Rpms: blob, + ForceOverride: req.ForceOverride, + } + err = workflow.ExecuteActivity(importCtx, c.RpmImportActivity, blobReq, archTask.ID.String(), true).Get(ctx, &importRes) + if err != nil { + setActivityError(errorDetails, err) + return nil, err + } + importResults = append(importResults, &importRes) + taskIDBuildMap[archTask.ID.String()] = &importRes + } + + var res []*RpmImportUploadWrapper + for _, importTaskID := range taskIDs { + uploadArchCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ + ScheduleToStartTimeout: 12 * time.Hour, + StartToCloseTimeout: 24 * time.Hour, + HeartbeatTimeout: 2 * time.Minute, + TaskQueue: importTaskQueue, + }) + + var interimRes []*UploadActivityResult + err = workflow.ExecuteActivity(uploadArchCtx, c.UploadArchActivity, req.ProjectId, importTaskID).Get(ctx, &interimRes) + if err != nil { + setActivityError(errorDetails, err) + return nil, err + } + for _, ires := range interimRes { + res = append(res, &RpmImportUploadWrapper{ + Upload: ires, + TaskID: importTaskID, + }) + } + } + + for _, result := range res { + stage1 := taskIDBuildMap[result.TaskID] + if stage1 == nil { + return nil, fmt.Errorf("failed to find task %s", result.TaskID) + } + err = c.db.AttachTaskToBuild(stage1.Build.ID.String(), result.Upload.Subtask.ID.String()) + if err != nil { + err = status.Errorf(codes.Internal, "could not attach task to build: %v", err) + setInternalError(errorDetails, err) + return nil, err + } + if result.Upload.Skip { + continue + } + } + + yumrepoCtx := workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{ + TaskQueue: "yumrepofs", + }) + updateRepoRequest := &UpdateRepoRequest{ + ProjectID: req.ProjectId, + BuildIDs: []string{}, + Delete: false, + TaskID: &taskID, + NoDeletePrevious: true, + } + for _, importRes := range importResults { + updateRepoRequest.BuildIDs = append(updateRepoRequest.BuildIDs, importRes.Build.ID.String()) + } + updateRepoTask := &yumrepofspb.UpdateRepoTask{} + err = workflow.ExecuteChildWorkflow(yumrepoCtx, c.RepoUpdaterWorkflow, updateRepoRequest).Get(yumrepoCtx, updateRepoTask) + if err != nil { + setActivityError(errorDetails, err) + return nil, err + } + + task.Status = peridotpb.TaskStatus_TASK_STATUS_SUCCEEDED + + ret.RepoChanges = updateRepoTask + return &ret, nil +} + +func (c *Controller) RpmImportActivity(ctx context.Context, req *peridotpb.RpmImportRequest, taskID string, setTaskStatus bool) (*RpmImportActivityTaskStage1, error) { go func() { for { activity.RecordHeartbeat(ctx) @@ -164,41 +302,65 @@ func (c *Controller) RpmImportActivity(ctx context.Context, req *peridotpb.RpmIm } buf.Write(bts) - c.log.Infof("Reading tar: %s", req.Rpms) - - rpmBufs := map[string][]byte{} - tr := tar.NewReader(&buf) - for { - hdr, err := tr.Next() - if err == io.EOF { - break - } - if err != nil { - return nil, err - } - var nBuf bytes.Buffer - if _, err := io.Copy(&nBuf, tr); err != nil { - return nil, err - } - c.log.Infof("Detected RPM: %s", hdr.Name) - rpmBufs[hdr.Name] = nBuf.Bytes() - } var rpms []*rpm.Package - for _, b := range rpmBufs { - p, err := rpm.Read(bytes.NewBuffer(b)) + rpmBufs := map[string][]byte{} + + if strings.HasSuffix(req.Rpms, ".tar") { + c.log.Infof("Reading tar: %s", req.Rpms) + + tr := tar.NewReader(&buf) + for { + hdr, err := tr.Next() + if err == io.EOF { + break + } + if err != nil { + return nil, err + } + var nBuf bytes.Buffer + if _, err := io.Copy(&nBuf, tr); err != nil { + return nil, err + } + c.log.Infof("Detected RPM: %s", hdr.Name) + rpmBufs[hdr.Name] = nBuf.Bytes() + } + for _, b := range rpmBufs { + p, err := rpm.Read(bytes.NewBuffer(b)) + if err != nil { + return nil, err + } + rpms = append(rpms, p) + } + } else { + c.log.Infof("Reading RPM: %s", req.Rpms) + p, err := rpm.Read(&buf) if err != nil { return nil, err } rpms = append(rpms, p) + + realName := p.String() + ".rpm" + if p.SourceRPM() == "" && p.Architecture() == "i686" { + realName = strings.ReplaceAll(realName, ".i686", ".src") + } + rpmBufs[realName] = bts } var nvr string for _, rpmObj := range rpms { + realNvr := rpmObj.String() + if rpmObj.SourceRPM() == "" && rpmObj.Architecture() == "i686" { + realNvr = strings.ReplaceAll(realNvr, ".i686", ".src") + } if nvr == "" { nvr = rpmObj.SourceRPM() - } - if nvr != rpmObj.SourceRPM() { - return nil, fmt.Errorf("only include RPMs from one package") + if nvr == "" && rpmObj.Architecture() == "i686" { + nvr = realNvr + } + } else { + if nvr != rpmObj.SourceRPM() && nvr != fmt.Sprintf("%s.rpm", realNvr) { + return nil, fmt.Errorf("only include RPMs from one package") + } } } if !rpmutils.NVR().MatchString(nvr) { @@ -307,6 +469,14 @@ func (c *Controller) RpmImportActivity(ctx context.Context, req *peridotpb.RpmIm } } + if setTaskStatus { + err = tx.SetTaskStatus(taskID, peridotpb.TaskStatus_TASK_STATUS_SUCCEEDED) + if err != nil { + err = status.Errorf(codes.Internal, "could not set task status: %v", err) + return nil, err + } + } + err = beginTx.Commit() if err != nil { return nil, status.Errorf(codes.Internal, "could not commit transaction: %v", err) diff --git a/peridot/builder/v1/workflow/workflow.go b/peridot/builder/v1/workflow/workflow.go index 32512c0..1e8f66f 100644 --- a/peridot/builder/v1/workflow/workflow.go +++ b/peridot/builder/v1/workflow/workflow.go @@ -46,6 +46,7 @@ import ( peridotpb "peridot.resf.org/peridot/pb" "peridot.resf.org/peridot/plugin" "peridot.resf.org/peridot/rpmbuild" + "peridot.resf.org/utils" ) const ( @@ -199,7 +200,7 @@ func (c *Controller) commonCreateTask(task *models.Task, taskResponse proto.Mess c.log.Errorf("could not set task status: %v", err) } - taskDb, err := c.db.GetTask(task.ID.String(), task.ProjectId.String) + taskDb, err := c.db.GetTask(task.ID.String(), utils.NullStringToPointer(task.ProjectId)) if err != nil { c.log.Errorf("could not get task: %v", err) return diff --git a/peridot/cmd/v1/peridot/BUILD.bazel b/peridot/cmd/v1/peridot/BUILD.bazel new file mode 100644 index 0000000..995c568 --- /dev/null +++ b/peridot/cmd/v1/peridot/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "peridot_lib", + srcs = [ + "build.go", + "build_rpm_import.go", + "lookaside.go", + "lookaside_upload.go", + "main.go", + "utils.go", + ], + data = [ + "//peridot/proto/v1:client_go", + ], + importpath = "peridot.resf.org/peridot/cmd/v1/peridot", + visibility = ["//visibility:private"], + deps = [ + "//utils", + "//vendor/github.com/sirupsen/logrus", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/spf13/viper", + "//vendor/golang.org/x/oauth2", + "//vendor/golang.org/x/oauth2/clientcredentials", + "//vendor/openapi.peridot.resf.org/peridotopenapi", + ], +) + +go_binary( + name = "peridot", + embed = [":peridot_lib"], + visibility = ["//visibility:public"], +) diff --git a/peridot/cmd/v1/peridot/build.go b/peridot/cmd/v1/peridot/build.go new file mode 100644 index 0000000..957d7f6 --- /dev/null +++ b/peridot/cmd/v1/peridot/build.go @@ -0,0 +1,37 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import "github.com/spf13/cobra" + +var build = &cobra.Command{ + Use: "build", +} diff --git a/peridot/cmd/v1/peridot/build_rpm_import.go b/peridot/cmd/v1/peridot/build_rpm_import.go new file mode 100644 index 0000000..6a92341 --- /dev/null +++ b/peridot/cmd/v1/peridot/build_rpm_import.go @@ -0,0 +1,159 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "github.com/spf13/cobra" + "io/ioutil" + "log" + "openapi.peridot.resf.org/peridotopenapi" + "os" + "peridot.resf.org/utils" + "time" +) + +type LookasideUploadTask struct { + Task struct { + Subtasks []struct { + Response struct { + Digest string `json:"digest"` + } `json:"response"` + } `json:"subtasks"` + } `json:"task"` +} + +var buildRpmImport = &cobra.Command{ + Use: "rpm-import [*.rpm]", + Args: cobra.MinimumNArgs(1), + Run: buildRpmImportMn, +} + +var buildRpmImportForceOverride bool + +func init() { + buildRpmImport.Flags().BoolVar(&buildRpmImportForceOverride, "force-override", true, "Force override even if version exists (default: true)") +} + +func isFile(path string) bool { + if _, err := os.Stat(path); err != nil { + return false + } + + return true +} + +func buildRpmImportMn(_ *cobra.Command, args []string) { + // Ensure project id exists + projectId := mustGetProjectID() + _ = projectId + + // Ensure all args are valid files + for _, arg := range args { + if !isFile(arg) { + log.Fatalf("%s is not a valid file", arg) + } + } + + // Upload blobs to lookaside and wait for operation to finish + var operations []string + projectCl := getClient(serviceProject).(peridotopenapi.ProjectServiceApi) + for _, arg := range args { + bts, err := ioutil.ReadFile(arg) + errFatal(err) + base64EncodedBytes := base64.StdEncoding.EncodeToString(bts) + + res, _, err := projectCl.LookasideFileUpload(getContext()).Body(peridotopenapi.V1LookasideFileUploadRequest{ + File: &base64EncodedBytes, + }).Execute() + errFatal(err) + log.Printf("Uploading %s to lookaside with task id %s\n", arg, res.GetTaskId()) + operations = append(operations, res.GetTaskId()) + } + + log.Println("Waiting for upload tasks to finish...") + + // Wait for tasks to reach success state + taskCl := getClient(serviceTask).(peridotopenapi.TaskServiceApi) + var doneOperations []string + var blobs []string + for { + didBreak := false + for _, op := range operations { + log.Printf("Waiting for %s to finish\n", op) + if len(doneOperations) == len(operations) { + didBreak = true + break + } + if utils.StrContains(op, doneOperations) { + continue + } + + res, resp, err := taskCl.GetTask(getContext(), "global", op).Execute() + errFatal(err) + task := res.GetTask() + if task.GetDone() { + subtask := task.GetSubtasks()[0] + if subtask.GetStatus() == peridotopenapi.SUCCEEDED { + b, err := ioutil.ReadAll(resp.Body) + errFatal(err) + + var subtaskFull LookasideUploadTask + errFatal(json.Unmarshal(b, &subtaskFull)) + + blobs = append(blobs, subtaskFull.Task.Subtasks[0].Response.Digest) + doneOperations = append(doneOperations, op) + log.Printf("Task %s finished successfully\n", op) + } else if subtask.GetStatus() != peridotopenapi.RUNNING || subtask.GetStatus() != peridotopenapi.PENDING { + errFatal(fmt.Errorf("subtask %s failed with status %s", op, subtask.GetStatus())) + } + } + + time.Sleep(2 * time.Second) + } + if didBreak { + break + } + } + + log.Println("Upload tasks finished") + log.Println("Triggering RPM batch import") + + cl := getClient(serviceBuild).(peridotopenapi.BuildServiceApi) + _, _, err := cl.RpmLookasideBatchImport(getContext(), projectId). + Body(peridotopenapi.InlineObject4{ + LookasideBlobs: &blobs, + ForceOverride: &buildRpmImportForceOverride, + }).Execute() + errFatal(err) +} diff --git a/peridot/cmd/v1/peridot/lookaside.go b/peridot/cmd/v1/peridot/lookaside.go new file mode 100644 index 0000000..6579a3f --- /dev/null +++ b/peridot/cmd/v1/peridot/lookaside.go @@ -0,0 +1,37 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import "github.com/spf13/cobra" + +var lookaside = &cobra.Command{ + Use: "lookaside", +} diff --git a/peridot/cmd/v1/peridot/lookaside_upload.go b/peridot/cmd/v1/peridot/lookaside_upload.go new file mode 100644 index 0000000..794f626 --- /dev/null +++ b/peridot/cmd/v1/peridot/lookaside_upload.go @@ -0,0 +1,65 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import ( + "encoding/base64" + "fmt" + "github.com/spf13/cobra" + "io/ioutil" + "openapi.peridot.resf.org/peridotopenapi" + "os" +) + +var lookasideUpload = &cobra.Command{ + Use: "upload [file]", + Args: cobra.ExactArgs(1), + Run: lookasideUploadMn, +} + +func lookasideUploadMn(_ *cobra.Command, args []string) { + filePath := args[0] + stat, err := os.Stat(filePath) + errFatal(err) + if stat.IsDir() { + errFatal(fmt.Errorf("%s is a directory", filePath)) + } + + bts, err := ioutil.ReadFile(filePath) + errFatal(err) + base64EncodedBytes := base64.StdEncoding.EncodeToString(bts) + + cl := getClient(serviceProject).(peridotopenapi.ProjectServiceApi) + _, _, err = cl.LookasideFileUpload(getContext()).Body(peridotopenapi.V1LookasideFileUploadRequest{ + File: &base64EncodedBytes, + }).Execute() + errFatal(err) +} diff --git a/peridot/cmd/v1/peridot/main.go b/peridot/cmd/v1/peridot/main.go new file mode 100644 index 0000000..ec9ecf0 --- /dev/null +++ b/peridot/cmd/v1/peridot/main.go @@ -0,0 +1,106 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import ( + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "log" + "strings" +) + +var root = &cobra.Command{ + Use: "peridot", +} + +func init() { + root.PersistentFlags().String("endpoint", "peridot-api.build.resf.org", "Peridot API endpoint") + root.PersistentFlags().String("hdr-endpoint", "hdr.build.resf.org", "RESF OIDC endpoint") + root.PersistentFlags().Bool("skip-ca-verify", false, "Whether to accept self-signed certificates") + root.PersistentFlags().String("client-id", "", "Client ID for authentication") + root.PersistentFlags().String("client-secret", "", "Client secret for authentication") + root.PersistentFlags().String("project-id", "", "Peridot project ID") + root.PersistentFlags().Bool("debug", false, "Debug mode") + + root.AddCommand(lookaside) + lookaside.AddCommand(lookasideUpload) + + root.AddCommand(build) + build.AddCommand(buildRpmImport) + + viper.SetEnvPrefix("PERIDOT") + viper.AutomaticEnv() + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) + + err := viper.BindPFlags(root.PersistentFlags()) + if err != nil { + log.Fatalf("could not bind pflags to viper - %s", err) + } +} + +func main() { + if err := root.Execute(); err != nil { + logrus.Fatal(err) + } +} + +func endpoint() string { + return viper.GetString("endpoint") +} + +func hdrEndpoint() string { + return viper.GetString("hdr-endpoint") +} + +func skipCaVerify() bool { + return viper.GetBool("skip-ca-verify") +} + +func getClientId() string { + return viper.GetString("client-id") +} + +func getClientSecret() string { + return viper.GetString("client-secret") +} + +func mustGetProjectID() string { + ret := viper.GetString("project-id") + if ret == "" { + logrus.Fatal("project-id is required") + } + return ret +} + +func debug() bool { + return viper.GetBool("debug") +} diff --git a/peridot/cmd/v1/peridot/utils.go b/peridot/cmd/v1/peridot/utils.go new file mode 100644 index 0000000..e97587e --- /dev/null +++ b/peridot/cmd/v1/peridot/utils.go @@ -0,0 +1,126 @@ +// Copyright (c) All respective contributors to the Peridot Project. All rights reserved. +// Copyright (c) 2021-2022 Rocky Enterprise Software Foundation, Inc. All rights reserved. +// Copyright (c) 2021-2022 Ctrl IQ, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package main + +import ( + "context" + "crypto/tls" + "fmt" + "golang.org/x/oauth2" + "golang.org/x/oauth2/clientcredentials" + "log" + "net/http" + + "openapi.peridot.resf.org/peridotopenapi" +) + +type service string + +const ( + serviceProject = service("project") + serviceImport = service("import") + servicePackage = service("package") + serviceBuild = service("build") + serviceTask = service("task") +) + +var ( + doNotUseDirectlyClient map[service]interface{} + doNotUseDirectlyCtx context.Context +) + +func getClient(svc service) interface{} { + if doNotUseDirectlyClient != nil { + return doNotUseDirectlyClient[svc] + } + doNotUseDirectlyClient = make(map[service]interface{}) + + tlsConfig := &tls.Config{ + // We should allow users to configure this. + InsecureSkipVerify: skipCaVerify(), //nolint:gosec + } + + apiCfg := &peridotopenapi.Configuration{ + Debug: debug(), + Host: endpoint(), + Scheme: "https", + UserAgent: "peridot/0.1", + HTTPClient: &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: tlsConfig, + }, + }, + DefaultHeader: map[string]string{}, + Servers: peridotopenapi.ServerConfigurations{ + { + URL: "https://" + endpoint(), + }, + }, + OperationServers: map[string]peridotopenapi.ServerConfigurations{}, + } + + apiClient := peridotopenapi.NewAPIClient(apiCfg) + + doNotUseDirectlyClient[serviceProject] = apiClient.ProjectServiceApi + doNotUseDirectlyClient[serviceImport] = apiClient.ImportServiceApi + doNotUseDirectlyClient[servicePackage] = apiClient.PackageServiceApi + doNotUseDirectlyClient[serviceBuild] = apiClient.BuildServiceApi + doNotUseDirectlyClient[serviceTask] = apiClient.TaskServiceApi + + return doNotUseDirectlyClient[svc] +} + +func getContext() context.Context { + if doNotUseDirectlyCtx == nil { + doNotUseDirectlyCtx = context.TODO() + + oauth2Config := &clientcredentials.Config{ + ClientID: getClientId(), + ClientSecret: getClientSecret(), + // We don't currently support scopes, but authorize based on SpiceDB. + // Lack of scopes does not indicate that client has full access, but + // that we're managing access server sides and scopes doesn't affect that. + Scopes: []string{}, + TokenURL: fmt.Sprintf("https://%s/oauth2/token", hdrEndpoint()), + AuthStyle: oauth2.AuthStyleInHeader, + } + + tokenSource := oauth2Config.TokenSource(doNotUseDirectlyCtx) + doNotUseDirectlyCtx = context.WithValue(doNotUseDirectlyCtx, peridotopenapi.ContextOAuth2, tokenSource) + } + return doNotUseDirectlyCtx +} + +func errFatal(err error) { + if err != nil { + log.Fatalf("an error occurred: %s", err.Error()) + } +} diff --git a/peridot/cmd/v1/peridotbuilder/main.go b/peridot/cmd/v1/peridotbuilder/main.go index 1e7c36e..eabd2ce 100644 --- a/peridot/cmd/v1/peridotbuilder/main.go +++ b/peridot/cmd/v1/peridotbuilder/main.go @@ -107,14 +107,16 @@ func mn(_ *cobra.Command, _ []string) { db := serverconnector.MustAuto() var initiatedPlugins []plugin.Plugin - plugins, err := db.GetPluginsForProject(projectId) - if err != nil { - logrus.Fatalf("could not get plugins: %v", err) - } - if plugins != nil { - initiatedPlugins, err = initiatePlugins(plugins) + if projectId != "" { + plugins, err := db.GetPluginsForProject(projectId) if err != nil { - logrus.Fatalf("could not initiate plugins: %v", err) + logrus.Fatalf("could not get plugins: %v", err) + } + if plugins != nil { + initiatedPlugins, err = initiatePlugins(plugins) + if err != nil { + logrus.Fatalf("could not initiate plugins: %v", err) + } } } @@ -156,6 +158,9 @@ func mn(_ *cobra.Command, _ []string) { // RPM Import w.Worker.RegisterActivity(w.WorkflowController.RpmImportActivity) + // Lookaside + w.Worker.RegisterActivity(w.WorkflowController.LookasideFileUploadActivity) + // Yumrepofs w.Worker.RegisterActivity(w.WorkflowController.CreateHashedRepositoriesActivity) diff --git a/peridot/cmd/v1/peridotephemeral/main.go b/peridot/cmd/v1/peridotephemeral/main.go index bca9d29..db3b3c6 100644 --- a/peridot/cmd/v1/peridotephemeral/main.go +++ b/peridot/cmd/v1/peridotephemeral/main.go @@ -104,7 +104,9 @@ func mn(_ *cobra.Command, _ []string) { w.Worker.RegisterWorkflow(w.WorkflowController.TriggerImportFromBatchWorkflow) w.Worker.RegisterWorkflow(w.WorkflowController.SyncCatalogWorkflow) w.Worker.RegisterWorkflow(w.WorkflowController.RpmImportWorkflow) + w.Worker.RegisterWorkflow(w.WorkflowController.RpmLookasideBatchImportWorkflow) w.Worker.RegisterWorkflow(w.WorkflowController.CreateHashedRepositoriesWorkflow) + w.Worker.RegisterWorkflow(w.WorkflowController.LookasideFileUploadWorkflow) } w.Worker.RegisterWorkflow(w.WorkflowController.ProvisionWorkerWorkflow) w.Worker.RegisterWorkflow(w.WorkflowController.DestroyWorkerWorkflow) diff --git a/peridot/db/db.go b/peridot/db/db.go index 5679ff9..17b89e5 100644 --- a/peridot/db/db.go +++ b/peridot/db/db.go @@ -104,7 +104,7 @@ type Access interface { // ListTasks returns only parent tasks ListTasks(projectId *string, page int32, limit int32) (models.Tasks, error) // GetTask returns a parent task as well as all it's child tasks - GetTask(id string, projectId string) (models.Tasks, error) + GetTask(id string, projectId *string) (models.Tasks, error) // GetTaskByBuildId returns the task of a build (only parent task) GetTaskByBuildId(buildId string) (*models.Task, error) AttachTaskToBuild(buildId string, taskId string) error diff --git a/peridot/db/psql/task.go b/peridot/db/psql/task.go index ff2dc92..1c0d4de 100644 --- a/peridot/db/psql/task.go +++ b/peridot/db/psql/task.go @@ -122,7 +122,7 @@ func (a *Access) SetTaskMetadata(id string, metadata *anypb.Any) error { return err } -func (a *Access) GetTask(id string, projectId string) (ret models.Tasks, err error) { +func (a *Access) GetTask(id string, projectId *string) (ret models.Tasks, err error) { err = a.query.Select( &ret, ` @@ -130,7 +130,7 @@ func (a *Access) GetTask(id string, projectId string) (ret models.Tasks, err err select * from tasks where id = $1 - and project_id = $2 + and ($2 :: uuid is null or project_id = $2 :: uuid) union all select t.* from tasks t join task_query tq on tq.id = t.parent_task_id diff --git a/peridot/impl/v1/BUILD.bazel b/peridot/impl/v1/BUILD.bazel index 3c5f398..b5443d6 100644 --- a/peridot/impl/v1/BUILD.bazel +++ b/peridot/impl/v1/BUILD.bazel @@ -30,6 +30,7 @@ go_library( "@go_googleapis//google/api:httpbody_go_proto", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//credentials/insecure", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//encoding/protojson:go_default_library", "@org_golang_google_protobuf//types/known/anypb:go_default_library", diff --git a/peridot/impl/v1/build.go b/peridot/impl/v1/build.go index 8e98a03..6acc7f1 100644 --- a/peridot/impl/v1/build.go +++ b/peridot/impl/v1/build.go @@ -567,3 +567,77 @@ func (s *Server) RpmImport(ctx context.Context, req *peridotpb.RpmImportRequest) Done: false, }, nil } + +func (s *Server) RpmLookasideBatchImport(ctx context.Context, req *peridotpb.RpmLookasideBatchImportRequest) (*peridotpb.AsyncTask, error) { + if err := req.ValidateAll(); err != nil { + return nil, err + } + if err := s.checkPermission(ctx, ObjectProject, req.ProjectId, PermissionBuild); err != nil { + return nil, err + } + user, err := utils.UserFromContext(ctx) + if err != nil { + return nil, err + } + + projects, err := s.db.ListProjects(&peridotpb.ProjectFilters{ + Id: wrapperspb.String(req.ProjectId), + }) + if err != nil { + s.log.Errorf("could not list projects in RpmLookasideBatchImport: %v", err) + return nil, utils.InternalError + } + if len(projects) != 1 { + return nil, status.Errorf(codes.InvalidArgument, "project %s does not exist", req.ProjectId) + } + + rollback := true + beginTx, err := s.db.Begin() + if err != nil { + s.log.Error(err) + return nil, utils.InternalError + } + defer func() { + if rollback { + _ = beginTx.Rollback() + } + }() + tx := s.db.UseTransaction(beginTx) + + task, err := tx.CreateTask(user, "noarch", peridotpb.TaskType_TASK_TYPE_RPM_LOOKASIDE_BATCH_IMPORT, &req.ProjectId, nil) + if err != nil { + s.log.Errorf("could not create build task in RpmImport: %v", err) + return nil, status.Error(codes.InvalidArgument, "could not create rpm import task") + } + + taskProto, err := task.ToProto(true) + if err != nil { + return nil, status.Errorf(codes.Internal, "could not marshal task: %v", err) + } + + rollback = false + err = beginTx.Commit() + if err != nil { + return nil, status.Error(codes.Internal, "could not save, try again") + } + + _, err = s.temporal.ExecuteWorkflow( + context.Background(), + client.StartWorkflowOptions{ + TaskQueue: MainTaskQueue, + }, + s.temporalWorker.WorkflowController.RpmLookasideBatchImportWorkflow, + req, + task, + ) + if err != nil { + s.log.Errorf("could not start rpm lookaside batch import workflow in RpmImport: %v", err) + return nil, status.Error(codes.Internal, "could not start rpm lookaside batch import workflow") + } + + return &peridotpb.AsyncTask{ + TaskId: task.ID.String(), + Subtasks: []*peridotpb.Subtask{taskProto}, + Done: false, + }, nil +} diff --git a/peridot/impl/v1/project.go b/peridot/impl/v1/project.go index a2a2078..972685d 100644 --- a/peridot/impl/v1/project.go +++ b/peridot/impl/v1/project.go @@ -154,7 +154,7 @@ func (s *Server) ListProjects(ctx context.Context, req *peridotpb.ListProjectsRe } projects, err := s.db.ListProjects(&peridotpb.ProjectFilters{ - Ids: resources, + Ids: utils.Take[string](resources, "global"), }) if err != nil { s.log.Errorf("could not list projects: %v", err) @@ -403,3 +403,69 @@ func (s *Server) CreateHashedRepositories(ctx context.Context, req *peridotpb.Cr Done: false, }, nil } + +func (s *Server) LookasideFileUpload(ctx context.Context, req *peridotpb.LookasideFileUploadRequest) (*peridotpb.AsyncTask, error) { + if err := req.Validate(); err != nil { + return nil, err + } + if err := s.checkPermission(ctx, ObjectGlobal, ObjectIdPeridot, PermissionManage); err != nil { + return nil, err + } + + user, err := utils.UserFromContext(ctx) + if err != nil { + return nil, err + } + + rollback := true + beginTx, err := s.db.Begin() + if err != nil { + s.log.Error(err) + return nil, utils.InternalError + } + defer func() { + if rollback { + _ = beginTx.Rollback() + } + }() + tx := s.db.UseTransaction(beginTx) + + task, err := tx.CreateTask(user, "noarch", peridotpb.TaskType_TASK_TYPE_LOOKASIDE_FILE_UPLOAD, nil, nil) + if err != nil { + s.log.Errorf("could not create task: %v", err) + return nil, utils.InternalError + } + + taskProto, err := task.ToProto(false) + if err != nil { + return nil, status.Errorf(codes.Internal, "could not marshal task: %v", err) + } + + rollback = false + err = beginTx.Commit() + if err != nil { + return nil, status.Error(codes.Internal, "could not save, try again") + } + + _, err = s.temporal.ExecuteWorkflow( + context.Background(), + client.StartWorkflowOptions{ + ID: task.ID.String(), + TaskQueue: MainTaskQueue, + }, + s.temporalWorker.WorkflowController.LookasideFileUploadWorkflow, + req, + task, + ) + if err != nil { + s.log.Errorf("could not start workflow: %v", err) + _ = s.db.SetTaskStatus(task.ID.String(), peridotpb.TaskStatus_TASK_STATUS_FAILED) + return nil, err + } + + return &peridotpb.AsyncTask{ + TaskId: task.ID.String(), + Subtasks: []*peridotpb.Subtask{taskProto}, + Done: false, + }, nil +} diff --git a/peridot/impl/v1/server.go b/peridot/impl/v1/server.go index 7d41f32..2fc7f1a 100644 --- a/peridot/impl/v1/server.go +++ b/peridot/impl/v1/server.go @@ -40,6 +40,7 @@ import ( "go.temporal.io/sdk/client" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/status" "io" "net/url" @@ -87,6 +88,7 @@ type Server struct { temporalWorker *builderv1.Worker authz *authzed.Client hydra *hydraclient.OryHydra + hydraAdmin *hydraclient.OryHydra } func NewServer(db peridotdb.Access, c client.Client) (*Server, error) { @@ -104,13 +106,22 @@ func NewServer(db peridotdb.Access, c client.Client) (*Server, error) { if err != nil { return nil, fmt.Errorf("could not parse hydra public url, error: %s", err) } - hydraSDK := hydraclient.NewHTTPClientWithConfig(nil, &hydraclient.TransportConfig{ Schemes: []string{publicURL.Scheme}, Host: publicURL.Host, BasePath: publicURL.Path, }) + adminURL, err := url.Parse(servicecatalog.HydraAdmin()) + if err != nil { + return nil, fmt.Errorf("could not parse hydra admin url, error: %s", err) + } + hydraAdminSDK := hydraclient.NewHTTPClientWithConfig(nil, &hydraclient.TransportConfig{ + Schemes: []string{adminURL.Scheme}, + Host: adminURL.Host, + BasePath: adminURL.Path, + }) + return &Server{ log: logrus.New(), db: db, @@ -118,19 +129,20 @@ func NewServer(db peridotdb.Access, c client.Client) (*Server, error) { temporalWorker: temporalWorker, authz: authz, hydra: hydraSDK, + hydraAdmin: hydraAdminSDK, }, nil } func (s *Server) interceptor(ctx context.Context, req interface{}, usi *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { n := utils.EndInterceptor - n = utils.AuthInterceptor(s.hydra, []string{}, false, n) + n = utils.AuthInterceptor(s.hydra, s.hydraAdmin, []string{}, false, n) return n(ctx, req, usi, handler) } func (s *Server) serverInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { n := utils.ServerEndInterceptor - n = utils.ServerAuthInterceptor(s.hydra, []string{}, false, n) + n = utils.ServerAuthInterceptor(s.hydra, s.hydraAdmin, []string{}, false, n) return n(srv, ss, info, handler) } @@ -138,6 +150,10 @@ func (s *Server) serverInterceptor(srv interface{}, ss grpc.ServerStream, info * func (s *Server) Run() { res := utils.NewGRPCServer( &utils.GRPCOptions{ + DialOptions: []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024 * 1024 * 1024)), + }, ServerOptions: []grpc.ServerOption{ grpc.UnaryInterceptor(s.interceptor), grpc.StreamInterceptor(s.serverInterceptor), diff --git a/peridot/impl/v1/task.go b/peridot/impl/v1/task.go index 5931d6b..8f17227 100644 --- a/peridot/impl/v1/task.go +++ b/peridot/impl/v1/task.go @@ -51,9 +51,14 @@ func (s *Server) ListTasks(ctx context.Context, req *peridotpb.ListTasksRequest) return nil, err } + var projectId *string + if req.ProjectId.Value != "global" { + projectId = &req.ProjectId.Value + } + page := utils.MinPage(req.Page) limit := utils.MinLimit(req.Limit) - tasks, err := s.db.ListTasks(&req.ProjectId.Value, page, limit) + tasks, err := s.db.ListTasks(projectId, page, limit) if err != nil { s.log.Error(err) return nil, utils.InternalError @@ -61,12 +66,6 @@ func (s *Server) ListTasks(ctx context.Context, req *peridotpb.ListTasksRequest) var total int64 if len(tasks) > 0 { total = tasks[0].Total - } else { - total, err = s.db.ImportCountInProject(req.ProjectId.Value) - if err != nil { - s.log.Errorf("could not count imports: %v", err) - return nil, utils.CouldNotRetrieveObjects - } } var asyncTasks []*peridotpb.AsyncTask @@ -98,7 +97,12 @@ func (s *Server) GetTask(ctx context.Context, req *peridotpb.GetTaskRequest) (*p return nil, err } - tasks, err := s.db.GetTask(req.Id, req.ProjectId.Value) + var projectId *string + if req.ProjectId.Value != "global" { + projectId = &req.ProjectId.Value + } + + tasks, err := s.db.GetTask(req.Id, projectId) if err != nil { s.log.Error(err) return nil, utils.InternalError @@ -135,12 +139,16 @@ func (s *Server) StreamTaskLogs(req *peridotpb.StreamTaskLogsRequest, stream per var taskId *string = nil var parentTaskId *string = nil + var projectId *string + if req.ProjectId != "global" { + projectId = &req.ProjectId + } if req.Parent { parentTaskId = &req.Id } else { taskId = &req.Id } - _, err := s.db.GetTask(req.Id, req.ProjectId) + _, err := s.db.GetTask(req.Id, projectId) if err != nil { s.log.Errorf("error getting task: %s", err) return utils.InternalError @@ -173,7 +181,7 @@ func (s *Server) StreamTaskLogs(req *peridotpb.StreamTaskLogsRequest, stream per } } - task, err := s.db.GetTask(req.Id, req.ProjectId) + task, err := s.db.GetTask(req.Id, projectId) if err != nil { s.log.Errorf("error getting task: %s", err) return utils.InternalError @@ -189,11 +197,23 @@ func (s *Server) CancelTask(ctx context.Context, req *peridotpb.CancelTaskReques if err := req.ValidateAll(); err != nil { return nil, err } - if err := s.checkPermission(ctx, ObjectProject, req.ProjectId, PermissionBuild); err != nil { - return nil, err + + if req.ProjectId == "global" { + if err := s.checkPermission(ctx, ObjectGlobal, ObjectIdPeridot, PermissionManage); err != nil { + return nil, err + } + } else { + if err := s.checkPermission(ctx, ObjectProject, req.ProjectId, PermissionBuild); err != nil { + return nil, err + } } - tasks, err := s.db.GetTask(req.Id, req.ProjectId) + var projectId *string + if req.ProjectId != "global" { + projectId = &req.ProjectId + } + + tasks, err := s.db.GetTask(req.Id, projectId) if err != nil { s.log.Error(err) return nil, utils.InternalError diff --git a/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.down.sql b/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.down.sql new file mode 100644 index 0000000..c247c6a --- /dev/null +++ b/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.down.sql @@ -0,0 +1 @@ +alter table tasks alter column project_id set not null; diff --git a/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.up.sql b/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.up.sql new file mode 100644 index 0000000..7814528 --- /dev/null +++ b/peridot/migrate/20220823145405_make_project_id_optional_in_tasks.up.sql @@ -0,0 +1 @@ +alter table tasks alter column project_id drop not null; diff --git a/peridot/proto/v1/BUILD.bazel b/peridot/proto/v1/BUILD.bazel index 37e7932..28e5f9c 100644 --- a/peridot/proto/v1/BUILD.bazel +++ b/peridot/proto/v1/BUILD.bazel @@ -70,6 +70,18 @@ openapi_generator( visibility = ["//visibility:public"], ) +openapi_generator( + name = "client_go", + additional_properties = { + "packageName": "peridotopenapi", + "generateInterfaces": "true", + "hideGenerationTimestamp": "true", + }, + generator = "go", + spec = ":openapi", + visibility = ["//visibility:public"], +) + go_library( name = "pb", embed = [":peridotpb_go_proto"], diff --git a/peridot/proto/v1/build.proto b/peridot/proto/v1/build.proto index 53dc1ac..47ff78c 100644 --- a/peridot/proto/v1/build.proto +++ b/peridot/proto/v1/build.proto @@ -65,7 +65,7 @@ service BuildService { }; } - // RpmImport imports rpm files into a project + // RpmImport imports rpm files into a project (packaged into tar format) rpc RpmImport(RpmImportRequest) returns (AsyncTask) { option (google.api.http) = { post: "/v1/projects/{project_id=*}/builds/rpm-import" @@ -76,6 +76,18 @@ service BuildService { metadata_type: "RpmImportOperationMetadata" }; } + + // RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside) + rpc RpmLookasideBatchImport(RpmLookasideBatchImportRequest) returns (AsyncTask) { + option (google.api.http) = { + post: "/v1/projects/{project_id=*}/builds/rpm-lookaside-batch-import" + body: "*" + }; + option (resf.peridot.v1.task_info) = { + response_type: "RpmLookasideBatchImportTask" + metadata_type: "RpmLookasideBatchImportOperationMetadata" + }; + } } message Build { @@ -342,3 +354,26 @@ message RpmImportTask { message RpmImportOperationMetadata { string package_name = 1; } + +message RpmLookasideBatchImportRequest { + string project_id = 1; + + // Rpms + // + // Previously uploaded RPM tarball + repeated string lookaside_blobs = 2; + + // Force override + // + // Overwrite existing RPMs even if NVRA is locked + // Useful for secure boot scenarios for example + bool force_override = 3; +} + +message RpmLookasideBatchImportTask { + resf.peridot.yumrepofs.v1.UpdateRepoTask repo_changes = 1; +} + +message RpmLookasideBatchImportOperationMetadata { + repeated string package_names = 1; +} diff --git a/peridot/proto/v1/package.proto b/peridot/proto/v1/package.proto index 7c5dc1b..5aee2d5 100644 --- a/peridot/proto/v1/package.proto +++ b/peridot/proto/v1/package.proto @@ -33,7 +33,7 @@ service PackageService { // for a specific package enum PackageType { // Unknown value. Should never be used - PACKAGE_TYPE_UNSPECIFIED = 0; + PACKAGE_TYPE_DEFAULT = 0; // Normal packages from downstream dist-git // The repos are imported as-is diff --git a/peridot/proto/v1/project.proto b/peridot/proto/v1/project.proto index 371c453..0f73904 100644 --- a/peridot/proto/v1/project.proto +++ b/peridot/proto/v1/project.proto @@ -75,6 +75,13 @@ service ProjectService { body: "*" }; } + + rpc LookasideFileUpload(LookasideFileUploadRequest) returns (resf.peridot.v1.AsyncTask) { + option (google.api.http) = { + post: "/v1/lookaside" + body: "*" + }; + } } // Project is a contained RPM distribution @@ -291,3 +298,10 @@ message CreateHashedRepositoriesRequest { message CreateHashedRepositoriesTask { repeated string repo_revisions = 1; } + +message LookasideFileUploadRequest { + string file = 1 [(validate.rules).string.min_bytes = 1]; +} +message LookasideFileUploadTask { + string digest = 1; +} diff --git a/peridot/proto/v1/task.proto b/peridot/proto/v1/task.proto index e67bac3..cf4ddec 100644 --- a/peridot/proto/v1/task.proto +++ b/peridot/proto/v1/task.proto @@ -53,7 +53,7 @@ service TaskService { } enum TaskType { - TASK_TYPE_UNSPECIFIED = 0; + TASK_TYPE_UNKNOWN = 0; TASK_TYPE_IMPORT = 1; TASK_TYPE_IMPORT_SRC_GIT = 2; TASK_TYPE_IMPORT_SRC_GIT_TO_DIST_GIT = 3; @@ -71,6 +71,8 @@ enum TaskType { TASK_TYPE_SYNC_CATALOG = 15; TASK_TYPE_RPM_IMPORT = 16; TASK_TYPE_CREATE_HASHED_REPOSITORIES = 17; + TASK_TYPE_LOOKASIDE_FILE_UPLOAD = 18; + TASK_TYPE_RPM_LOOKASIDE_BATCH_IMPORT = 19; } enum TaskStatus { diff --git a/secparse/admin/impl/server.go b/secparse/admin/impl/server.go index 1d317d8..bc1fd54 100644 --- a/secparse/admin/impl/server.go +++ b/secparse/admin/impl/server.go @@ -71,7 +71,7 @@ func NewServer(db db.Access) *Server { func (s *Server) interceptor(ctx context.Context, req interface{}, usi *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { n := utils.EndInterceptor - n = utils.AuthInterceptor(s.hydra, []string{}, true, n) + n = utils.AuthInterceptor(s.hydra, nil, []string{}, true, n) return n(ctx, req, usi, handler) } diff --git a/utils/BUILD.bazel b/utils/BUILD.bazel index f417b2f..b560152 100644 --- a/utils/BUILD.bazel +++ b/utils/BUILD.bazel @@ -32,6 +32,7 @@ go_library( "//vendor/github.com/jmoiron/sqlx", "//vendor/github.com/lib/pq", "//vendor/github.com/ory/hydra-client-go/client", + "//vendor/github.com/ory/hydra-client-go/client/admin", "//vendor/github.com/ory/hydra-client-go/client/public", "//vendor/github.com/sirupsen/logrus", "//vendor/github.com/spf13/pflag", diff --git a/utils/interceptors.go b/utils/interceptors.go index 614ea9b..ad9b8ec 100644 --- a/utils/interceptors.go +++ b/utils/interceptors.go @@ -32,10 +32,13 @@ package utils import ( "context" + "fmt" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/ory/hydra-client-go/client" + "github.com/ory/hydra-client-go/client/admin" "github.com/ory/hydra-client-go/client/public" + "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -69,7 +72,7 @@ func ServerEndInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamS return handler(srv, ss) } -func checkAuth(ctx context.Context, hydraSDK *client.OryHydra) (context.Context, error) { +func checkAuth(ctx context.Context, hydraSDK *client.OryHydra, hydraAdmin *client.OryHydra) (context.Context, error) { // fetch metadata from grpc meta, ok := metadata.FromIncomingContext(ctx) if !ok { @@ -99,6 +102,22 @@ func checkAuth(ctx context.Context, hydraSDK *client.OryHydra) (context.Context, if err != nil { return ctx, err } + if userInfo.Payload.Sub == "" && hydraAdmin != nil { + introspect, err := hydraAdmin.Admin.IntrospectOAuth2Token( + &admin.IntrospectOAuth2TokenParams{ + Context: ctx, + Token: authToken[1], + }, + ) + if err != nil { + logrus.Errorf("error introspecting token: %s", err) + return ctx, status.Errorf(codes.Unauthenticated, "invalid authorization token") + } + + userInfo.Payload.Sub = introspect.Payload.ClientID + userInfo.Payload.Name = introspect.Payload.Sub + userInfo.Payload.Email = fmt.Sprintf("%s@%s", introspect.Payload.Sub, "serviceaccount.resf.org") + } // supply subject and token to further requests pairs := metadata.Pairs("x-user-id", userInfo.Payload.Sub, "x-user-name", userInfo.Payload.Name, "x-user-email", userInfo.Payload.Email, "x-auth-token", authToken[1]) @@ -108,12 +127,12 @@ func checkAuth(ctx context.Context, hydraSDK *client.OryHydra) (context.Context, } // AuthInterceptor requires OAuth2 authentication for all routes except listed -func AuthInterceptor(hydraSDK *client.OryHydra, excludedMethods []string, enforce bool, next InterceptorFunc) InterceptorFunc { +func AuthInterceptor(hydraSDK *client.OryHydra, hydraAdminSDK *client.OryHydra, excludedMethods []string, enforce bool, next InterceptorFunc) InterceptorFunc { return func(ctx context.Context, req interface{}, usi *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { // skip authentication for excluded methods if !StrContains(usi.FullMethod, excludedMethods) { var err error - if ctx, err = checkAuth(ctx, hydraSDK); err != nil { + if ctx, err = checkAuth(ctx, hydraSDK, hydraAdminSDK); err != nil { if enforce { return nil, err } @@ -132,7 +151,7 @@ type serverStream struct { func (ss *serverStream) Context() context.Context { return ss.ctx } -func ServerAuthInterceptor(hydraSDK *client.OryHydra, excludedMethods []string, enforce bool, next ServerInterceptorFunc) ServerInterceptorFunc { +func ServerAuthInterceptor(hydraSDK *client.OryHydra, hydraAdminSDK *client.OryHydra, excludedMethods []string, enforce bool, next ServerInterceptorFunc) ServerInterceptorFunc { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { newStream := serverStream{ ServerStream: ss, @@ -142,7 +161,7 @@ func ServerAuthInterceptor(hydraSDK *client.OryHydra, excludedMethods []string, if !StrContains(info.FullMethod, excludedMethods) { var ctx context.Context var err error - if ctx, err = checkAuth(ss.Context(), hydraSDK); err != nil { + if ctx, err = checkAuth(ss.Context(), hydraSDK, hydraAdminSDK); err != nil { if enforce { return err } diff --git a/utils/pointer.go b/utils/pointer.go index 56f10ce..5bc8f26 100644 --- a/utils/pointer.go +++ b/utils/pointer.go @@ -102,6 +102,14 @@ func NullTimeToTimestamppb(t sql.NullTime) *timestamppb.Timestamp { return timestamppb.New(t.Time) } +func NullStringToPointer(s sql.NullString) *string { + if !s.Valid { + return nil + } + + return &s.String +} + func Int64(i int64) *int64 { return &i } @@ -109,3 +117,7 @@ func Int64(i int64) *int64 { func Bool(b bool) *bool { return &b } + +func Pointer[T any](t T) *T { + return &t +} diff --git a/utils/slice.go b/utils/slice.go index 32c4080..c72636f 100644 --- a/utils/slice.go +++ b/utils/slice.go @@ -50,3 +50,14 @@ func IntersectString(a, b []string) []string { return c } + +func Take[T comparable](a []T, x T) []T { + var n []T + for _, v := range a { + if v != x { + n = append(n, v) + } + } + + return n +} diff --git a/vendor/golang.org/x/oauth2/clientcredentials/BUILD.bazel b/vendor/golang.org/x/oauth2/clientcredentials/BUILD.bazel new file mode 100644 index 0000000..3594849 --- /dev/null +++ b/vendor/golang.org/x/oauth2/clientcredentials/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "clientcredentials", + srcs = ["clientcredentials.go"], + importmap = "peridot.resf.org/vendor/golang.org/x/oauth2/clientcredentials", + importpath = "golang.org/x/oauth2/clientcredentials", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/oauth2", + "//vendor/golang.org/x/oauth2/internal", + ], +) diff --git a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go new file mode 100644 index 0000000..7a0b9ed --- /dev/null +++ b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go @@ -0,0 +1,120 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package clientcredentials implements the OAuth2.0 "client credentials" token flow, +// also known as the "two-legged OAuth 2.0". +// +// This should be used when the client is acting on its own behalf or when the client +// is the resource owner. It may also be used when requesting access to protected +// resources based on an authorization previously arranged with the authorization +// server. +// +// See https://tools.ietf.org/html/rfc6749#section-4.4 +package clientcredentials // import "golang.org/x/oauth2/clientcredentials" + +import ( + "context" + "fmt" + "net/http" + "net/url" + "strings" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" +) + +// Config describes a 2-legged OAuth2 flow, with both the +// client application information and the server's endpoint URLs. +type Config struct { + // ClientID is the application's ID. + ClientID string + + // ClientSecret is the application's secret. + ClientSecret string + + // TokenURL is the resource server's token endpoint + // URL. This is a constant specific to each server. + TokenURL string + + // Scope specifies optional requested permissions. + Scopes []string + + // EndpointParams specifies additional parameters for requests to the token endpoint. + EndpointParams url.Values + + // AuthStyle optionally specifies how the endpoint wants the + // client ID & client secret sent. The zero value means to + // auto-detect. + AuthStyle oauth2.AuthStyle +} + +// Token uses client credentials to retrieve a token. +// +// The provided context optionally controls which HTTP client is used. See the oauth2.HTTPClient variable. +func (c *Config) Token(ctx context.Context) (*oauth2.Token, error) { + return c.TokenSource(ctx).Token() +} + +// Client returns an HTTP client using the provided token. +// The token will auto-refresh as necessary. +// +// The provided context optionally controls which HTTP client +// is returned. See the oauth2.HTTPClient variable. +// +// The returned Client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context) *http.Client { + return oauth2.NewClient(ctx, c.TokenSource(ctx)) +} + +// TokenSource returns a TokenSource that returns t until t expires, +// automatically refreshing it as necessary using the provided context and the +// client ID and client secret. +// +// Most users will use Config.Client instead. +func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { + source := &tokenSource{ + ctx: ctx, + conf: c, + } + return oauth2.ReuseTokenSource(nil, source) +} + +type tokenSource struct { + ctx context.Context + conf *Config +} + +// Token refreshes the token by using a new client credentials request. +// tokens received this way do not include a refresh token +func (c *tokenSource) Token() (*oauth2.Token, error) { + v := url.Values{ + "grant_type": {"client_credentials"}, + } + if len(c.conf.Scopes) > 0 { + v.Set("scope", strings.Join(c.conf.Scopes, " ")) + } + for k, p := range c.conf.EndpointParams { + // Allow grant_type to be overridden to allow interoperability with + // non-compliant implementations. + if _, ok := v[k]; ok && k != "grant_type" { + return nil, fmt.Errorf("oauth2: cannot overwrite parameter %q", k) + } + v[k] = p + } + + tk, err := internal.RetrieveToken(c.ctx, c.conf.ClientID, c.conf.ClientSecret, c.conf.TokenURL, v, internal.AuthStyle(c.conf.AuthStyle)) + if err != nil { + if rErr, ok := err.(*internal.RetrieveError); ok { + return nil, (*oauth2.RetrieveError)(rErr) + } + return nil, err + } + t := &oauth2.Token{ + AccessToken: tk.AccessToken, + TokenType: tk.TokenType, + RefreshToken: tk.RefreshToken, + Expiry: tk.Expiry, + } + return t.WithExtra(tk.Raw), nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b768847..577810c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -588,6 +588,7 @@ golang.org/x/net/trace ## explicit golang.org/x/oauth2 golang.org/x/oauth2/authhandler +golang.org/x/oauth2/clientcredentials golang.org/x/oauth2/google golang.org/x/oauth2/google/internal/externalaccount golang.org/x/oauth2/internal @@ -981,6 +982,9 @@ k8s.io/client-go/util/workqueue k8s.io/klog/v2 # k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 k8s.io/utils/integer +# openapi.peridot.resf.org/peridotopenapi v0.0.0-00010101000000-000000000000 => ./bazel-bin/peridot/proto/v1/client_go +## explicit +openapi.peridot.resf.org/peridotopenapi # peridot.resf.org/common v0.0.0-00010101000000-000000000000 => ./bazel-bin/proto/commonpb_go_proto_/peridot.resf.org/common ## explicit peridot.resf.org/common @@ -1010,6 +1014,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml # github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt/v4 v4.4.2 +# openapi.peridot.resf.org/peridotopenapi => ./bazel-bin/peridot/proto/v1/client_go # bazel.build/protobuf => ./bazel-bin/build/bazel/protobuf/bazelbuild_go_proto_/bazel.build/protobuf # bazel.build/remote/execution/v2 => ./bazel-bin/build/bazel/remote/execution/v2/remoteexecution_go_proto_/bazel.build/remote/execution/v2 # bazel.build/semver => ./bazel-bin/build/bazel/semver/semver_go_proto_/bazel.build/semver diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/.gitignore b/vendor/openapi.peridot.resf.org/peridotopenapi/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/.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/vendor/openapi.peridot.resf.org/peridotopenapi/.openapi-generator-ignore b/vendor/openapi.peridot.resf.org/peridotopenapi/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/.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/vendor/openapi.peridot.resf.org/peridotopenapi/.travis.yml b/vendor/openapi.peridot.resf.org/peridotopenapi/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/BUILD.bazel b/vendor/openapi.peridot.resf.org/peridotopenapi/BUILD.bazel new file mode 100644 index 0000000..7af28f2 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/BUILD.bazel @@ -0,0 +1,82 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "peridotopenapi", + srcs = [ + "api_build_service.go", + "api_import_service.go", + "api_package_service.go", + "api_project_service.go", + "api_search_service.go", + "api_task_service.go", + "client.go", + "configuration.go", + "model_api_http_body.go", + "model_import_package_request_is_the_request_message_for_import_service_import_package.go", + "model_inline_object.go", + "model_inline_object_1.go", + "model_inline_object_2.go", + "model_inline_object_3.go", + "model_inline_object_4.go", + "model_inline_object_5.go", + "model_inline_object_6.go", + "model_inline_object_7.go", + "model_inline_object_8.go", + "model_protobuf_any.go", + "model_rpc_status.go", + "model_stream_result_of_api_http_body.go", + "model_stream_result_of_v1_search_response.go", + "model_v1_async_task.go", + "model_v1_batch_filter.go", + "model_v1_build.go", + "model_v1_build_batch.go", + "model_v1_build_filters.go", + "model_v1_create_project_request.go", + "model_v1_create_project_response.go", + "model_v1_get_build_batch_response.go", + "model_v1_get_build_response.go", + "model_v1_get_import_batch_response.go", + "model_v1_get_import_response.go", + "model_v1_get_package_response.go", + "model_v1_get_project_credentials_response.go", + "model_v1_get_project_response.go", + "model_v1_get_repository_response.go", + "model_v1_get_task_response.go", + "model_v1_import.go", + "model_v1_import_batch.go", + "model_v1_import_batch_retry_failed_response.go", + "model_v1_import_package_batch_response.go", + "model_v1_import_package_request.go", + "model_v1_import_revision.go", + "model_v1_list_build_batches_response.go", + "model_v1_list_builds_response.go", + "model_v1_list_import_batches_response.go", + "model_v1_list_imports_response.go", + "model_v1_list_packages_response.go", + "model_v1_list_projects_response.go", + "model_v1_list_repositories_response.go", + "model_v1_list_tasks_response.go", + "model_v1_lookaside_file_upload_request.go", + "model_v1_package.go", + "model_v1_package_filters.go", + "model_v1_package_type.go", + "model_v1_project.go", + "model_v1_repository.go", + "model_v1_search_request.go", + "model_v1_search_response.go", + "model_v1_set_project_credentials_response.go", + "model_v1_submit_build_batch_response.go", + "model_v1_submit_build_request.go", + "model_v1_subtask.go", + "model_v1_task_status.go", + "model_v1_task_type.go", + "model_v1_update_project_response.go", + "model_v1_version_release.go", + "response.go", + "utils.go", + ], + importmap = "peridot.resf.org/vendor/openapi.peridot.resf.org/peridotopenapi", + importpath = "openapi.peridot.resf.org/peridotopenapi", + visibility = ["//visibility:public"], + deps = ["//vendor/golang.org/x/oauth2"], +) diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/README.md b/vendor/openapi.peridot.resf.org/peridotopenapi/README.md new file mode 100644 index 0000000..2a14026 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/README.md @@ -0,0 +1,205 @@ +# Go API client for peridotopenapi + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## 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: version not set +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import sw "./peridotopenapi" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +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 `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), sw.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 identifield by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BuildServiceApi* | [**GetBuild**](docs/BuildServiceApi.md#getbuild) | **Get** /v1/projects/{projectId}/builds/{buildId} | GetBuild returns a build by its id +*BuildServiceApi* | [**GetBuildBatch**](docs/BuildServiceApi.md#getbuildbatch) | **Get** /v1/projects/{projectId}/build_batches/{buildBatchId} | GetBuildBatch returns a build batch by its id +*BuildServiceApi* | [**ListBuildBatches**](docs/BuildServiceApi.md#listbuildbatches) | **Get** /v1/projects/{projectId}/build_batches | ListBuildBatches returns all build batches +*BuildServiceApi* | [**ListBuilds**](docs/BuildServiceApi.md#listbuilds) | **Get** /v1/projects/{projectId}/builds | ListBuilds returns all builds filtered through given filters +*BuildServiceApi* | [**RpmImport**](docs/BuildServiceApi.md#rpmimport) | **Post** /v1/projects/{projectId}/builds/rpm-import | RpmImport imports rpm files into a project (packaged into tar format) +*BuildServiceApi* | [**RpmLookasideBatchImport**](docs/BuildServiceApi.md#rpmlookasidebatchimport) | **Post** /v1/projects/{projectId}/builds/rpm-lookaside-batch-import | RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside) +*BuildServiceApi* | [**SubmitBuild**](docs/BuildServiceApi.md#submitbuild) | **Post** /v1/projects/{projectId}/builds | SubmitBuild builds a package scoped to a project The project has to contain an import for the specific package This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information +*BuildServiceApi* | [**SubmitBuildBatch**](docs/BuildServiceApi.md#submitbuildbatch) | **Post** /v1/projects/{projectId}/build_batches | SubmitBuildBatch submits a batch of builds. +*ImportServiceApi* | [**GetImport**](docs/ImportServiceApi.md#getimport) | **Get** /v1/projects/{projectId}/imports/{importId} | GetImport gets an import by ID. +*ImportServiceApi* | [**GetImportBatch**](docs/ImportServiceApi.md#getimportbatch) | **Get** /v1/projects/{projectId}/import_batches/{importBatchId} | GetImportBatch gets an import batch by ID. +*ImportServiceApi* | [**ImportBatchRetryFailed**](docs/ImportServiceApi.md#importbatchretryfailed) | **Post** /v1/projects/{projectId}/import_batches/{importBatchId}/retry_failed | ImportBatchRetryFailed retries failed imports in a batch. +*ImportServiceApi* | [**ImportPackage**](docs/ImportServiceApi.md#importpackage) | **Post** /v1/projects/{projectId}/imports | ImportPackage imports a package scoped to a project This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information TODO low-pri: Support inter-project imports +*ImportServiceApi* | [**ImportPackageBatch**](docs/ImportServiceApi.md#importpackagebatch) | **Post** /v1/projects/{projectId}/import_batches | ImportPackageBatch imports a batch of packages scoped to a project +*ImportServiceApi* | [**ListImportBatches**](docs/ImportServiceApi.md#listimportbatches) | **Get** /v1/projects/{projectId}/import_batches | ListImportBatches lists all import batches for a project. +*ImportServiceApi* | [**ListImports**](docs/ImportServiceApi.md#listimports) | **Get** /v1/projects/{projectId}/imports | ListImports lists all imports for a project. +*PackageServiceApi* | [**GetPackage**](docs/PackageServiceApi.md#getpackage) | **Get** /v1/projects/{projectId}/packages/{field}/{value} | GetPackage returns a package by its id or name +*PackageServiceApi* | [**ListPackages**](docs/PackageServiceApi.md#listpackages) | **Get** /v1/projects/{projectId}/packages | ListPackages returns all packages with filters applied +*ProjectServiceApi* | [**CreateHashedRepositories**](docs/ProjectServiceApi.md#createhashedrepositories) | **Post** /v1/projects/{projectId}/repositories/hashed | +*ProjectServiceApi* | [**CreateProject**](docs/ProjectServiceApi.md#createproject) | **Post** /v1/projects | +*ProjectServiceApi* | [**GetProject**](docs/ProjectServiceApi.md#getproject) | **Get** /v1/projects/{id} | +*ProjectServiceApi* | [**GetProjectCredentials**](docs/ProjectServiceApi.md#getprojectcredentials) | **Get** /v1/projects/{projectId}/credentials | +*ProjectServiceApi* | [**GetRepository**](docs/ProjectServiceApi.md#getrepository) | **Get** /v1/projects/{projectId}/repositories/{id} | +*ProjectServiceApi* | [**ListProjects**](docs/ProjectServiceApi.md#listprojects) | **Get** /v1/projects | +*ProjectServiceApi* | [**ListRepositories**](docs/ProjectServiceApi.md#listrepositories) | **Get** /v1/projects/{projectId}/repositories | +*ProjectServiceApi* | [**LookasideFileUpload**](docs/ProjectServiceApi.md#lookasidefileupload) | **Post** /v1/lookaside | +*ProjectServiceApi* | [**SetProjectCredentials**](docs/ProjectServiceApi.md#setprojectcredentials) | **Post** /v1/projects/{projectId}/credentials | +*ProjectServiceApi* | [**SyncCatalog**](docs/ProjectServiceApi.md#synccatalog) | **Post** /v1/projects/{projectId}/catalogsync | +*ProjectServiceApi* | [**UpdateProject**](docs/ProjectServiceApi.md#updateproject) | **Put** /v1/projects/{projectId} | +*SearchServiceApi* | [**Search**](docs/SearchServiceApi.md#search) | **Post** /v1/search | +*TaskServiceApi* | [**CancelTask**](docs/TaskServiceApi.md#canceltask) | **Post** /v1/projects/{projectId}/tasks/{id}/cancel | CancelTask cancels a task with the given ID. Only parent tasks can be cancelled and if they're in the PENDING or RUNNING state. +*TaskServiceApi* | [**GetTask**](docs/TaskServiceApi.md#gettask) | **Get** /v1/projects/{projectId}/tasks/{id} | GetTask returns a specific task with the given ID +*TaskServiceApi* | [**ListTasks**](docs/TaskServiceApi.md#listtasks) | **Get** /v1/projects/{projectId}/tasks | ListTasks returns a list of tasks from all projects List mode won't return task responses. The reason being responses being able to reach huge sizes. To get the response for a specific task, you can use GetTask, either on the specific subtask or the parent task. +*TaskServiceApi* | [**StreamTaskLogs**](docs/TaskServiceApi.md#streamtasklogs) | **Get** /v1/projects/{projectId}/tasks/{id}/logs | StreamTaskLogs streams the logs of a specific task with the given ID + + +## Documentation For Models + + - [ApiHttpBody](docs/ApiHttpBody.md) + - [ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage](docs/ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineObject6](docs/InlineObject6.md) + - [InlineObject7](docs/InlineObject7.md) + - [InlineObject8](docs/InlineObject8.md) + - [ProtobufAny](docs/ProtobufAny.md) + - [RpcStatus](docs/RpcStatus.md) + - [StreamResultOfApiHttpBody](docs/StreamResultOfApiHttpBody.md) + - [StreamResultOfV1SearchResponse](docs/StreamResultOfV1SearchResponse.md) + - [V1AsyncTask](docs/V1AsyncTask.md) + - [V1BatchFilter](docs/V1BatchFilter.md) + - [V1Build](docs/V1Build.md) + - [V1BuildBatch](docs/V1BuildBatch.md) + - [V1BuildFilters](docs/V1BuildFilters.md) + - [V1CreateProjectRequest](docs/V1CreateProjectRequest.md) + - [V1CreateProjectResponse](docs/V1CreateProjectResponse.md) + - [V1GetBuildBatchResponse](docs/V1GetBuildBatchResponse.md) + - [V1GetBuildResponse](docs/V1GetBuildResponse.md) + - [V1GetImportBatchResponse](docs/V1GetImportBatchResponse.md) + - [V1GetImportResponse](docs/V1GetImportResponse.md) + - [V1GetPackageResponse](docs/V1GetPackageResponse.md) + - [V1GetProjectCredentialsResponse](docs/V1GetProjectCredentialsResponse.md) + - [V1GetProjectResponse](docs/V1GetProjectResponse.md) + - [V1GetRepositoryResponse](docs/V1GetRepositoryResponse.md) + - [V1GetTaskResponse](docs/V1GetTaskResponse.md) + - [V1Import](docs/V1Import.md) + - [V1ImportBatch](docs/V1ImportBatch.md) + - [V1ImportBatchRetryFailedResponse](docs/V1ImportBatchRetryFailedResponse.md) + - [V1ImportPackageBatchResponse](docs/V1ImportPackageBatchResponse.md) + - [V1ImportPackageRequest](docs/V1ImportPackageRequest.md) + - [V1ImportRevision](docs/V1ImportRevision.md) + - [V1ListBuildBatchesResponse](docs/V1ListBuildBatchesResponse.md) + - [V1ListBuildsResponse](docs/V1ListBuildsResponse.md) + - [V1ListImportBatchesResponse](docs/V1ListImportBatchesResponse.md) + - [V1ListImportsResponse](docs/V1ListImportsResponse.md) + - [V1ListPackagesResponse](docs/V1ListPackagesResponse.md) + - [V1ListProjectsResponse](docs/V1ListProjectsResponse.md) + - [V1ListRepositoriesResponse](docs/V1ListRepositoriesResponse.md) + - [V1ListTasksResponse](docs/V1ListTasksResponse.md) + - [V1LookasideFileUploadRequest](docs/V1LookasideFileUploadRequest.md) + - [V1Package](docs/V1Package.md) + - [V1PackageFilters](docs/V1PackageFilters.md) + - [V1PackageType](docs/V1PackageType.md) + - [V1Project](docs/V1Project.md) + - [V1Repository](docs/V1Repository.md) + - [V1SearchRequest](docs/V1SearchRequest.md) + - [V1SearchResponse](docs/V1SearchResponse.md) + - [V1SetProjectCredentialsResponse](docs/V1SetProjectCredentialsResponse.md) + - [V1SubmitBuildBatchResponse](docs/V1SubmitBuildBatchResponse.md) + - [V1SubmitBuildRequest](docs/V1SubmitBuildRequest.md) + - [V1Subtask](docs/V1Subtask.md) + - [V1TaskStatus](docs/V1TaskStatus.md) + - [V1TaskType](docs/V1TaskType.md) + - [V1UpdateProjectResponse](docs/V1UpdateProjectResponse.md) + - [V1VersionRelease](docs/V1VersionRelease.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_build_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_build_service.go new file mode 100644 index 0000000..70c3b03 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_build_service.go @@ -0,0 +1,1153 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +type BuildServiceApi interface { + + /* + * GetBuild GetBuild returns a build by its id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param buildId + * @return ApiGetBuildRequest + */ + GetBuild(ctx _context.Context, projectId string, buildId string) ApiGetBuildRequest + + /* + * GetBuildExecute executes the request + * @return V1GetBuildResponse + */ + GetBuildExecute(r ApiGetBuildRequest) (V1GetBuildResponse, *_nethttp.Response, error) + + /* + * GetBuildBatch GetBuildBatch returns a build batch by its id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param buildBatchId + * @return ApiGetBuildBatchRequest + */ + GetBuildBatch(ctx _context.Context, projectId string, buildBatchId string) ApiGetBuildBatchRequest + + /* + * GetBuildBatchExecute executes the request + * @return V1GetBuildBatchResponse + */ + GetBuildBatchExecute(r ApiGetBuildBatchRequest) (V1GetBuildBatchResponse, *_nethttp.Response, error) + + /* + * ListBuildBatches ListBuildBatches returns all build batches + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListBuildBatchesRequest + */ + ListBuildBatches(ctx _context.Context, projectId string) ApiListBuildBatchesRequest + + /* + * ListBuildBatchesExecute executes the request + * @return V1ListBuildBatchesResponse + */ + ListBuildBatchesExecute(r ApiListBuildBatchesRequest) (V1ListBuildBatchesResponse, *_nethttp.Response, error) + + /* + * ListBuilds ListBuilds returns all builds filtered through given filters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListBuildsRequest + */ + ListBuilds(ctx _context.Context, projectId string) ApiListBuildsRequest + + /* + * ListBuildsExecute executes the request + * @return V1ListBuildsResponse + */ + ListBuildsExecute(r ApiListBuildsRequest) (V1ListBuildsResponse, *_nethttp.Response, error) + + /* + * RpmImport RpmImport imports rpm files into a project (packaged into tar format) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiRpmImportRequest + */ + RpmImport(ctx _context.Context, projectId string) ApiRpmImportRequest + + /* + * RpmImportExecute executes the request + * @return V1AsyncTask + */ + RpmImportExecute(r ApiRpmImportRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * RpmLookasideBatchImport RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiRpmLookasideBatchImportRequest + */ + RpmLookasideBatchImport(ctx _context.Context, projectId string) ApiRpmLookasideBatchImportRequest + + /* + * RpmLookasideBatchImportExecute executes the request + * @return V1AsyncTask + */ + RpmLookasideBatchImportExecute(r ApiRpmLookasideBatchImportRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * SubmitBuild SubmitBuild builds a package scoped to a project The project has to contain an import for the specific package This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that we want this build to be assigned to All build requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + * @return ApiSubmitBuildRequest + */ + SubmitBuild(ctx _context.Context, projectId string) ApiSubmitBuildRequest + + /* + * SubmitBuildExecute executes the request + * @return V1AsyncTask + */ + SubmitBuildExecute(r ApiSubmitBuildRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * SubmitBuildBatch SubmitBuildBatch submits a batch of builds. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Only the top-most project id is used for all build requests + * @return ApiSubmitBuildBatchRequest + */ + SubmitBuildBatch(ctx _context.Context, projectId string) ApiSubmitBuildBatchRequest + + /* + * SubmitBuildBatchExecute executes the request + * @return V1SubmitBuildBatchResponse + */ + SubmitBuildBatchExecute(r ApiSubmitBuildBatchRequest) (V1SubmitBuildBatchResponse, *_nethttp.Response, error) +} + +// BuildServiceApiService BuildServiceApi service +type BuildServiceApiService service + +type ApiGetBuildRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + buildId string +} + + +func (r ApiGetBuildRequest) Execute() (V1GetBuildResponse, *_nethttp.Response, error) { + return r.ApiService.GetBuildExecute(r) +} + +/* + * GetBuild GetBuild returns a build by its id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param buildId + * @return ApiGetBuildRequest + */ +func (a *BuildServiceApiService) GetBuild(ctx _context.Context, projectId string, buildId string) ApiGetBuildRequest { + return ApiGetBuildRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + buildId: buildId, + } +} + +/* + * Execute executes the request + * @return V1GetBuildResponse + */ +func (a *BuildServiceApiService) GetBuildExecute(r ApiGetBuildRequest) (V1GetBuildResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetBuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.GetBuild") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/builds/{buildId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", _neturl.PathEscape(parameterToString(r.buildId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetBuildBatchRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + buildBatchId string + page *int32 + limit *int32 + filterStatus *string +} + +func (r ApiGetBuildBatchRequest) Page(page int32) ApiGetBuildBatchRequest { + r.page = &page + return r +} +func (r ApiGetBuildBatchRequest) Limit(limit int32) ApiGetBuildBatchRequest { + r.limit = &limit + return r +} +func (r ApiGetBuildBatchRequest) FilterStatus(filterStatus string) ApiGetBuildBatchRequest { + r.filterStatus = &filterStatus + return r +} + +func (r ApiGetBuildBatchRequest) Execute() (V1GetBuildBatchResponse, *_nethttp.Response, error) { + return r.ApiService.GetBuildBatchExecute(r) +} + +/* + * GetBuildBatch GetBuildBatch returns a build batch by its id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param buildBatchId + * @return ApiGetBuildBatchRequest + */ +func (a *BuildServiceApiService) GetBuildBatch(ctx _context.Context, projectId string, buildBatchId string) ApiGetBuildBatchRequest { + return ApiGetBuildBatchRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + buildBatchId: buildBatchId, + } +} + +/* + * Execute executes the request + * @return V1GetBuildBatchResponse + */ +func (a *BuildServiceApiService) GetBuildBatchExecute(r ApiGetBuildBatchRequest) (V1GetBuildBatchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetBuildBatchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.GetBuildBatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/build_batches/{buildBatchId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"buildBatchId"+"}", _neturl.PathEscape(parameterToString(r.buildBatchId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.filterStatus != nil { + localVarQueryParams.Add("filter.status", parameterToString(*r.filterStatus, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListBuildBatchesRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + page *int32 + limit *int32 +} + +func (r ApiListBuildBatchesRequest) Page(page int32) ApiListBuildBatchesRequest { + r.page = &page + return r +} +func (r ApiListBuildBatchesRequest) Limit(limit int32) ApiListBuildBatchesRequest { + r.limit = &limit + return r +} + +func (r ApiListBuildBatchesRequest) Execute() (V1ListBuildBatchesResponse, *_nethttp.Response, error) { + return r.ApiService.ListBuildBatchesExecute(r) +} + +/* + * ListBuildBatches ListBuildBatches returns all build batches + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListBuildBatchesRequest + */ +func (a *BuildServiceApiService) ListBuildBatches(ctx _context.Context, projectId string) ApiListBuildBatchesRequest { + return ApiListBuildBatchesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListBuildBatchesResponse + */ +func (a *BuildServiceApiService) ListBuildBatchesExecute(r ApiListBuildBatchesRequest) (V1ListBuildBatchesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListBuildBatchesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.ListBuildBatches") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/build_batches" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListBuildsRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + filtersStatus *string + page *int32 + limit *int32 +} + +func (r ApiListBuildsRequest) FiltersStatus(filtersStatus string) ApiListBuildsRequest { + r.filtersStatus = &filtersStatus + return r +} +func (r ApiListBuildsRequest) Page(page int32) ApiListBuildsRequest { + r.page = &page + return r +} +func (r ApiListBuildsRequest) Limit(limit int32) ApiListBuildsRequest { + r.limit = &limit + return r +} + +func (r ApiListBuildsRequest) Execute() (V1ListBuildsResponse, *_nethttp.Response, error) { + return r.ApiService.ListBuildsExecute(r) +} + +/* + * ListBuilds ListBuilds returns all builds filtered through given filters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListBuildsRequest + */ +func (a *BuildServiceApiService) ListBuilds(ctx _context.Context, projectId string) ApiListBuildsRequest { + return ApiListBuildsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListBuildsResponse + */ +func (a *BuildServiceApiService) ListBuildsExecute(r ApiListBuildsRequest) (V1ListBuildsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListBuildsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.ListBuilds") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/builds" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.filtersStatus != nil { + localVarQueryParams.Add("filters.status", parameterToString(*r.filtersStatus, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiRpmImportRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + body *InlineObject3 +} + +func (r ApiRpmImportRequest) Body(body InlineObject3) ApiRpmImportRequest { + r.body = &body + return r +} + +func (r ApiRpmImportRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.RpmImportExecute(r) +} + +/* + * RpmImport RpmImport imports rpm files into a project (packaged into tar format) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiRpmImportRequest + */ +func (a *BuildServiceApiService) RpmImport(ctx _context.Context, projectId string) ApiRpmImportRequest { + return ApiRpmImportRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *BuildServiceApiService) RpmImportExecute(r ApiRpmImportRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.RpmImport") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/builds/rpm-import" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiRpmLookasideBatchImportRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + body *InlineObject4 +} + +func (r ApiRpmLookasideBatchImportRequest) Body(body InlineObject4) ApiRpmLookasideBatchImportRequest { + r.body = &body + return r +} + +func (r ApiRpmLookasideBatchImportRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.RpmLookasideBatchImportExecute(r) +} + +/* + * RpmLookasideBatchImport RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiRpmLookasideBatchImportRequest + */ +func (a *BuildServiceApiService) RpmLookasideBatchImport(ctx _context.Context, projectId string) ApiRpmLookasideBatchImportRequest { + return ApiRpmLookasideBatchImportRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *BuildServiceApiService) RpmLookasideBatchImportExecute(r ApiRpmLookasideBatchImportRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.RpmLookasideBatchImport") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/builds/rpm-lookaside-batch-import" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiSubmitBuildRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + body *InlineObject2 +} + +func (r ApiSubmitBuildRequest) Body(body InlineObject2) ApiSubmitBuildRequest { + r.body = &body + return r +} + +func (r ApiSubmitBuildRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.SubmitBuildExecute(r) +} + +/* + * SubmitBuild SubmitBuild builds a package scoped to a project The project has to contain an import for the specific package This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that we want this build to be assigned to All build requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + * @return ApiSubmitBuildRequest + */ +func (a *BuildServiceApiService) SubmitBuild(ctx _context.Context, projectId string) ApiSubmitBuildRequest { + return ApiSubmitBuildRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *BuildServiceApiService) SubmitBuildExecute(r ApiSubmitBuildRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.SubmitBuild") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/builds" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiSubmitBuildBatchRequest struct { + ctx _context.Context + ApiService BuildServiceApi + projectId string + body *InlineObject1 +} + +func (r ApiSubmitBuildBatchRequest) Body(body InlineObject1) ApiSubmitBuildBatchRequest { + r.body = &body + return r +} + +func (r ApiSubmitBuildBatchRequest) Execute() (V1SubmitBuildBatchResponse, *_nethttp.Response, error) { + return r.ApiService.SubmitBuildBatchExecute(r) +} + +/* + * SubmitBuildBatch SubmitBuildBatch submits a batch of builds. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Only the top-most project id is used for all build requests + * @return ApiSubmitBuildBatchRequest + */ +func (a *BuildServiceApiService) SubmitBuildBatch(ctx _context.Context, projectId string) ApiSubmitBuildBatchRequest { + return ApiSubmitBuildBatchRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1SubmitBuildBatchResponse + */ +func (a *BuildServiceApiService) SubmitBuildBatchExecute(r ApiSubmitBuildBatchRequest) (V1SubmitBuildBatchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1SubmitBuildBatchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BuildServiceApiService.SubmitBuildBatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/build_batches" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_import_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_import_service.go new file mode 100644 index 0000000..fc8e9be --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_import_service.go @@ -0,0 +1,1004 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +type ImportServiceApi interface { + + /* + * GetImport GetImport gets an import by ID. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importId + * @return ApiGetImportRequest + */ + GetImport(ctx _context.Context, projectId string, importId string) ApiGetImportRequest + + /* + * GetImportExecute executes the request + * @return V1GetImportResponse + */ + GetImportExecute(r ApiGetImportRequest) (V1GetImportResponse, *_nethttp.Response, error) + + /* + * GetImportBatch GetImportBatch gets an import batch by ID. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importBatchId + * @return ApiGetImportBatchRequest + */ + GetImportBatch(ctx _context.Context, projectId string, importBatchId string) ApiGetImportBatchRequest + + /* + * GetImportBatchExecute executes the request + * @return V1GetImportBatchResponse + */ + GetImportBatchExecute(r ApiGetImportBatchRequest) (V1GetImportBatchResponse, *_nethttp.Response, error) + + /* + * ImportBatchRetryFailed ImportBatchRetryFailed retries failed imports in a batch. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importBatchId + * @return ApiImportBatchRetryFailedRequest + */ + ImportBatchRetryFailed(ctx _context.Context, projectId string, importBatchId string) ApiImportBatchRetryFailedRequest + + /* + * ImportBatchRetryFailedExecute executes the request + * @return V1ImportBatchRetryFailedResponse + */ + ImportBatchRetryFailedExecute(r ApiImportBatchRetryFailedRequest) (V1ImportBatchRetryFailedResponse, *_nethttp.Response, error) + + /* + * ImportPackage ImportPackage imports a package scoped to a project This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information TODO low-pri: Support inter-project imports + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that we want this import to be assigned to All import requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + * @return ApiImportPackageRequest + */ + ImportPackage(ctx _context.Context, projectId string) ApiImportPackageRequest + + /* + * ImportPackageExecute executes the request + * @return V1AsyncTask + */ + ImportPackageExecute(r ApiImportPackageRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * ImportPackageBatch ImportPackageBatch imports a batch of packages scoped to a project + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Only the top-most project id is used for all import requests + * @return ApiImportPackageBatchRequest + */ + ImportPackageBatch(ctx _context.Context, projectId string) ApiImportPackageBatchRequest + + /* + * ImportPackageBatchExecute executes the request + * @return V1ImportPackageBatchResponse + */ + ImportPackageBatchExecute(r ApiImportPackageBatchRequest) (V1ImportPackageBatchResponse, *_nethttp.Response, error) + + /* + * ListImportBatches ListImportBatches lists all import batches for a project. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListImportBatchesRequest + */ + ListImportBatches(ctx _context.Context, projectId string) ApiListImportBatchesRequest + + /* + * ListImportBatchesExecute executes the request + * @return V1ListImportBatchesResponse + */ + ListImportBatchesExecute(r ApiListImportBatchesRequest) (V1ListImportBatchesResponse, *_nethttp.Response, error) + + /* + * ListImports ListImports lists all imports for a project. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListImportsRequest + */ + ListImports(ctx _context.Context, projectId string) ApiListImportsRequest + + /* + * ListImportsExecute executes the request + * @return V1ListImportsResponse + */ + ListImportsExecute(r ApiListImportsRequest) (V1ListImportsResponse, *_nethttp.Response, error) +} + +// ImportServiceApiService ImportServiceApi service +type ImportServiceApiService service + +type ApiGetImportRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + importId string +} + + +func (r ApiGetImportRequest) Execute() (V1GetImportResponse, *_nethttp.Response, error) { + return r.ApiService.GetImportExecute(r) +} + +/* + * GetImport GetImport gets an import by ID. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importId + * @return ApiGetImportRequest + */ +func (a *ImportServiceApiService) GetImport(ctx _context.Context, projectId string, importId string) ApiGetImportRequest { + return ApiGetImportRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + importId: importId, + } +} + +/* + * Execute executes the request + * @return V1GetImportResponse + */ +func (a *ImportServiceApiService) GetImportExecute(r ApiGetImportRequest) (V1GetImportResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetImportResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.GetImport") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/imports/{importId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"importId"+"}", _neturl.PathEscape(parameterToString(r.importId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetImportBatchRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + importBatchId string + page *int32 + limit *int32 + filterStatus *string +} + +func (r ApiGetImportBatchRequest) Page(page int32) ApiGetImportBatchRequest { + r.page = &page + return r +} +func (r ApiGetImportBatchRequest) Limit(limit int32) ApiGetImportBatchRequest { + r.limit = &limit + return r +} +func (r ApiGetImportBatchRequest) FilterStatus(filterStatus string) ApiGetImportBatchRequest { + r.filterStatus = &filterStatus + return r +} + +func (r ApiGetImportBatchRequest) Execute() (V1GetImportBatchResponse, *_nethttp.Response, error) { + return r.ApiService.GetImportBatchExecute(r) +} + +/* + * GetImportBatch GetImportBatch gets an import batch by ID. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importBatchId + * @return ApiGetImportBatchRequest + */ +func (a *ImportServiceApiService) GetImportBatch(ctx _context.Context, projectId string, importBatchId string) ApiGetImportBatchRequest { + return ApiGetImportBatchRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + importBatchId: importBatchId, + } +} + +/* + * Execute executes the request + * @return V1GetImportBatchResponse + */ +func (a *ImportServiceApiService) GetImportBatchExecute(r ApiGetImportBatchRequest) (V1GetImportBatchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetImportBatchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.GetImportBatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/import_batches/{importBatchId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"importBatchId"+"}", _neturl.PathEscape(parameterToString(r.importBatchId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.filterStatus != nil { + localVarQueryParams.Add("filter.status", parameterToString(*r.filterStatus, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiImportBatchRetryFailedRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + importBatchId string +} + + +func (r ApiImportBatchRetryFailedRequest) Execute() (V1ImportBatchRetryFailedResponse, *_nethttp.Response, error) { + return r.ApiService.ImportBatchRetryFailedExecute(r) +} + +/* + * ImportBatchRetryFailed ImportBatchRetryFailed retries failed imports in a batch. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param importBatchId + * @return ApiImportBatchRetryFailedRequest + */ +func (a *ImportServiceApiService) ImportBatchRetryFailed(ctx _context.Context, projectId string, importBatchId string) ApiImportBatchRetryFailedRequest { + return ApiImportBatchRetryFailedRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + importBatchId: importBatchId, + } +} + +/* + * Execute executes the request + * @return V1ImportBatchRetryFailedResponse + */ +func (a *ImportServiceApiService) ImportBatchRetryFailedExecute(r ApiImportBatchRetryFailedRequest) (V1ImportBatchRetryFailedResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ImportBatchRetryFailedResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.ImportBatchRetryFailed") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/import_batches/{importBatchId}/retry_failed" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"importBatchId"+"}", _neturl.PathEscape(parameterToString(r.importBatchId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiImportPackageRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + body *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage +} + +func (r ApiImportPackageRequest) Body(body ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) ApiImportPackageRequest { + r.body = &body + return r +} + +func (r ApiImportPackageRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.ImportPackageExecute(r) +} + +/* + * ImportPackage ImportPackage imports a package scoped to a project This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information TODO low-pri: Support inter-project imports + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that we want this import to be assigned to All import requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + * @return ApiImportPackageRequest + */ +func (a *ImportServiceApiService) ImportPackage(ctx _context.Context, projectId string) ApiImportPackageRequest { + return ApiImportPackageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *ImportServiceApiService) ImportPackageExecute(r ApiImportPackageRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.ImportPackage") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/imports" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiImportPackageBatchRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + body *InlineObject7 +} + +func (r ApiImportPackageBatchRequest) Body(body InlineObject7) ApiImportPackageBatchRequest { + r.body = &body + return r +} + +func (r ApiImportPackageBatchRequest) Execute() (V1ImportPackageBatchResponse, *_nethttp.Response, error) { + return r.ApiService.ImportPackageBatchExecute(r) +} + +/* + * ImportPackageBatch ImportPackageBatch imports a batch of packages scoped to a project + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Only the top-most project id is used for all import requests + * @return ApiImportPackageBatchRequest + */ +func (a *ImportServiceApiService) ImportPackageBatch(ctx _context.Context, projectId string) ApiImportPackageBatchRequest { + return ApiImportPackageBatchRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ImportPackageBatchResponse + */ +func (a *ImportServiceApiService) ImportPackageBatchExecute(r ApiImportPackageBatchRequest) (V1ImportPackageBatchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ImportPackageBatchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.ImportPackageBatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/import_batches" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListImportBatchesRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + page *int32 + limit *int32 +} + +func (r ApiListImportBatchesRequest) Page(page int32) ApiListImportBatchesRequest { + r.page = &page + return r +} +func (r ApiListImportBatchesRequest) Limit(limit int32) ApiListImportBatchesRequest { + r.limit = &limit + return r +} + +func (r ApiListImportBatchesRequest) Execute() (V1ListImportBatchesResponse, *_nethttp.Response, error) { + return r.ApiService.ListImportBatchesExecute(r) +} + +/* + * ListImportBatches ListImportBatches lists all import batches for a project. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListImportBatchesRequest + */ +func (a *ImportServiceApiService) ListImportBatches(ctx _context.Context, projectId string) ApiListImportBatchesRequest { + return ApiListImportBatchesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListImportBatchesResponse + */ +func (a *ImportServiceApiService) ListImportBatchesExecute(r ApiListImportBatchesRequest) (V1ListImportBatchesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListImportBatchesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.ListImportBatches") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/import_batches" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListImportsRequest struct { + ctx _context.Context + ApiService ImportServiceApi + projectId string + page *int32 + limit *int32 +} + +func (r ApiListImportsRequest) Page(page int32) ApiListImportsRequest { + r.page = &page + return r +} +func (r ApiListImportsRequest) Limit(limit int32) ApiListImportsRequest { + r.limit = &limit + return r +} + +func (r ApiListImportsRequest) Execute() (V1ListImportsResponse, *_nethttp.Response, error) { + return r.ApiService.ListImportsExecute(r) +} + +/* + * ListImports ListImports lists all imports for a project. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListImportsRequest + */ +func (a *ImportServiceApiService) ListImports(ctx _context.Context, projectId string) ApiListImportsRequest { + return ApiListImportsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListImportsResponse + */ +func (a *ImportServiceApiService) ListImportsExecute(r ApiListImportsRequest) (V1ListImportsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListImportsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportServiceApiService.ListImports") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/imports" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_package_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_package_service.go new file mode 100644 index 0000000..b137634 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_package_service.go @@ -0,0 +1,357 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +type PackageServiceApi interface { + + /* + * GetPackage GetPackage returns a package by its id or name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param field + * @param value + * @return ApiGetPackageRequest + */ + GetPackage(ctx _context.Context, projectId string, field string, value string) ApiGetPackageRequest + + /* + * GetPackageExecute executes the request + * @return V1GetPackageResponse + */ + GetPackageExecute(r ApiGetPackageRequest) (V1GetPackageResponse, *_nethttp.Response, error) + + /* + * ListPackages ListPackages returns all packages with filters applied + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that should be queried + * @return ApiListPackagesRequest + */ + ListPackages(ctx _context.Context, projectId string) ApiListPackagesRequest + + /* + * ListPackagesExecute executes the request + * @return V1ListPackagesResponse + */ + ListPackagesExecute(r ApiListPackagesRequest) (V1ListPackagesResponse, *_nethttp.Response, error) +} + +// PackageServiceApiService PackageServiceApi service +type PackageServiceApiService service + +type ApiGetPackageRequest struct { + ctx _context.Context + ApiService PackageServiceApi + projectId string + field string + value string +} + + +func (r ApiGetPackageRequest) Execute() (V1GetPackageResponse, *_nethttp.Response, error) { + return r.ApiService.GetPackageExecute(r) +} + +/* + * GetPackage GetPackage returns a package by its id or name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param field + * @param value + * @return ApiGetPackageRequest + */ +func (a *PackageServiceApiService) GetPackage(ctx _context.Context, projectId string, field string, value string) ApiGetPackageRequest { + return ApiGetPackageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + field: field, + value: value, + } +} + +/* + * Execute executes the request + * @return V1GetPackageResponse + */ +func (a *PackageServiceApiService) GetPackageExecute(r ApiGetPackageRequest) (V1GetPackageResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetPackageResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PackageServiceApiService.GetPackage") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/packages/{field}/{value}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"field"+"}", _neturl.PathEscape(parameterToString(r.field, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"value"+"}", _neturl.PathEscape(parameterToString(r.value, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListPackagesRequest struct { + ctx _context.Context + ApiService PackageServiceApi + projectId string + page *int32 + limit *int32 + filtersId *string + filtersName *string + filtersModular *bool + filtersNameExact *string + filtersNoImports *bool + filtersNoBuilds *bool +} + +func (r ApiListPackagesRequest) Page(page int32) ApiListPackagesRequest { + r.page = &page + return r +} +func (r ApiListPackagesRequest) Limit(limit int32) ApiListPackagesRequest { + r.limit = &limit + return r +} +func (r ApiListPackagesRequest) FiltersId(filtersId string) ApiListPackagesRequest { + r.filtersId = &filtersId + return r +} +func (r ApiListPackagesRequest) FiltersName(filtersName string) ApiListPackagesRequest { + r.filtersName = &filtersName + return r +} +func (r ApiListPackagesRequest) FiltersModular(filtersModular bool) ApiListPackagesRequest { + r.filtersModular = &filtersModular + return r +} +func (r ApiListPackagesRequest) FiltersNameExact(filtersNameExact string) ApiListPackagesRequest { + r.filtersNameExact = &filtersNameExact + return r +} +func (r ApiListPackagesRequest) FiltersNoImports(filtersNoImports bool) ApiListPackagesRequest { + r.filtersNoImports = &filtersNoImports + return r +} +func (r ApiListPackagesRequest) FiltersNoBuilds(filtersNoBuilds bool) ApiListPackagesRequest { + r.filtersNoBuilds = &filtersNoBuilds + return r +} + +func (r ApiListPackagesRequest) Execute() (V1ListPackagesResponse, *_nethttp.Response, error) { + return r.ApiService.ListPackagesExecute(r) +} + +/* + * ListPackages ListPackages returns all packages with filters applied + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId Project ID that should be queried + * @return ApiListPackagesRequest + */ +func (a *PackageServiceApiService) ListPackages(ctx _context.Context, projectId string) ApiListPackagesRequest { + return ApiListPackagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListPackagesResponse + */ +func (a *PackageServiceApiService) ListPackagesExecute(r ApiListPackagesRequest) (V1ListPackagesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListPackagesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PackageServiceApiService.ListPackages") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/packages" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.filtersId != nil { + localVarQueryParams.Add("filters.id", parameterToString(*r.filtersId, "")) + } + if r.filtersName != nil { + localVarQueryParams.Add("filters.name", parameterToString(*r.filtersName, "")) + } + if r.filtersModular != nil { + localVarQueryParams.Add("filters.modular", parameterToString(*r.filtersModular, "")) + } + if r.filtersNameExact != nil { + localVarQueryParams.Add("filters.nameExact", parameterToString(*r.filtersNameExact, "")) + } + if r.filtersNoImports != nil { + localVarQueryParams.Add("filters.noImports", parameterToString(*r.filtersNoImports, "")) + } + if r.filtersNoBuilds != nil { + localVarQueryParams.Add("filters.noBuilds", parameterToString(*r.filtersNoBuilds, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_project_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_project_service.go new file mode 100644 index 0000000..4589179 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_project_service.go @@ -0,0 +1,1483 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +type ProjectServiceApi interface { + + /* + * CreateHashedRepositories Method for CreateHashedRepositories + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiCreateHashedRepositoriesRequest + */ + CreateHashedRepositories(ctx _context.Context, projectId string) ApiCreateHashedRepositoriesRequest + + /* + * CreateHashedRepositoriesExecute executes the request + * @return V1AsyncTask + */ + CreateHashedRepositoriesExecute(r ApiCreateHashedRepositoriesRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * CreateProject Method for CreateProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateProjectRequest + */ + CreateProject(ctx _context.Context) ApiCreateProjectRequest + + /* + * CreateProjectExecute executes the request + * @return V1CreateProjectResponse + */ + CreateProjectExecute(r ApiCreateProjectRequest) (V1CreateProjectResponse, *_nethttp.Response, error) + + /* + * GetProject Method for GetProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @return ApiGetProjectRequest + */ + GetProject(ctx _context.Context, id string) ApiGetProjectRequest + + /* + * GetProjectExecute executes the request + * @return V1GetProjectResponse + */ + GetProjectExecute(r ApiGetProjectRequest) (V1GetProjectResponse, *_nethttp.Response, error) + + /* + * GetProjectCredentials Method for GetProjectCredentials + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiGetProjectCredentialsRequest + */ + GetProjectCredentials(ctx _context.Context, projectId string) ApiGetProjectCredentialsRequest + + /* + * GetProjectCredentialsExecute executes the request + * @return V1GetProjectCredentialsResponse + */ + GetProjectCredentialsExecute(r ApiGetProjectCredentialsRequest) (V1GetProjectCredentialsResponse, *_nethttp.Response, error) + + /* + * GetRepository Method for GetRepository + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiGetRepositoryRequest + */ + GetRepository(ctx _context.Context, projectId string, id string) ApiGetRepositoryRequest + + /* + * GetRepositoryExecute executes the request + * @return V1GetRepositoryResponse + */ + GetRepositoryExecute(r ApiGetRepositoryRequest) (V1GetRepositoryResponse, *_nethttp.Response, error) + + /* + * ListProjects Method for ListProjects + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiListProjectsRequest + */ + ListProjects(ctx _context.Context) ApiListProjectsRequest + + /* + * ListProjectsExecute executes the request + * @return V1ListProjectsResponse + */ + ListProjectsExecute(r ApiListProjectsRequest) (V1ListProjectsResponse, *_nethttp.Response, error) + + /* + * ListRepositories Method for ListRepositories + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListRepositoriesRequest + */ + ListRepositories(ctx _context.Context, projectId string) ApiListRepositoriesRequest + + /* + * ListRepositoriesExecute executes the request + * @return V1ListRepositoriesResponse + */ + ListRepositoriesExecute(r ApiListRepositoriesRequest) (V1ListRepositoriesResponse, *_nethttp.Response, error) + + /* + * LookasideFileUpload Method for LookasideFileUpload + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLookasideFileUploadRequest + */ + LookasideFileUpload(ctx _context.Context) ApiLookasideFileUploadRequest + + /* + * LookasideFileUploadExecute executes the request + * @return V1AsyncTask + */ + LookasideFileUploadExecute(r ApiLookasideFileUploadRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * SetProjectCredentials Method for SetProjectCredentials + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiSetProjectCredentialsRequest + */ + SetProjectCredentials(ctx _context.Context, projectId string) ApiSetProjectCredentialsRequest + + /* + * SetProjectCredentialsExecute executes the request + * @return V1SetProjectCredentialsResponse + */ + SetProjectCredentialsExecute(r ApiSetProjectCredentialsRequest) (V1SetProjectCredentialsResponse, *_nethttp.Response, error) + + /* + * SyncCatalog Method for SyncCatalog + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiSyncCatalogRequest + */ + SyncCatalog(ctx _context.Context, projectId string) ApiSyncCatalogRequest + + /* + * SyncCatalogExecute executes the request + * @return V1AsyncTask + */ + SyncCatalogExecute(r ApiSyncCatalogRequest) (V1AsyncTask, *_nethttp.Response, error) + + /* + * UpdateProject Method for UpdateProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiUpdateProjectRequest + */ + UpdateProject(ctx _context.Context, projectId string) ApiUpdateProjectRequest + + /* + * UpdateProjectExecute executes the request + * @return V1UpdateProjectResponse + */ + UpdateProjectExecute(r ApiUpdateProjectRequest) (V1UpdateProjectResponse, *_nethttp.Response, error) +} + +// ProjectServiceApiService ProjectServiceApi service +type ProjectServiceApiService service + +type ApiCreateHashedRepositoriesRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string + body *InlineObject8 +} + +func (r ApiCreateHashedRepositoriesRequest) Body(body InlineObject8) ApiCreateHashedRepositoriesRequest { + r.body = &body + return r +} + +func (r ApiCreateHashedRepositoriesRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.CreateHashedRepositoriesExecute(r) +} + +/* + * CreateHashedRepositories Method for CreateHashedRepositories + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiCreateHashedRepositoriesRequest + */ +func (a *ProjectServiceApiService) CreateHashedRepositories(ctx _context.Context, projectId string) ApiCreateHashedRepositoriesRequest { + return ApiCreateHashedRepositoriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *ProjectServiceApiService) CreateHashedRepositoriesExecute(r ApiCreateHashedRepositoriesRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.CreateHashedRepositories") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/repositories/hashed" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiCreateProjectRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + body *V1CreateProjectRequest +} + +func (r ApiCreateProjectRequest) Body(body V1CreateProjectRequest) ApiCreateProjectRequest { + r.body = &body + return r +} + +func (r ApiCreateProjectRequest) Execute() (V1CreateProjectResponse, *_nethttp.Response, error) { + return r.ApiService.CreateProjectExecute(r) +} + +/* + * CreateProject Method for CreateProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateProjectRequest + */ +func (a *ProjectServiceApiService) CreateProject(ctx _context.Context) ApiCreateProjectRequest { + return ApiCreateProjectRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return V1CreateProjectResponse + */ +func (a *ProjectServiceApiService) CreateProjectExecute(r ApiCreateProjectRequest) (V1CreateProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1CreateProjectResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.CreateProject") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetProjectRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + id string +} + + +func (r ApiGetProjectRequest) Execute() (V1GetProjectResponse, *_nethttp.Response, error) { + return r.ApiService.GetProjectExecute(r) +} + +/* + * GetProject Method for GetProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @return ApiGetProjectRequest + */ +func (a *ProjectServiceApiService) GetProject(ctx _context.Context, id string) ApiGetProjectRequest { + return ApiGetProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +/* + * Execute executes the request + * @return V1GetProjectResponse + */ +func (a *ProjectServiceApiService) GetProjectExecute(r ApiGetProjectRequest) (V1GetProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetProjectResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetProject") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetProjectCredentialsRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string +} + + +func (r ApiGetProjectCredentialsRequest) Execute() (V1GetProjectCredentialsResponse, *_nethttp.Response, error) { + return r.ApiService.GetProjectCredentialsExecute(r) +} + +/* + * GetProjectCredentials Method for GetProjectCredentials + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiGetProjectCredentialsRequest + */ +func (a *ProjectServiceApiService) GetProjectCredentials(ctx _context.Context, projectId string) ApiGetProjectCredentialsRequest { + return ApiGetProjectCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1GetProjectCredentialsResponse + */ +func (a *ProjectServiceApiService) GetProjectCredentialsExecute(r ApiGetProjectCredentialsRequest) (V1GetProjectCredentialsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetProjectCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetProjectCredentials") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetRepositoryRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string + id string +} + + +func (r ApiGetRepositoryRequest) Execute() (V1GetRepositoryResponse, *_nethttp.Response, error) { + return r.ApiService.GetRepositoryExecute(r) +} + +/* + * GetRepository Method for GetRepository + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiGetRepositoryRequest + */ +func (a *ProjectServiceApiService) GetRepository(ctx _context.Context, projectId string, id string) ApiGetRepositoryRequest { + return ApiGetRepositoryRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +/* + * Execute executes the request + * @return V1GetRepositoryResponse + */ +func (a *ProjectServiceApiService) GetRepositoryExecute(r ApiGetRepositoryRequest) (V1GetRepositoryResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetRepositoryResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetRepository") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/repositories/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListProjectsRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + page *string + limit *int32 +} + +func (r ApiListProjectsRequest) Page(page string) ApiListProjectsRequest { + r.page = &page + return r +} +func (r ApiListProjectsRequest) Limit(limit int32) ApiListProjectsRequest { + r.limit = &limit + return r +} + +func (r ApiListProjectsRequest) Execute() (V1ListProjectsResponse, *_nethttp.Response, error) { + return r.ApiService.ListProjectsExecute(r) +} + +/* + * ListProjects Method for ListProjects + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiListProjectsRequest + */ +func (a *ProjectServiceApiService) ListProjects(ctx _context.Context) ApiListProjectsRequest { + return ApiListProjectsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return V1ListProjectsResponse + */ +func (a *ProjectServiceApiService) ListProjectsExecute(r ApiListProjectsRequest) (V1ListProjectsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListProjectsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.ListProjects") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListRepositoriesRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string +} + + +func (r ApiListRepositoriesRequest) Execute() (V1ListRepositoriesResponse, *_nethttp.Response, error) { + return r.ApiService.ListRepositoriesExecute(r) +} + +/* + * ListRepositories Method for ListRepositories + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListRepositoriesRequest + */ +func (a *ProjectServiceApiService) ListRepositories(ctx _context.Context, projectId string) ApiListRepositoriesRequest { + return ApiListRepositoriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListRepositoriesResponse + */ +func (a *ProjectServiceApiService) ListRepositoriesExecute(r ApiListRepositoriesRequest) (V1ListRepositoriesResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListRepositoriesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.ListRepositories") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/repositories" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiLookasideFileUploadRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + body *V1LookasideFileUploadRequest +} + +func (r ApiLookasideFileUploadRequest) Body(body V1LookasideFileUploadRequest) ApiLookasideFileUploadRequest { + r.body = &body + return r +} + +func (r ApiLookasideFileUploadRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.LookasideFileUploadExecute(r) +} + +/* + * LookasideFileUpload Method for LookasideFileUpload + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLookasideFileUploadRequest + */ +func (a *ProjectServiceApiService) LookasideFileUpload(ctx _context.Context) ApiLookasideFileUploadRequest { + return ApiLookasideFileUploadRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *ProjectServiceApiService) LookasideFileUploadExecute(r ApiLookasideFileUploadRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.LookasideFileUpload") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/lookaside" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiSetProjectCredentialsRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string + body *InlineObject6 +} + +func (r ApiSetProjectCredentialsRequest) Body(body InlineObject6) ApiSetProjectCredentialsRequest { + r.body = &body + return r +} + +func (r ApiSetProjectCredentialsRequest) Execute() (V1SetProjectCredentialsResponse, *_nethttp.Response, error) { + return r.ApiService.SetProjectCredentialsExecute(r) +} + +/* + * SetProjectCredentials Method for SetProjectCredentials + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiSetProjectCredentialsRequest + */ +func (a *ProjectServiceApiService) SetProjectCredentials(ctx _context.Context, projectId string) ApiSetProjectCredentialsRequest { + return ApiSetProjectCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1SetProjectCredentialsResponse + */ +func (a *ProjectServiceApiService) SetProjectCredentialsExecute(r ApiSetProjectCredentialsRequest) (V1SetProjectCredentialsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1SetProjectCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.SetProjectCredentials") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiSyncCatalogRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string + body *InlineObject5 +} + +func (r ApiSyncCatalogRequest) Body(body InlineObject5) ApiSyncCatalogRequest { + r.body = &body + return r +} + +func (r ApiSyncCatalogRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) { + return r.ApiService.SyncCatalogExecute(r) +} + +/* + * SyncCatalog Method for SyncCatalog + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiSyncCatalogRequest + */ +func (a *ProjectServiceApiService) SyncCatalog(ctx _context.Context, projectId string) ApiSyncCatalogRequest { + return ApiSyncCatalogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1AsyncTask + */ +func (a *ProjectServiceApiService) SyncCatalogExecute(r ApiSyncCatalogRequest) (V1AsyncTask, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1AsyncTask + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.SyncCatalog") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/catalogsync" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiUpdateProjectRequest struct { + ctx _context.Context + ApiService ProjectServiceApi + projectId string + body *InlineObject +} + +func (r ApiUpdateProjectRequest) Body(body InlineObject) ApiUpdateProjectRequest { + r.body = &body + return r +} + +func (r ApiUpdateProjectRequest) Execute() (V1UpdateProjectResponse, *_nethttp.Response, error) { + return r.ApiService.UpdateProjectExecute(r) +} + +/* + * UpdateProject Method for UpdateProject + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiUpdateProjectRequest + */ +func (a *ProjectServiceApiService) UpdateProject(ctx _context.Context, projectId string) ApiUpdateProjectRequest { + return ApiUpdateProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1UpdateProjectResponse + */ +func (a *ProjectServiceApiService) UpdateProjectExecute(r ApiUpdateProjectRequest) (V1UpdateProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1UpdateProjectResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.UpdateProject") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_search_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_search_service.go new file mode 100644 index 0000000..a11e7f9 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_search_service.go @@ -0,0 +1,161 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +type SearchServiceApi interface { + + /* + * Search Method for Search + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiSearchRequest + */ + Search(ctx _context.Context) ApiSearchRequest + + /* + * SearchExecute executes the request + * @return StreamResultOfV1SearchResponse + */ + SearchExecute(r ApiSearchRequest) (StreamResultOfV1SearchResponse, *_nethttp.Response, error) +} + +// SearchServiceApiService SearchServiceApi service +type SearchServiceApiService service + +type ApiSearchRequest struct { + ctx _context.Context + ApiService SearchServiceApi + body *V1SearchRequest +} + +func (r ApiSearchRequest) Body(body V1SearchRequest) ApiSearchRequest { + r.body = &body + return r +} + +func (r ApiSearchRequest) Execute() (StreamResultOfV1SearchResponse, *_nethttp.Response, error) { + return r.ApiService.SearchExecute(r) +} + +/* + * Search Method for Search + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiSearchRequest + */ +func (a *SearchServiceApiService) Search(ctx _context.Context) ApiSearchRequest { + return ApiSearchRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return StreamResultOfV1SearchResponse + */ +func (a *SearchServiceApiService) SearchExecute(r ApiSearchRequest) (StreamResultOfV1SearchResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamResultOfV1SearchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SearchServiceApiService.Search") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/api_task_service.go b/vendor/openapi.peridot.resf.org/peridotopenapi/api_task_service.go new file mode 100644 index 0000000..28b6c18 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/api_task_service.go @@ -0,0 +1,574 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +type TaskServiceApi interface { + + /* + * CancelTask CancelTask cancels a task with the given ID. Only parent tasks can be cancelled and if they're in the PENDING or RUNNING state. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiCancelTaskRequest + */ + CancelTask(ctx _context.Context, projectId string, id string) ApiCancelTaskRequest + + /* + * CancelTaskExecute executes the request + * @return map[string]interface{} + */ + CancelTaskExecute(r ApiCancelTaskRequest) (map[string]interface{}, *_nethttp.Response, error) + + /* + * GetTask GetTask returns a specific task with the given ID + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiGetTaskRequest + */ + GetTask(ctx _context.Context, projectId string, id string) ApiGetTaskRequest + + /* + * GetTaskExecute executes the request + * @return V1GetTaskResponse + */ + GetTaskExecute(r ApiGetTaskRequest) (V1GetTaskResponse, *_nethttp.Response, error) + + /* + * ListTasks ListTasks returns a list of tasks from all projects List mode won't return task responses. The reason being responses being able to reach huge sizes. To get the response for a specific task, you can use GetTask, either on the specific subtask or the parent task. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListTasksRequest + */ + ListTasks(ctx _context.Context, projectId string) ApiListTasksRequest + + /* + * ListTasksExecute executes the request + * @return V1ListTasksResponse + */ + ListTasksExecute(r ApiListTasksRequest) (V1ListTasksResponse, *_nethttp.Response, error) + + /* + * StreamTaskLogs StreamTaskLogs streams the logs of a specific task with the given ID + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiStreamTaskLogsRequest + */ + StreamTaskLogs(ctx _context.Context, projectId string, id string) ApiStreamTaskLogsRequest + + /* + * StreamTaskLogsExecute executes the request + * @return StreamResultOfApiHttpBody + */ + StreamTaskLogsExecute(r ApiStreamTaskLogsRequest) (StreamResultOfApiHttpBody, *_nethttp.Response, error) +} + +// TaskServiceApiService TaskServiceApi service +type TaskServiceApiService service + +type ApiCancelTaskRequest struct { + ctx _context.Context + ApiService TaskServiceApi + projectId string + id string +} + + +func (r ApiCancelTaskRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { + return r.ApiService.CancelTaskExecute(r) +} + +/* + * CancelTask CancelTask cancels a task with the given ID. Only parent tasks can be cancelled and if they're in the PENDING or RUNNING state. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiCancelTaskRequest + */ +func (a *TaskServiceApiService) CancelTask(ctx _context.Context, projectId string, id string) ApiCancelTaskRequest { + return ApiCancelTaskRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +/* + * Execute executes the request + * @return map[string]interface{} + */ +func (a *TaskServiceApiService) CancelTaskExecute(r ApiCancelTaskRequest) (map[string]interface{}, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskServiceApiService.CancelTask") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/tasks/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiGetTaskRequest struct { + ctx _context.Context + ApiService TaskServiceApi + projectId string + id string +} + + +func (r ApiGetTaskRequest) Execute() (V1GetTaskResponse, *_nethttp.Response, error) { + return r.ApiService.GetTaskExecute(r) +} + +/* + * GetTask GetTask returns a specific task with the given ID + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiGetTaskRequest + */ +func (a *TaskServiceApiService) GetTask(ctx _context.Context, projectId string, id string) ApiGetTaskRequest { + return ApiGetTaskRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +/* + * Execute executes the request + * @return V1GetTaskResponse + */ +func (a *TaskServiceApiService) GetTaskExecute(r ApiGetTaskRequest) (V1GetTaskResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1GetTaskResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskServiceApiService.GetTask") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/tasks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiListTasksRequest struct { + ctx _context.Context + ApiService TaskServiceApi + projectId string + page *int32 + limit *int32 +} + +func (r ApiListTasksRequest) Page(page int32) ApiListTasksRequest { + r.page = &page + return r +} +func (r ApiListTasksRequest) Limit(limit int32) ApiListTasksRequest { + r.limit = &limit + return r +} + +func (r ApiListTasksRequest) Execute() (V1ListTasksResponse, *_nethttp.Response, error) { + return r.ApiService.ListTasksExecute(r) +} + +/* + * ListTasks ListTasks returns a list of tasks from all projects List mode won't return task responses. The reason being responses being able to reach huge sizes. To get the response for a specific task, you can use GetTask, either on the specific subtask or the parent task. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @return ApiListTasksRequest + */ +func (a *TaskServiceApiService) ListTasks(ctx _context.Context, projectId string) ApiListTasksRequest { + return ApiListTasksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +/* + * Execute executes the request + * @return V1ListTasksResponse + */ +func (a *TaskServiceApiService) ListTasksExecute(r ApiListTasksRequest) (V1ListTasksResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue V1ListTasksResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskServiceApiService.ListTasks") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/tasks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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 ApiStreamTaskLogsRequest struct { + ctx _context.Context + ApiService TaskServiceApi + projectId string + id string + parent *bool +} + +func (r ApiStreamTaskLogsRequest) Parent(parent bool) ApiStreamTaskLogsRequest { + r.parent = &parent + return r +} + +func (r ApiStreamTaskLogsRequest) Execute() (StreamResultOfApiHttpBody, *_nethttp.Response, error) { + return r.ApiService.StreamTaskLogsExecute(r) +} + +/* + * StreamTaskLogs StreamTaskLogs streams the logs of a specific task with the given ID + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param id + * @return ApiStreamTaskLogsRequest + */ +func (a *TaskServiceApiService) StreamTaskLogs(ctx _context.Context, projectId string, id string) ApiStreamTaskLogsRequest { + return ApiStreamTaskLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +/* + * Execute executes the request + * @return StreamResultOfApiHttpBody + */ +func (a *TaskServiceApiService) StreamTaskLogsExecute(r ApiStreamTaskLogsRequest) (StreamResultOfApiHttpBody, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamResultOfApiHttpBody + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskServiceApiService.StreamTaskLogs") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/tasks/{id}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.parent != nil { + localVarQueryParams.Add("parent", parameterToString(*r.parent, "")) + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v RpcStatus + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + 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/vendor/openapi.peridot.resf.org/peridotopenapi/client.go b/vendor/openapi.peridot.resf.org/peridotopenapi/client.go new file mode 100644 index 0000000..bfaa745 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/client.go @@ -0,0 +1,550 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +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" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the peridot/proto/v1/batch.proto API vversion not set +// 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 + + BuildServiceApi BuildServiceApi + + ImportServiceApi ImportServiceApi + + PackageServiceApi PackageServiceApi + + ProjectServiceApi ProjectServiceApi + + SearchServiceApi SearchServiceApi + + TaskServiceApi TaskServiceApi +} + +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.BuildServiceApi = (*BuildServiceApiService)(&c.common) + c.ImportServiceApi = (*ImportServiceApiService)(&c.common) + c.PackageServiceApi = (*PackageServiceApiService)(&c.common) + c.ProjectServiceApi = (*ProjectServiceApiService)(&c.common) + c.SearchServiceApi = (*SearchServiceApiService)(&c.common) + c.TaskServiceApi = (*TaskServiceApiService)(&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 insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(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 +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// 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 +} + +// 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, + formFileName string, + fileName string, + fileBytes []byte) (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(fileBytes) > 0 && fileName != "") { + 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) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(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 = query.Encode() + + // 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.Set(h, 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. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + 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 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(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 +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// 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) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + 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 +} diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/configuration.go b/vendor/openapi.peridot.resf.org/peridotopenapi/configuration.go new file mode 100644 index 0000000..54efc20 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/configuration.go @@ -0,0 +1,230 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +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 ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // 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: "", + 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/vendor/openapi.peridot.resf.org/peridotopenapi/git_push.sh b/vendor/openapi.peridot.resf.org/peridotopenapi/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/git_push.sh @@ -0,0 +1,58 @@ +#!/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-pestore-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/vendor/openapi.peridot.resf.org/peridotopenapi/go.mod b/vendor/openapi.peridot.resf.org/peridotopenapi/go.mod new file mode 100644 index 0000000..0f43de9 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/go.mod @@ -0,0 +1,7 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.13 + +require ( + golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 +) diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/go.sum b/vendor/openapi.peridot.resf.org/peridotopenapi/go.sum new file mode 100644 index 0000000..734252e --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/go.sum @@ -0,0 +1,13 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_api_http_body.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_api_http_body.go new file mode 100644 index 0000000..ef01588 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_api_http_body.go @@ -0,0 +1,190 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// ApiHttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged. +type ApiHttpBody struct { + // The HTTP Content-Type header value specifying the content type of the body. + ContentType *string `json:"contentType,omitempty"` + // The HTTP request/response body as raw binary. + Data *string `json:"data,omitempty"` + // Application specific response metadata. Must be set in the first response for streaming APIs. + Extensions *[]ProtobufAny `json:"extensions,omitempty"` +} + +// NewApiHttpBody instantiates a new ApiHttpBody 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 NewApiHttpBody() *ApiHttpBody { + this := ApiHttpBody{} + return &this +} + +// NewApiHttpBodyWithDefaults instantiates a new ApiHttpBody 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 NewApiHttpBodyWithDefaults() *ApiHttpBody { + this := ApiHttpBody{} + return &this +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ApiHttpBody) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiHttpBody) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ApiHttpBody) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ApiHttpBody) SetContentType(v string) { + o.ContentType = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ApiHttpBody) GetData() string { + if o == nil || o.Data == nil { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiHttpBody) GetDataOk() (*string, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ApiHttpBody) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *ApiHttpBody) SetData(v string) { + o.Data = &v +} + +// GetExtensions returns the Extensions field value if set, zero value otherwise. +func (o *ApiHttpBody) GetExtensions() []ProtobufAny { + if o == nil || o.Extensions == nil { + var ret []ProtobufAny + return ret + } + return *o.Extensions +} + +// GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiHttpBody) GetExtensionsOk() (*[]ProtobufAny, bool) { + if o == nil || o.Extensions == nil { + return nil, false + } + return o.Extensions, true +} + +// HasExtensions returns a boolean if a field has been set. +func (o *ApiHttpBody) HasExtensions() bool { + if o != nil && o.Extensions != nil { + return true + } + + return false +} + +// SetExtensions gets a reference to the given []ProtobufAny and assigns it to the Extensions field. +func (o *ApiHttpBody) SetExtensions(v []ProtobufAny) { + o.Extensions = &v +} + +func (o ApiHttpBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ContentType != nil { + toSerialize["contentType"] = o.ContentType + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Extensions != nil { + toSerialize["extensions"] = o.Extensions + } + return json.Marshal(toSerialize) +} + +type NullableApiHttpBody struct { + value *ApiHttpBody + isSet bool +} + +func (v NullableApiHttpBody) Get() *ApiHttpBody { + return v.value +} + +func (v *NullableApiHttpBody) Set(val *ApiHttpBody) { + v.value = val + v.isSet = true +} + +func (v NullableApiHttpBody) IsSet() bool { + return v.isSet +} + +func (v *NullableApiHttpBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiHttpBody(val *ApiHttpBody) *NullableApiHttpBody { + return &NullableApiHttpBody{value: val, isSet: true} +} + +func (v NullableApiHttpBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiHttpBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_import_package_request_is_the_request_message_for_import_service_import_package.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_import_package_request_is_the_request_message_for_import_service_import_package.go new file mode 100644 index 0000000..975d41a --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_import_package_request_is_the_request_message_for_import_service_import_package.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage struct for ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage +type ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage struct { + PackageName *string `json:"packageName,omitempty"` + PackageId *string `json:"packageId,omitempty"` + Vre *V1VersionRelease `json:"vre,omitempty"` + SetInactive *bool `json:"setInactive,omitempty"` +} + +// NewImportPackageRequestIsTheRequestMessageForImportServiceImportPackage instantiates a new ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage 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 NewImportPackageRequestIsTheRequestMessageForImportServiceImportPackage() *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage { + this := ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage{} + return &this +} + +// NewImportPackageRequestIsTheRequestMessageForImportServiceImportPackageWithDefaults instantiates a new ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage 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 NewImportPackageRequestIsTheRequestMessageForImportServiceImportPackageWithDefaults() *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage { + this := ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage{} + return &this +} + +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetPackageNameOk() (*string, bool) { + if o == nil || o.PackageName == nil { + return nil, false + } + return o.PackageName, true +} + +// HasPackageName returns a boolean if a field has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) HasPackageName() bool { + if o != nil && o.PackageName != nil { + return true + } + + return false +} + +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) SetPackageName(v string) { + o.PackageName = &v +} + +// GetPackageId returns the PackageId field value if set, zero value otherwise. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetPackageId() string { + if o == nil || o.PackageId == nil { + var ret string + return ret + } + return *o.PackageId +} + +// GetPackageIdOk returns a tuple with the PackageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetPackageIdOk() (*string, bool) { + if o == nil || o.PackageId == nil { + return nil, false + } + return o.PackageId, true +} + +// HasPackageId returns a boolean if a field has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) HasPackageId() bool { + if o != nil && o.PackageId != nil { + return true + } + + return false +} + +// SetPackageId gets a reference to the given string and assigns it to the PackageId field. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) SetPackageId(v string) { + o.PackageId = &v +} + +// GetVre returns the Vre field value if set, zero value otherwise. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetVre() V1VersionRelease { + if o == nil || o.Vre == nil { + var ret V1VersionRelease + return ret + } + return *o.Vre +} + +// GetVreOk returns a tuple with the Vre field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetVreOk() (*V1VersionRelease, bool) { + if o == nil || o.Vre == nil { + return nil, false + } + return o.Vre, true +} + +// HasVre returns a boolean if a field has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) HasVre() bool { + if o != nil && o.Vre != nil { + return true + } + + return false +} + +// SetVre gets a reference to the given V1VersionRelease and assigns it to the Vre field. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) SetVre(v V1VersionRelease) { + o.Vre = &v +} + +// GetSetInactive returns the SetInactive field value if set, zero value otherwise. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetSetInactive() bool { + if o == nil || o.SetInactive == nil { + var ret bool + return ret + } + return *o.SetInactive +} + +// GetSetInactiveOk returns a tuple with the SetInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) GetSetInactiveOk() (*bool, bool) { + if o == nil || o.SetInactive == nil { + return nil, false + } + return o.SetInactive, true +} + +// HasSetInactive returns a boolean if a field has been set. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) HasSetInactive() bool { + if o != nil && o.SetInactive != nil { + return true + } + + return false +} + +// SetSetInactive gets a reference to the given bool and assigns it to the SetInactive field. +func (o *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) SetSetInactive(v bool) { + o.SetInactive = &v +} + +func (o ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.PackageName != nil { + toSerialize["packageName"] = o.PackageName + } + if o.PackageId != nil { + toSerialize["packageId"] = o.PackageId + } + if o.Vre != nil { + toSerialize["vre"] = o.Vre + } + if o.SetInactive != nil { + toSerialize["setInactive"] = o.SetInactive + } + return json.Marshal(toSerialize) +} + +type NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage struct { + value *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage + isSet bool +} + +func (v NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) Get() *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage { + return v.value +} + +func (v *NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) Set(val *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) { + v.value = val + v.isSet = true +} + +func (v NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) IsSet() bool { + return v.isSet +} + +func (v *NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage(val *ImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) *NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage { + return &NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage{value: val, isSet: true} +} + +func (v NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportPackageRequestIsTheRequestMessageForImportServiceImportPackage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object.go new file mode 100644 index 0000000..18b7ae0 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject struct for InlineObject +type InlineObject struct { + Project *V1Project `json:"project,omitempty"` +} + +// NewInlineObject instantiates a new InlineObject 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 NewInlineObject() *InlineObject { + this := InlineObject{} + return &this +} + +// NewInlineObjectWithDefaults instantiates a new InlineObject 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 NewInlineObjectWithDefaults() *InlineObject { + this := InlineObject{} + return &this +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *InlineObject) GetProject() V1Project { + if o == nil || o.Project == nil { + var ret V1Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetProjectOk() (*V1Project, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *InlineObject) HasProject() bool { + if o != nil && o.Project != nil { + return true + } + + return false +} + +// SetProject gets a reference to the given V1Project and assigns it to the Project field. +func (o *InlineObject) SetProject(v V1Project) { + o.Project = &v +} + +func (o InlineObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Project != nil { + toSerialize["project"] = o.Project + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject struct { + value *InlineObject + isSet bool +} + +func (v NullableInlineObject) Get() *InlineObject { + return v.value +} + +func (v *NullableInlineObject) Set(val *InlineObject) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject(val *InlineObject) *NullableInlineObject { + return &NullableInlineObject{value: val, isSet: true} +} + +func (v NullableInlineObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_1.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_1.go new file mode 100644 index 0000000..ebe6f36 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_1.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject1 struct for InlineObject1 +type InlineObject1 struct { + Builds *[]V1SubmitBuildRequest `json:"builds,omitempty"` +} + +// NewInlineObject1 instantiates a new InlineObject1 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 NewInlineObject1() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// NewInlineObject1WithDefaults instantiates a new InlineObject1 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 NewInlineObject1WithDefaults() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// GetBuilds returns the Builds field value if set, zero value otherwise. +func (o *InlineObject1) GetBuilds() []V1SubmitBuildRequest { + if o == nil || o.Builds == nil { + var ret []V1SubmitBuildRequest + return ret + } + return *o.Builds +} + +// GetBuildsOk returns a tuple with the Builds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetBuildsOk() (*[]V1SubmitBuildRequest, bool) { + if o == nil || o.Builds == nil { + return nil, false + } + return o.Builds, true +} + +// HasBuilds returns a boolean if a field has been set. +func (o *InlineObject1) HasBuilds() bool { + if o != nil && o.Builds != nil { + return true + } + + return false +} + +// SetBuilds gets a reference to the given []V1SubmitBuildRequest and assigns it to the Builds field. +func (o *InlineObject1) SetBuilds(v []V1SubmitBuildRequest) { + o.Builds = &v +} + +func (o InlineObject1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Builds != nil { + toSerialize["builds"] = o.Builds + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject1 struct { + value *InlineObject1 + isSet bool +} + +func (v NullableInlineObject1) Get() *InlineObject1 { + return v.value +} + +func (v *NullableInlineObject1) Set(val *InlineObject1) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject1) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject1(val *InlineObject1) *NullableInlineObject1 { + return &NullableInlineObject1{value: val, isSet: true} +} + +func (v NullableInlineObject1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_2.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_2.go new file mode 100644 index 0000000..31f248c --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_2.go @@ -0,0 +1,367 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject2 struct for InlineObject2 +type InlineObject2 struct { + PackageName *string `json:"packageName,omitempty"` + PackageId *string `json:"packageId,omitempty"` + ScmHash *string `json:"scmHash,omitempty"` + DisableChecks *bool `json:"disableChecks,omitempty"` + Branches *[]string `json:"branches,omitempty"` + ModuleVariant *bool `json:"moduleVariant,omitempty"` + SideNvrs *[]string `json:"sideNvrs,omitempty"` + SetInactive *bool `json:"setInactive,omitempty"` +} + +// NewInlineObject2 instantiates a new InlineObject2 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 NewInlineObject2() *InlineObject2 { + this := InlineObject2{} + return &this +} + +// NewInlineObject2WithDefaults instantiates a new InlineObject2 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 NewInlineObject2WithDefaults() *InlineObject2 { + this := InlineObject2{} + return &this +} + +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *InlineObject2) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetPackageNameOk() (*string, bool) { + if o == nil || o.PackageName == nil { + return nil, false + } + return o.PackageName, true +} + +// HasPackageName returns a boolean if a field has been set. +func (o *InlineObject2) HasPackageName() bool { + if o != nil && o.PackageName != nil { + return true + } + + return false +} + +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *InlineObject2) SetPackageName(v string) { + o.PackageName = &v +} + +// GetPackageId returns the PackageId field value if set, zero value otherwise. +func (o *InlineObject2) GetPackageId() string { + if o == nil || o.PackageId == nil { + var ret string + return ret + } + return *o.PackageId +} + +// GetPackageIdOk returns a tuple with the PackageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetPackageIdOk() (*string, bool) { + if o == nil || o.PackageId == nil { + return nil, false + } + return o.PackageId, true +} + +// HasPackageId returns a boolean if a field has been set. +func (o *InlineObject2) HasPackageId() bool { + if o != nil && o.PackageId != nil { + return true + } + + return false +} + +// SetPackageId gets a reference to the given string and assigns it to the PackageId field. +func (o *InlineObject2) SetPackageId(v string) { + o.PackageId = &v +} + +// GetScmHash returns the ScmHash field value if set, zero value otherwise. +func (o *InlineObject2) GetScmHash() string { + if o == nil || o.ScmHash == nil { + var ret string + return ret + } + return *o.ScmHash +} + +// GetScmHashOk returns a tuple with the ScmHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetScmHashOk() (*string, bool) { + if o == nil || o.ScmHash == nil { + return nil, false + } + return o.ScmHash, true +} + +// HasScmHash returns a boolean if a field has been set. +func (o *InlineObject2) HasScmHash() bool { + if o != nil && o.ScmHash != nil { + return true + } + + return false +} + +// SetScmHash gets a reference to the given string and assigns it to the ScmHash field. +func (o *InlineObject2) SetScmHash(v string) { + o.ScmHash = &v +} + +// GetDisableChecks returns the DisableChecks field value if set, zero value otherwise. +func (o *InlineObject2) GetDisableChecks() bool { + if o == nil || o.DisableChecks == nil { + var ret bool + return ret + } + return *o.DisableChecks +} + +// GetDisableChecksOk returns a tuple with the DisableChecks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetDisableChecksOk() (*bool, bool) { + if o == nil || o.DisableChecks == nil { + return nil, false + } + return o.DisableChecks, true +} + +// HasDisableChecks returns a boolean if a field has been set. +func (o *InlineObject2) HasDisableChecks() bool { + if o != nil && o.DisableChecks != nil { + return true + } + + return false +} + +// SetDisableChecks gets a reference to the given bool and assigns it to the DisableChecks field. +func (o *InlineObject2) SetDisableChecks(v bool) { + o.DisableChecks = &v +} + +// GetBranches returns the Branches field value if set, zero value otherwise. +func (o *InlineObject2) GetBranches() []string { + if o == nil || o.Branches == nil { + var ret []string + return ret + } + return *o.Branches +} + +// GetBranchesOk returns a tuple with the Branches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetBranchesOk() (*[]string, bool) { + if o == nil || o.Branches == nil { + return nil, false + } + return o.Branches, true +} + +// HasBranches returns a boolean if a field has been set. +func (o *InlineObject2) HasBranches() bool { + if o != nil && o.Branches != nil { + return true + } + + return false +} + +// SetBranches gets a reference to the given []string and assigns it to the Branches field. +func (o *InlineObject2) SetBranches(v []string) { + o.Branches = &v +} + +// GetModuleVariant returns the ModuleVariant field value if set, zero value otherwise. +func (o *InlineObject2) GetModuleVariant() bool { + if o == nil || o.ModuleVariant == nil { + var ret bool + return ret + } + return *o.ModuleVariant +} + +// GetModuleVariantOk returns a tuple with the ModuleVariant field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetModuleVariantOk() (*bool, bool) { + if o == nil || o.ModuleVariant == nil { + return nil, false + } + return o.ModuleVariant, true +} + +// HasModuleVariant returns a boolean if a field has been set. +func (o *InlineObject2) HasModuleVariant() bool { + if o != nil && o.ModuleVariant != nil { + return true + } + + return false +} + +// SetModuleVariant gets a reference to the given bool and assigns it to the ModuleVariant field. +func (o *InlineObject2) SetModuleVariant(v bool) { + o.ModuleVariant = &v +} + +// GetSideNvrs returns the SideNvrs field value if set, zero value otherwise. +func (o *InlineObject2) GetSideNvrs() []string { + if o == nil || o.SideNvrs == nil { + var ret []string + return ret + } + return *o.SideNvrs +} + +// GetSideNvrsOk returns a tuple with the SideNvrs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetSideNvrsOk() (*[]string, bool) { + if o == nil || o.SideNvrs == nil { + return nil, false + } + return o.SideNvrs, true +} + +// HasSideNvrs returns a boolean if a field has been set. +func (o *InlineObject2) HasSideNvrs() bool { + if o != nil && o.SideNvrs != nil { + return true + } + + return false +} + +// SetSideNvrs gets a reference to the given []string and assigns it to the SideNvrs field. +func (o *InlineObject2) SetSideNvrs(v []string) { + o.SideNvrs = &v +} + +// GetSetInactive returns the SetInactive field value if set, zero value otherwise. +func (o *InlineObject2) GetSetInactive() bool { + if o == nil || o.SetInactive == nil { + var ret bool + return ret + } + return *o.SetInactive +} + +// GetSetInactiveOk returns a tuple with the SetInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetSetInactiveOk() (*bool, bool) { + if o == nil || o.SetInactive == nil { + return nil, false + } + return o.SetInactive, true +} + +// HasSetInactive returns a boolean if a field has been set. +func (o *InlineObject2) HasSetInactive() bool { + if o != nil && o.SetInactive != nil { + return true + } + + return false +} + +// SetSetInactive gets a reference to the given bool and assigns it to the SetInactive field. +func (o *InlineObject2) SetSetInactive(v bool) { + o.SetInactive = &v +} + +func (o InlineObject2) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.PackageName != nil { + toSerialize["packageName"] = o.PackageName + } + if o.PackageId != nil { + toSerialize["packageId"] = o.PackageId + } + if o.ScmHash != nil { + toSerialize["scmHash"] = o.ScmHash + } + if o.DisableChecks != nil { + toSerialize["disableChecks"] = o.DisableChecks + } + if o.Branches != nil { + toSerialize["branches"] = o.Branches + } + if o.ModuleVariant != nil { + toSerialize["moduleVariant"] = o.ModuleVariant + } + if o.SideNvrs != nil { + toSerialize["sideNvrs"] = o.SideNvrs + } + if o.SetInactive != nil { + toSerialize["setInactive"] = o.SetInactive + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject2 struct { + value *InlineObject2 + isSet bool +} + +func (v NullableInlineObject2) Get() *InlineObject2 { + return v.value +} + +func (v *NullableInlineObject2) Set(val *InlineObject2) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject2) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject2(val *InlineObject2) *NullableInlineObject2 { + return &NullableInlineObject2{value: val, isSet: true} +} + +func (v NullableInlineObject2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_3.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_3.go new file mode 100644 index 0000000..d74bc66 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_3.go @@ -0,0 +1,153 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject3 struct for InlineObject3 +type InlineObject3 struct { + // Previously uploaded RPM tarball + Rpms *string `json:"rpms,omitempty"` + // Overwrite existing RPMs even if NVRA is locked Useful for secure boot scenarios for example + ForceOverride *bool `json:"forceOverride,omitempty"` +} + +// NewInlineObject3 instantiates a new InlineObject3 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 NewInlineObject3() *InlineObject3 { + this := InlineObject3{} + return &this +} + +// NewInlineObject3WithDefaults instantiates a new InlineObject3 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 NewInlineObject3WithDefaults() *InlineObject3 { + this := InlineObject3{} + return &this +} + +// GetRpms returns the Rpms field value if set, zero value otherwise. +func (o *InlineObject3) GetRpms() string { + if o == nil || o.Rpms == nil { + var ret string + return ret + } + return *o.Rpms +} + +// GetRpmsOk returns a tuple with the Rpms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetRpmsOk() (*string, bool) { + if o == nil || o.Rpms == nil { + return nil, false + } + return o.Rpms, true +} + +// HasRpms returns a boolean if a field has been set. +func (o *InlineObject3) HasRpms() bool { + if o != nil && o.Rpms != nil { + return true + } + + return false +} + +// SetRpms gets a reference to the given string and assigns it to the Rpms field. +func (o *InlineObject3) SetRpms(v string) { + o.Rpms = &v +} + +// GetForceOverride returns the ForceOverride field value if set, zero value otherwise. +func (o *InlineObject3) GetForceOverride() bool { + if o == nil || o.ForceOverride == nil { + var ret bool + return ret + } + return *o.ForceOverride +} + +// GetForceOverrideOk returns a tuple with the ForceOverride field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetForceOverrideOk() (*bool, bool) { + if o == nil || o.ForceOverride == nil { + return nil, false + } + return o.ForceOverride, true +} + +// HasForceOverride returns a boolean if a field has been set. +func (o *InlineObject3) HasForceOverride() bool { + if o != nil && o.ForceOverride != nil { + return true + } + + return false +} + +// SetForceOverride gets a reference to the given bool and assigns it to the ForceOverride field. +func (o *InlineObject3) SetForceOverride(v bool) { + o.ForceOverride = &v +} + +func (o InlineObject3) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Rpms != nil { + toSerialize["rpms"] = o.Rpms + } + if o.ForceOverride != nil { + toSerialize["forceOverride"] = o.ForceOverride + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject3 struct { + value *InlineObject3 + isSet bool +} + +func (v NullableInlineObject3) Get() *InlineObject3 { + return v.value +} + +func (v *NullableInlineObject3) Set(val *InlineObject3) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject3) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject3(val *InlineObject3) *NullableInlineObject3 { + return &NullableInlineObject3{value: val, isSet: true} +} + +func (v NullableInlineObject3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_4.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_4.go new file mode 100644 index 0000000..d4085be --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_4.go @@ -0,0 +1,153 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject4 struct for InlineObject4 +type InlineObject4 struct { + // Previously uploaded RPM tarball + LookasideBlobs *[]string `json:"lookasideBlobs,omitempty"` + // Overwrite existing RPMs even if NVRA is locked Useful for secure boot scenarios for example + ForceOverride *bool `json:"forceOverride,omitempty"` +} + +// NewInlineObject4 instantiates a new InlineObject4 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 NewInlineObject4() *InlineObject4 { + this := InlineObject4{} + return &this +} + +// NewInlineObject4WithDefaults instantiates a new InlineObject4 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 NewInlineObject4WithDefaults() *InlineObject4 { + this := InlineObject4{} + return &this +} + +// GetLookasideBlobs returns the LookasideBlobs field value if set, zero value otherwise. +func (o *InlineObject4) GetLookasideBlobs() []string { + if o == nil || o.LookasideBlobs == nil { + var ret []string + return ret + } + return *o.LookasideBlobs +} + +// GetLookasideBlobsOk returns a tuple with the LookasideBlobs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetLookasideBlobsOk() (*[]string, bool) { + if o == nil || o.LookasideBlobs == nil { + return nil, false + } + return o.LookasideBlobs, true +} + +// HasLookasideBlobs returns a boolean if a field has been set. +func (o *InlineObject4) HasLookasideBlobs() bool { + if o != nil && o.LookasideBlobs != nil { + return true + } + + return false +} + +// SetLookasideBlobs gets a reference to the given []string and assigns it to the LookasideBlobs field. +func (o *InlineObject4) SetLookasideBlobs(v []string) { + o.LookasideBlobs = &v +} + +// GetForceOverride returns the ForceOverride field value if set, zero value otherwise. +func (o *InlineObject4) GetForceOverride() bool { + if o == nil || o.ForceOverride == nil { + var ret bool + return ret + } + return *o.ForceOverride +} + +// GetForceOverrideOk returns a tuple with the ForceOverride field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetForceOverrideOk() (*bool, bool) { + if o == nil || o.ForceOverride == nil { + return nil, false + } + return o.ForceOverride, true +} + +// HasForceOverride returns a boolean if a field has been set. +func (o *InlineObject4) HasForceOverride() bool { + if o != nil && o.ForceOverride != nil { + return true + } + + return false +} + +// SetForceOverride gets a reference to the given bool and assigns it to the ForceOverride field. +func (o *InlineObject4) SetForceOverride(v bool) { + o.ForceOverride = &v +} + +func (o InlineObject4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.LookasideBlobs != nil { + toSerialize["lookasideBlobs"] = o.LookasideBlobs + } + if o.ForceOverride != nil { + toSerialize["forceOverride"] = o.ForceOverride + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject4 struct { + value *InlineObject4 + isSet bool +} + +func (v NullableInlineObject4) Get() *InlineObject4 { + return v.value +} + +func (v *NullableInlineObject4) Set(val *InlineObject4) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject4) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject4(val *InlineObject4) *NullableInlineObject4 { + return &NullableInlineObject4{value: val, isSet: true} +} + +func (v NullableInlineObject4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_5.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_5.go new file mode 100644 index 0000000..e46520c --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_5.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject5 struct for InlineObject5 +type InlineObject5 struct { + ScmUrl *string `json:"scmUrl,omitempty"` + Branch *string `json:"branch,omitempty"` +} + +// NewInlineObject5 instantiates a new InlineObject5 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 NewInlineObject5() *InlineObject5 { + this := InlineObject5{} + return &this +} + +// NewInlineObject5WithDefaults instantiates a new InlineObject5 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 NewInlineObject5WithDefaults() *InlineObject5 { + this := InlineObject5{} + return &this +} + +// GetScmUrl returns the ScmUrl field value if set, zero value otherwise. +func (o *InlineObject5) GetScmUrl() string { + if o == nil || o.ScmUrl == nil { + var ret string + return ret + } + return *o.ScmUrl +} + +// GetScmUrlOk returns a tuple with the ScmUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetScmUrlOk() (*string, bool) { + if o == nil || o.ScmUrl == nil { + return nil, false + } + return o.ScmUrl, true +} + +// HasScmUrl returns a boolean if a field has been set. +func (o *InlineObject5) HasScmUrl() bool { + if o != nil && o.ScmUrl != nil { + return true + } + + return false +} + +// SetScmUrl gets a reference to the given string and assigns it to the ScmUrl field. +func (o *InlineObject5) SetScmUrl(v string) { + o.ScmUrl = &v +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *InlineObject5) GetBranch() string { + if o == nil || o.Branch == nil { + 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 *InlineObject5) GetBranchOk() (*string, bool) { + if o == nil || o.Branch == nil { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *InlineObject5) HasBranch() bool { + if o != nil && o.Branch != nil { + return true + } + + return false +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *InlineObject5) SetBranch(v string) { + o.Branch = &v +} + +func (o InlineObject5) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ScmUrl != nil { + toSerialize["scmUrl"] = o.ScmUrl + } + if o.Branch != nil { + toSerialize["branch"] = o.Branch + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject5 struct { + value *InlineObject5 + isSet bool +} + +func (v NullableInlineObject5) Get() *InlineObject5 { + return v.value +} + +func (v *NullableInlineObject5) Set(val *InlineObject5) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject5) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject5) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject5(val *InlineObject5) *NullableInlineObject5 { + return &NullableInlineObject5{value: val, isSet: true} +} + +func (v NullableInlineObject5) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject5) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_6.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_6.go new file mode 100644 index 0000000..bdb7431 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_6.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject6 struct for InlineObject6 +type InlineObject6 struct { + GitlabUsername *string `json:"gitlabUsername,omitempty"` + GitlabPassword *string `json:"gitlabPassword,omitempty"` +} + +// NewInlineObject6 instantiates a new InlineObject6 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 NewInlineObject6() *InlineObject6 { + this := InlineObject6{} + return &this +} + +// NewInlineObject6WithDefaults instantiates a new InlineObject6 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 NewInlineObject6WithDefaults() *InlineObject6 { + this := InlineObject6{} + return &this +} + +// GetGitlabUsername returns the GitlabUsername field value if set, zero value otherwise. +func (o *InlineObject6) GetGitlabUsername() string { + if o == nil || o.GitlabUsername == nil { + var ret string + return ret + } + return *o.GitlabUsername +} + +// GetGitlabUsernameOk returns a tuple with the GitlabUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject6) GetGitlabUsernameOk() (*string, bool) { + if o == nil || o.GitlabUsername == nil { + return nil, false + } + return o.GitlabUsername, true +} + +// HasGitlabUsername returns a boolean if a field has been set. +func (o *InlineObject6) HasGitlabUsername() bool { + if o != nil && o.GitlabUsername != nil { + return true + } + + return false +} + +// SetGitlabUsername gets a reference to the given string and assigns it to the GitlabUsername field. +func (o *InlineObject6) SetGitlabUsername(v string) { + o.GitlabUsername = &v +} + +// GetGitlabPassword returns the GitlabPassword field value if set, zero value otherwise. +func (o *InlineObject6) GetGitlabPassword() string { + if o == nil || o.GitlabPassword == nil { + var ret string + return ret + } + return *o.GitlabPassword +} + +// GetGitlabPasswordOk returns a tuple with the GitlabPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject6) GetGitlabPasswordOk() (*string, bool) { + if o == nil || o.GitlabPassword == nil { + return nil, false + } + return o.GitlabPassword, true +} + +// HasGitlabPassword returns a boolean if a field has been set. +func (o *InlineObject6) HasGitlabPassword() bool { + if o != nil && o.GitlabPassword != nil { + return true + } + + return false +} + +// SetGitlabPassword gets a reference to the given string and assigns it to the GitlabPassword field. +func (o *InlineObject6) SetGitlabPassword(v string) { + o.GitlabPassword = &v +} + +func (o InlineObject6) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.GitlabUsername != nil { + toSerialize["gitlabUsername"] = o.GitlabUsername + } + if o.GitlabPassword != nil { + toSerialize["gitlabPassword"] = o.GitlabPassword + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject6 struct { + value *InlineObject6 + isSet bool +} + +func (v NullableInlineObject6) Get() *InlineObject6 { + return v.value +} + +func (v *NullableInlineObject6) Set(val *InlineObject6) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject6) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject6(val *InlineObject6) *NullableInlineObject6 { + return &NullableInlineObject6{value: val, isSet: true} +} + +func (v NullableInlineObject6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_7.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_7.go new file mode 100644 index 0000000..ea58ce2 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_7.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject7 struct for InlineObject7 +type InlineObject7 struct { + Imports *[]V1ImportPackageRequest `json:"imports,omitempty"` +} + +// NewInlineObject7 instantiates a new InlineObject7 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 NewInlineObject7() *InlineObject7 { + this := InlineObject7{} + return &this +} + +// NewInlineObject7WithDefaults instantiates a new InlineObject7 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 NewInlineObject7WithDefaults() *InlineObject7 { + this := InlineObject7{} + return &this +} + +// GetImports returns the Imports field value if set, zero value otherwise. +func (o *InlineObject7) GetImports() []V1ImportPackageRequest { + if o == nil || o.Imports == nil { + var ret []V1ImportPackageRequest + return ret + } + return *o.Imports +} + +// GetImportsOk returns a tuple with the Imports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject7) GetImportsOk() (*[]V1ImportPackageRequest, bool) { + if o == nil || o.Imports == nil { + return nil, false + } + return o.Imports, true +} + +// HasImports returns a boolean if a field has been set. +func (o *InlineObject7) HasImports() bool { + if o != nil && o.Imports != nil { + return true + } + + return false +} + +// SetImports gets a reference to the given []V1ImportPackageRequest and assigns it to the Imports field. +func (o *InlineObject7) SetImports(v []V1ImportPackageRequest) { + o.Imports = &v +} + +func (o InlineObject7) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Imports != nil { + toSerialize["imports"] = o.Imports + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject7 struct { + value *InlineObject7 + isSet bool +} + +func (v NullableInlineObject7) Get() *InlineObject7 { + return v.value +} + +func (v *NullableInlineObject7) Set(val *InlineObject7) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject7) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject7) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject7(val *InlineObject7) *NullableInlineObject7 { + return &NullableInlineObject7{value: val, isSet: true} +} + +func (v NullableInlineObject7) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject7) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_8.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_8.go new file mode 100644 index 0000000..55bbd8e --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_inline_object_8.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// InlineObject8 struct for InlineObject8 +type InlineObject8 struct { + Repositories *[]string `json:"repositories,omitempty"` +} + +// NewInlineObject8 instantiates a new InlineObject8 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 NewInlineObject8() *InlineObject8 { + this := InlineObject8{} + return &this +} + +// NewInlineObject8WithDefaults instantiates a new InlineObject8 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 NewInlineObject8WithDefaults() *InlineObject8 { + this := InlineObject8{} + return &this +} + +// GetRepositories returns the Repositories field value if set, zero value otherwise. +func (o *InlineObject8) GetRepositories() []string { + if o == nil || o.Repositories == nil { + var ret []string + return ret + } + return *o.Repositories +} + +// GetRepositoriesOk returns a tuple with the Repositories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject8) GetRepositoriesOk() (*[]string, bool) { + if o == nil || o.Repositories == nil { + return nil, false + } + return o.Repositories, true +} + +// HasRepositories returns a boolean if a field has been set. +func (o *InlineObject8) HasRepositories() bool { + if o != nil && o.Repositories != nil { + return true + } + + return false +} + +// SetRepositories gets a reference to the given []string and assigns it to the Repositories field. +func (o *InlineObject8) SetRepositories(v []string) { + o.Repositories = &v +} + +func (o InlineObject8) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Repositories != nil { + toSerialize["repositories"] = o.Repositories + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject8 struct { + value *InlineObject8 + isSet bool +} + +func (v NullableInlineObject8) Get() *InlineObject8 { + return v.value +} + +func (v *NullableInlineObject8) Set(val *InlineObject8) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject8) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject8) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject8(val *InlineObject8) *NullableInlineObject8 { + return &NullableInlineObject8{value: val, isSet: true} +} + +func (v NullableInlineObject8) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject8) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_protobuf_any.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_protobuf_any.go new file mode 100644 index 0000000..4aa3e15 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_protobuf_any.go @@ -0,0 +1,116 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": , \"lastName\": } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" } +type ProtobufAny struct { + // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics. + Type *string `json:"@type,omitempty"` +} + +// NewProtobufAny instantiates a new ProtobufAny 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 NewProtobufAny() *ProtobufAny { + this := ProtobufAny{} + return &this +} + +// NewProtobufAnyWithDefaults instantiates a new ProtobufAny 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 NewProtobufAnyWithDefaults() *ProtobufAny { + this := ProtobufAny{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ProtobufAny) GetType() string { + if o == nil || o.Type == nil { + 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 *ProtobufAny) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ProtobufAny) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ProtobufAny) SetType(v string) { + o.Type = &v +} + +func (o ProtobufAny) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["@type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableProtobufAny struct { + value *ProtobufAny + isSet bool +} + +func (v NullableProtobufAny) Get() *ProtobufAny { + return v.value +} + +func (v *NullableProtobufAny) Set(val *ProtobufAny) { + v.value = val + v.isSet = true +} + +func (v NullableProtobufAny) IsSet() bool { + return v.isSet +} + +func (v *NullableProtobufAny) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtobufAny(val *ProtobufAny) *NullableProtobufAny { + return &NullableProtobufAny{value: val, isSet: true} +} + +func (v NullableProtobufAny) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtobufAny) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_rpc_status.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_rpc_status.go new file mode 100644 index 0000000..8aec1a7 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_rpc_status.go @@ -0,0 +1,187 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// RpcStatus struct for RpcStatus +type RpcStatus struct { + Code *int32 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Details *[]ProtobufAny `json:"details,omitempty"` +} + +// NewRpcStatus instantiates a new RpcStatus 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 NewRpcStatus() *RpcStatus { + this := RpcStatus{} + return &this +} + +// NewRpcStatusWithDefaults instantiates a new RpcStatus 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 NewRpcStatusWithDefaults() *RpcStatus { + this := RpcStatus{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *RpcStatus) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RpcStatus) GetCodeOk() (*int32, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *RpcStatus) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *RpcStatus) SetCode(v int32) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *RpcStatus) GetMessage() string { + if o == nil || o.Message == nil { + 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 *RpcStatus) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *RpcStatus) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *RpcStatus) SetMessage(v string) { + o.Message = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *RpcStatus) GetDetails() []ProtobufAny { + if o == nil || o.Details == nil { + var ret []ProtobufAny + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RpcStatus) GetDetailsOk() (*[]ProtobufAny, bool) { + if o == nil || o.Details == nil { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *RpcStatus) HasDetails() bool { + if o != nil && o.Details != nil { + return true + } + + return false +} + +// SetDetails gets a reference to the given []ProtobufAny and assigns it to the Details field. +func (o *RpcStatus) SetDetails(v []ProtobufAny) { + o.Details = &v +} + +func (o RpcStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Details != nil { + toSerialize["details"] = o.Details + } + return json.Marshal(toSerialize) +} + +type NullableRpcStatus struct { + value *RpcStatus + isSet bool +} + +func (v NullableRpcStatus) Get() *RpcStatus { + return v.value +} + +func (v *NullableRpcStatus) Set(val *RpcStatus) { + v.value = val + v.isSet = true +} + +func (v NullableRpcStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableRpcStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRpcStatus(val *RpcStatus) *NullableRpcStatus { + return &NullableRpcStatus{value: val, isSet: true} +} + +func (v NullableRpcStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRpcStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_api_http_body.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_api_http_body.go new file mode 100644 index 0000000..3f2b7c2 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_api_http_body.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// StreamResultOfApiHttpBody struct for StreamResultOfApiHttpBody +type StreamResultOfApiHttpBody struct { + Result *ApiHttpBody `json:"result,omitempty"` + Error *RpcStatus `json:"error,omitempty"` +} + +// NewStreamResultOfApiHttpBody instantiates a new StreamResultOfApiHttpBody 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 NewStreamResultOfApiHttpBody() *StreamResultOfApiHttpBody { + this := StreamResultOfApiHttpBody{} + return &this +} + +// NewStreamResultOfApiHttpBodyWithDefaults instantiates a new StreamResultOfApiHttpBody 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 NewStreamResultOfApiHttpBodyWithDefaults() *StreamResultOfApiHttpBody { + this := StreamResultOfApiHttpBody{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *StreamResultOfApiHttpBody) GetResult() ApiHttpBody { + if o == nil || o.Result == nil { + var ret ApiHttpBody + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamResultOfApiHttpBody) GetResultOk() (*ApiHttpBody, bool) { + if o == nil || o.Result == nil { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *StreamResultOfApiHttpBody) HasResult() bool { + if o != nil && o.Result != nil { + return true + } + + return false +} + +// SetResult gets a reference to the given ApiHttpBody and assigns it to the Result field. +func (o *StreamResultOfApiHttpBody) SetResult(v ApiHttpBody) { + o.Result = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *StreamResultOfApiHttpBody) GetError() RpcStatus { + if o == nil || o.Error == nil { + var ret RpcStatus + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamResultOfApiHttpBody) GetErrorOk() (*RpcStatus, bool) { + if o == nil || o.Error == nil { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *StreamResultOfApiHttpBody) HasError() bool { + if o != nil && o.Error != nil { + return true + } + + return false +} + +// SetError gets a reference to the given RpcStatus and assigns it to the Error field. +func (o *StreamResultOfApiHttpBody) SetError(v RpcStatus) { + o.Error = &v +} + +func (o StreamResultOfApiHttpBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Result != nil { + toSerialize["result"] = o.Result + } + if o.Error != nil { + toSerialize["error"] = o.Error + } + return json.Marshal(toSerialize) +} + +type NullableStreamResultOfApiHttpBody struct { + value *StreamResultOfApiHttpBody + isSet bool +} + +func (v NullableStreamResultOfApiHttpBody) Get() *StreamResultOfApiHttpBody { + return v.value +} + +func (v *NullableStreamResultOfApiHttpBody) Set(val *StreamResultOfApiHttpBody) { + v.value = val + v.isSet = true +} + +func (v NullableStreamResultOfApiHttpBody) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamResultOfApiHttpBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamResultOfApiHttpBody(val *StreamResultOfApiHttpBody) *NullableStreamResultOfApiHttpBody { + return &NullableStreamResultOfApiHttpBody{value: val, isSet: true} +} + +func (v NullableStreamResultOfApiHttpBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamResultOfApiHttpBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_v1_search_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_v1_search_response.go new file mode 100644 index 0000000..6fb632b --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_stream_result_of_v1_search_response.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// StreamResultOfV1SearchResponse struct for StreamResultOfV1SearchResponse +type StreamResultOfV1SearchResponse struct { + Result *V1SearchResponse `json:"result,omitempty"` + Error *RpcStatus `json:"error,omitempty"` +} + +// NewStreamResultOfV1SearchResponse instantiates a new StreamResultOfV1SearchResponse 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 NewStreamResultOfV1SearchResponse() *StreamResultOfV1SearchResponse { + this := StreamResultOfV1SearchResponse{} + return &this +} + +// NewStreamResultOfV1SearchResponseWithDefaults instantiates a new StreamResultOfV1SearchResponse 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 NewStreamResultOfV1SearchResponseWithDefaults() *StreamResultOfV1SearchResponse { + this := StreamResultOfV1SearchResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *StreamResultOfV1SearchResponse) GetResult() V1SearchResponse { + if o == nil || o.Result == nil { + var ret V1SearchResponse + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamResultOfV1SearchResponse) GetResultOk() (*V1SearchResponse, bool) { + if o == nil || o.Result == nil { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *StreamResultOfV1SearchResponse) HasResult() bool { + if o != nil && o.Result != nil { + return true + } + + return false +} + +// SetResult gets a reference to the given V1SearchResponse and assigns it to the Result field. +func (o *StreamResultOfV1SearchResponse) SetResult(v V1SearchResponse) { + o.Result = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *StreamResultOfV1SearchResponse) GetError() RpcStatus { + if o == nil || o.Error == nil { + var ret RpcStatus + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamResultOfV1SearchResponse) GetErrorOk() (*RpcStatus, bool) { + if o == nil || o.Error == nil { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *StreamResultOfV1SearchResponse) HasError() bool { + if o != nil && o.Error != nil { + return true + } + + return false +} + +// SetError gets a reference to the given RpcStatus and assigns it to the Error field. +func (o *StreamResultOfV1SearchResponse) SetError(v RpcStatus) { + o.Error = &v +} + +func (o StreamResultOfV1SearchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Result != nil { + toSerialize["result"] = o.Result + } + if o.Error != nil { + toSerialize["error"] = o.Error + } + return json.Marshal(toSerialize) +} + +type NullableStreamResultOfV1SearchResponse struct { + value *StreamResultOfV1SearchResponse + isSet bool +} + +func (v NullableStreamResultOfV1SearchResponse) Get() *StreamResultOfV1SearchResponse { + return v.value +} + +func (v *NullableStreamResultOfV1SearchResponse) Set(val *StreamResultOfV1SearchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableStreamResultOfV1SearchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamResultOfV1SearchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamResultOfV1SearchResponse(val *StreamResultOfV1SearchResponse) *NullableStreamResultOfV1SearchResponse { + return &NullableStreamResultOfV1SearchResponse{value: val, isSet: true} +} + +func (v NullableStreamResultOfV1SearchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamResultOfV1SearchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_async_task.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_async_task.go new file mode 100644 index 0000000..197e6d7 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_async_task.go @@ -0,0 +1,187 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1AsyncTask AsyncTask represents a collection of subunits of tasks that wholly works towards a specific goal. +type V1AsyncTask struct { + TaskId *string `json:"taskId,omitempty"` + Subtasks *[]V1Subtask `json:"subtasks,omitempty"` + Done *bool `json:"done,omitempty"` +} + +// NewV1AsyncTask instantiates a new V1AsyncTask 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 NewV1AsyncTask() *V1AsyncTask { + this := V1AsyncTask{} + return &this +} + +// NewV1AsyncTaskWithDefaults instantiates a new V1AsyncTask 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 NewV1AsyncTaskWithDefaults() *V1AsyncTask { + this := V1AsyncTask{} + return &this +} + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *V1AsyncTask) GetTaskId() string { + if o == nil || o.TaskId == nil { + var ret string + return ret + } + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1AsyncTask) GetTaskIdOk() (*string, bool) { + if o == nil || o.TaskId == nil { + return nil, false + } + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *V1AsyncTask) HasTaskId() bool { + if o != nil && o.TaskId != nil { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *V1AsyncTask) SetTaskId(v string) { + o.TaskId = &v +} + +// GetSubtasks returns the Subtasks field value if set, zero value otherwise. +func (o *V1AsyncTask) GetSubtasks() []V1Subtask { + if o == nil || o.Subtasks == nil { + var ret []V1Subtask + return ret + } + return *o.Subtasks +} + +// GetSubtasksOk returns a tuple with the Subtasks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1AsyncTask) GetSubtasksOk() (*[]V1Subtask, bool) { + if o == nil || o.Subtasks == nil { + return nil, false + } + return o.Subtasks, true +} + +// HasSubtasks returns a boolean if a field has been set. +func (o *V1AsyncTask) HasSubtasks() bool { + if o != nil && o.Subtasks != nil { + return true + } + + return false +} + +// SetSubtasks gets a reference to the given []V1Subtask and assigns it to the Subtasks field. +func (o *V1AsyncTask) SetSubtasks(v []V1Subtask) { + o.Subtasks = &v +} + +// GetDone returns the Done field value if set, zero value otherwise. +func (o *V1AsyncTask) GetDone() bool { + if o == nil || o.Done == nil { + var ret bool + return ret + } + return *o.Done +} + +// GetDoneOk returns a tuple with the Done field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1AsyncTask) GetDoneOk() (*bool, bool) { + if o == nil || o.Done == nil { + return nil, false + } + return o.Done, true +} + +// HasDone returns a boolean if a field has been set. +func (o *V1AsyncTask) HasDone() bool { + if o != nil && o.Done != nil { + return true + } + + return false +} + +// SetDone gets a reference to the given bool and assigns it to the Done field. +func (o *V1AsyncTask) SetDone(v bool) { + o.Done = &v +} + +func (o V1AsyncTask) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.TaskId != nil { + toSerialize["taskId"] = o.TaskId + } + if o.Subtasks != nil { + toSerialize["subtasks"] = o.Subtasks + } + if o.Done != nil { + toSerialize["done"] = o.Done + } + return json.Marshal(toSerialize) +} + +type NullableV1AsyncTask struct { + value *V1AsyncTask + isSet bool +} + +func (v NullableV1AsyncTask) Get() *V1AsyncTask { + return v.value +} + +func (v *NullableV1AsyncTask) Set(val *V1AsyncTask) { + v.value = val + v.isSet = true +} + +func (v NullableV1AsyncTask) IsSet() bool { + return v.isSet +} + +func (v *NullableV1AsyncTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1AsyncTask(val *V1AsyncTask) *NullableV1AsyncTask { + return &NullableV1AsyncTask{value: val, isSet: true} +} + +func (v NullableV1AsyncTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1AsyncTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_batch_filter.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_batch_filter.go new file mode 100644 index 0000000..3c6735e --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_batch_filter.go @@ -0,0 +1,119 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1BatchFilter struct for V1BatchFilter +type V1BatchFilter struct { + Status *V1TaskStatus `json:"status,omitempty"` +} + +// NewV1BatchFilter instantiates a new V1BatchFilter 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 NewV1BatchFilter() *V1BatchFilter { + this := V1BatchFilter{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// NewV1BatchFilterWithDefaults instantiates a new V1BatchFilter 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 NewV1BatchFilterWithDefaults() *V1BatchFilter { + this := V1BatchFilter{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V1BatchFilter) GetStatus() V1TaskStatus { + if o == nil || o.Status == nil { + var ret V1TaskStatus + 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 *V1BatchFilter) GetStatusOk() (*V1TaskStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V1BatchFilter) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given V1TaskStatus and assigns it to the Status field. +func (o *V1BatchFilter) SetStatus(v V1TaskStatus) { + o.Status = &v +} + +func (o V1BatchFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableV1BatchFilter struct { + value *V1BatchFilter + isSet bool +} + +func (v NullableV1BatchFilter) Get() *V1BatchFilter { + return v.value +} + +func (v *NullableV1BatchFilter) Set(val *V1BatchFilter) { + v.value = val + v.isSet = true +} + +func (v NullableV1BatchFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableV1BatchFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1BatchFilter(val *V1BatchFilter) *NullableV1BatchFilter { + return &NullableV1BatchFilter{value: val, isSet: true} +} + +func (v NullableV1BatchFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1BatchFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build.go new file mode 100644 index 0000000..9a2ead8 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build.go @@ -0,0 +1,300 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Build struct for V1Build +type V1Build struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Name *string `json:"name,omitempty"` + ImportRevisions *[]V1ImportRevision `json:"importRevisions,omitempty"` + TaskId *string `json:"taskId,omitempty"` + Status *V1TaskStatus `json:"status,omitempty"` +} + +// NewV1Build instantiates a new V1Build 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 NewV1Build() *V1Build { + this := V1Build{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// NewV1BuildWithDefaults instantiates a new V1Build 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 NewV1BuildWithDefaults() *V1Build { + this := V1Build{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Build) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Build) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Build) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Build) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1Build) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1Build) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1Build) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1Build) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1Build) GetName() string { + if o == nil || o.Name == nil { + 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 *V1Build) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1Build) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1Build) SetName(v string) { + o.Name = &v +} + +// GetImportRevisions returns the ImportRevisions field value if set, zero value otherwise. +func (o *V1Build) GetImportRevisions() []V1ImportRevision { + if o == nil || o.ImportRevisions == nil { + var ret []V1ImportRevision + return ret + } + return *o.ImportRevisions +} + +// GetImportRevisionsOk returns a tuple with the ImportRevisions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Build) GetImportRevisionsOk() (*[]V1ImportRevision, bool) { + if o == nil || o.ImportRevisions == nil { + return nil, false + } + return o.ImportRevisions, true +} + +// HasImportRevisions returns a boolean if a field has been set. +func (o *V1Build) HasImportRevisions() bool { + if o != nil && o.ImportRevisions != nil { + return true + } + + return false +} + +// SetImportRevisions gets a reference to the given []V1ImportRevision and assigns it to the ImportRevisions field. +func (o *V1Build) SetImportRevisions(v []V1ImportRevision) { + o.ImportRevisions = &v +} + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *V1Build) GetTaskId() string { + if o == nil || o.TaskId == nil { + var ret string + return ret + } + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Build) GetTaskIdOk() (*string, bool) { + if o == nil || o.TaskId == nil { + return nil, false + } + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *V1Build) HasTaskId() bool { + if o != nil && o.TaskId != nil { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *V1Build) SetTaskId(v string) { + o.TaskId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V1Build) GetStatus() V1TaskStatus { + if o == nil || o.Status == nil { + var ret V1TaskStatus + 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 *V1Build) GetStatusOk() (*V1TaskStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V1Build) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given V1TaskStatus and assigns it to the Status field. +func (o *V1Build) SetStatus(v V1TaskStatus) { + o.Status = &v +} + +func (o V1Build) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ImportRevisions != nil { + toSerialize["importRevisions"] = o.ImportRevisions + } + if o.TaskId != nil { + toSerialize["taskId"] = o.TaskId + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableV1Build struct { + value *V1Build + isSet bool +} + +func (v NullableV1Build) Get() *V1Build { + return v.value +} + +func (v *NullableV1Build) Set(val *V1Build) { + v.value = val + v.isSet = true +} + +func (v NullableV1Build) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Build) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Build(val *V1Build) *NullableV1Build { + return &NullableV1Build{value: val, isSet: true} +} + +func (v NullableV1Build) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Build) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_batch.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_batch.go new file mode 100644 index 0000000..56e45cf --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_batch.go @@ -0,0 +1,368 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1BuildBatch struct for V1BuildBatch +type V1BuildBatch struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Count *int32 `json:"count,omitempty"` + Pending *int32 `json:"pending,omitempty"` + Running *int32 `json:"running,omitempty"` + Succeeded *int32 `json:"succeeded,omitempty"` + Failed *int32 `json:"failed,omitempty"` + Canceled *int32 `json:"canceled,omitempty"` +} + +// NewV1BuildBatch instantiates a new V1BuildBatch 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 NewV1BuildBatch() *V1BuildBatch { + this := V1BuildBatch{} + return &this +} + +// NewV1BuildBatchWithDefaults instantiates a new V1BuildBatch 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 NewV1BuildBatchWithDefaults() *V1BuildBatch { + this := V1BuildBatch{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1BuildBatch) GetId() string { + if o == nil || o.Id == nil { + 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 *V1BuildBatch) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1BuildBatch) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1BuildBatch) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1BuildBatch) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1BuildBatch) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1BuildBatch) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1BuildBatch) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *V1BuildBatch) GetCount() int32 { + if o == nil || o.Count == nil { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetCountOk() (*int32, bool) { + if o == nil || o.Count == nil { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *V1BuildBatch) HasCount() bool { + if o != nil && o.Count != nil { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *V1BuildBatch) SetCount(v int32) { + o.Count = &v +} + +// GetPending returns the Pending field value if set, zero value otherwise. +func (o *V1BuildBatch) GetPending() int32 { + if o == nil || o.Pending == nil { + var ret int32 + return ret + } + return *o.Pending +} + +// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetPendingOk() (*int32, bool) { + if o == nil || o.Pending == nil { + return nil, false + } + return o.Pending, true +} + +// HasPending returns a boolean if a field has been set. +func (o *V1BuildBatch) HasPending() bool { + if o != nil && o.Pending != nil { + return true + } + + return false +} + +// SetPending gets a reference to the given int32 and assigns it to the Pending field. +func (o *V1BuildBatch) SetPending(v int32) { + o.Pending = &v +} + +// GetRunning returns the Running field value if set, zero value otherwise. +func (o *V1BuildBatch) GetRunning() int32 { + if o == nil || o.Running == nil { + var ret int32 + return ret + } + return *o.Running +} + +// GetRunningOk returns a tuple with the Running field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetRunningOk() (*int32, bool) { + if o == nil || o.Running == nil { + return nil, false + } + return o.Running, true +} + +// HasRunning returns a boolean if a field has been set. +func (o *V1BuildBatch) HasRunning() bool { + if o != nil && o.Running != nil { + return true + } + + return false +} + +// SetRunning gets a reference to the given int32 and assigns it to the Running field. +func (o *V1BuildBatch) SetRunning(v int32) { + o.Running = &v +} + +// GetSucceeded returns the Succeeded field value if set, zero value otherwise. +func (o *V1BuildBatch) GetSucceeded() int32 { + if o == nil || o.Succeeded == nil { + var ret int32 + return ret + } + return *o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetSucceededOk() (*int32, bool) { + if o == nil || o.Succeeded == nil { + return nil, false + } + return o.Succeeded, true +} + +// HasSucceeded returns a boolean if a field has been set. +func (o *V1BuildBatch) HasSucceeded() bool { + if o != nil && o.Succeeded != nil { + return true + } + + return false +} + +// SetSucceeded gets a reference to the given int32 and assigns it to the Succeeded field. +func (o *V1BuildBatch) SetSucceeded(v int32) { + o.Succeeded = &v +} + +// GetFailed returns the Failed field value if set, zero value otherwise. +func (o *V1BuildBatch) GetFailed() int32 { + if o == nil || o.Failed == nil { + var ret int32 + return ret + } + return *o.Failed +} + +// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetFailedOk() (*int32, bool) { + if o == nil || o.Failed == nil { + return nil, false + } + return o.Failed, true +} + +// HasFailed returns a boolean if a field has been set. +func (o *V1BuildBatch) HasFailed() bool { + if o != nil && o.Failed != nil { + return true + } + + return false +} + +// SetFailed gets a reference to the given int32 and assigns it to the Failed field. +func (o *V1BuildBatch) SetFailed(v int32) { + o.Failed = &v +} + +// GetCanceled returns the Canceled field value if set, zero value otherwise. +func (o *V1BuildBatch) GetCanceled() int32 { + if o == nil || o.Canceled == nil { + var ret int32 + return ret + } + return *o.Canceled +} + +// GetCanceledOk returns a tuple with the Canceled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1BuildBatch) GetCanceledOk() (*int32, bool) { + if o == nil || o.Canceled == nil { + return nil, false + } + return o.Canceled, true +} + +// HasCanceled returns a boolean if a field has been set. +func (o *V1BuildBatch) HasCanceled() bool { + if o != nil && o.Canceled != nil { + return true + } + + return false +} + +// SetCanceled gets a reference to the given int32 and assigns it to the Canceled field. +func (o *V1BuildBatch) SetCanceled(v int32) { + o.Canceled = &v +} + +func (o V1BuildBatch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Count != nil { + toSerialize["count"] = o.Count + } + if o.Pending != nil { + toSerialize["pending"] = o.Pending + } + if o.Running != nil { + toSerialize["running"] = o.Running + } + if o.Succeeded != nil { + toSerialize["succeeded"] = o.Succeeded + } + if o.Failed != nil { + toSerialize["failed"] = o.Failed + } + if o.Canceled != nil { + toSerialize["canceled"] = o.Canceled + } + return json.Marshal(toSerialize) +} + +type NullableV1BuildBatch struct { + value *V1BuildBatch + isSet bool +} + +func (v NullableV1BuildBatch) Get() *V1BuildBatch { + return v.value +} + +func (v *NullableV1BuildBatch) Set(val *V1BuildBatch) { + v.value = val + v.isSet = true +} + +func (v NullableV1BuildBatch) IsSet() bool { + return v.isSet +} + +func (v *NullableV1BuildBatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1BuildBatch(val *V1BuildBatch) *NullableV1BuildBatch { + return &NullableV1BuildBatch{value: val, isSet: true} +} + +func (v NullableV1BuildBatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1BuildBatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_filters.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_filters.go new file mode 100644 index 0000000..3d646cd --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_build_filters.go @@ -0,0 +1,119 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1BuildFilters struct for V1BuildFilters +type V1BuildFilters struct { + Status *V1TaskStatus `json:"status,omitempty"` +} + +// NewV1BuildFilters instantiates a new V1BuildFilters 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 NewV1BuildFilters() *V1BuildFilters { + this := V1BuildFilters{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// NewV1BuildFiltersWithDefaults instantiates a new V1BuildFilters 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 NewV1BuildFiltersWithDefaults() *V1BuildFilters { + this := V1BuildFilters{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V1BuildFilters) GetStatus() V1TaskStatus { + if o == nil || o.Status == nil { + var ret V1TaskStatus + 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 *V1BuildFilters) GetStatusOk() (*V1TaskStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V1BuildFilters) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given V1TaskStatus and assigns it to the Status field. +func (o *V1BuildFilters) SetStatus(v V1TaskStatus) { + o.Status = &v +} + +func (o V1BuildFilters) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableV1BuildFilters struct { + value *V1BuildFilters + isSet bool +} + +func (v NullableV1BuildFilters) Get() *V1BuildFilters { + return v.value +} + +func (v *NullableV1BuildFilters) Set(val *V1BuildFilters) { + v.value = val + v.isSet = true +} + +func (v NullableV1BuildFilters) IsSet() bool { + return v.isSet +} + +func (v *NullableV1BuildFilters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1BuildFilters(val *V1BuildFilters) *NullableV1BuildFilters { + return &NullableV1BuildFilters{value: val, isSet: true} +} + +func (v NullableV1BuildFilters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1BuildFilters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_request.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_request.go new file mode 100644 index 0000000..a234071 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_request.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1CreateProjectRequest struct for V1CreateProjectRequest +type V1CreateProjectRequest struct { + Project *V1Project `json:"project,omitempty"` +} + +// NewV1CreateProjectRequest instantiates a new V1CreateProjectRequest 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 NewV1CreateProjectRequest() *V1CreateProjectRequest { + this := V1CreateProjectRequest{} + return &this +} + +// NewV1CreateProjectRequestWithDefaults instantiates a new V1CreateProjectRequest 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 NewV1CreateProjectRequestWithDefaults() *V1CreateProjectRequest { + this := V1CreateProjectRequest{} + return &this +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *V1CreateProjectRequest) GetProject() V1Project { + if o == nil || o.Project == nil { + var ret V1Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1CreateProjectRequest) GetProjectOk() (*V1Project, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *V1CreateProjectRequest) HasProject() bool { + if o != nil && o.Project != nil { + return true + } + + return false +} + +// SetProject gets a reference to the given V1Project and assigns it to the Project field. +func (o *V1CreateProjectRequest) SetProject(v V1Project) { + o.Project = &v +} + +func (o V1CreateProjectRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Project != nil { + toSerialize["project"] = o.Project + } + return json.Marshal(toSerialize) +} + +type NullableV1CreateProjectRequest struct { + value *V1CreateProjectRequest + isSet bool +} + +func (v NullableV1CreateProjectRequest) Get() *V1CreateProjectRequest { + return v.value +} + +func (v *NullableV1CreateProjectRequest) Set(val *V1CreateProjectRequest) { + v.value = val + v.isSet = true +} + +func (v NullableV1CreateProjectRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableV1CreateProjectRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1CreateProjectRequest(val *V1CreateProjectRequest) *NullableV1CreateProjectRequest { + return &NullableV1CreateProjectRequest{value: val, isSet: true} +} + +func (v NullableV1CreateProjectRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1CreateProjectRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_response.go new file mode 100644 index 0000000..3e7c429 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_create_project_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1CreateProjectResponse struct for V1CreateProjectResponse +type V1CreateProjectResponse struct { + Project *V1Project `json:"project,omitempty"` +} + +// NewV1CreateProjectResponse instantiates a new V1CreateProjectResponse 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 NewV1CreateProjectResponse() *V1CreateProjectResponse { + this := V1CreateProjectResponse{} + return &this +} + +// NewV1CreateProjectResponseWithDefaults instantiates a new V1CreateProjectResponse 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 NewV1CreateProjectResponseWithDefaults() *V1CreateProjectResponse { + this := V1CreateProjectResponse{} + return &this +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *V1CreateProjectResponse) GetProject() V1Project { + if o == nil || o.Project == nil { + var ret V1Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1CreateProjectResponse) GetProjectOk() (*V1Project, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *V1CreateProjectResponse) HasProject() bool { + if o != nil && o.Project != nil { + return true + } + + return false +} + +// SetProject gets a reference to the given V1Project and assigns it to the Project field. +func (o *V1CreateProjectResponse) SetProject(v V1Project) { + o.Project = &v +} + +func (o V1CreateProjectResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Project != nil { + toSerialize["project"] = o.Project + } + return json.Marshal(toSerialize) +} + +type NullableV1CreateProjectResponse struct { + value *V1CreateProjectResponse + isSet bool +} + +func (v NullableV1CreateProjectResponse) Get() *V1CreateProjectResponse { + return v.value +} + +func (v *NullableV1CreateProjectResponse) Set(val *V1CreateProjectResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1CreateProjectResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1CreateProjectResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1CreateProjectResponse(val *V1CreateProjectResponse) *NullableV1CreateProjectResponse { + return &NullableV1CreateProjectResponse{value: val, isSet: true} +} + +func (v NullableV1CreateProjectResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1CreateProjectResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_batch_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_batch_response.go new file mode 100644 index 0000000..ba1f0da --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_batch_response.go @@ -0,0 +1,403 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetBuildBatchResponse struct for V1GetBuildBatchResponse +type V1GetBuildBatchResponse struct { + Builds *[]V1Build `json:"builds,omitempty"` + Pending *int32 `json:"pending,omitempty"` + Running *int32 `json:"running,omitempty"` + Succeeded *int32 `json:"succeeded,omitempty"` + Failed *int32 `json:"failed,omitempty"` + Canceled *int32 `json:"canceled,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1GetBuildBatchResponse instantiates a new V1GetBuildBatchResponse 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 NewV1GetBuildBatchResponse() *V1GetBuildBatchResponse { + this := V1GetBuildBatchResponse{} + return &this +} + +// NewV1GetBuildBatchResponseWithDefaults instantiates a new V1GetBuildBatchResponse 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 NewV1GetBuildBatchResponseWithDefaults() *V1GetBuildBatchResponse { + this := V1GetBuildBatchResponse{} + return &this +} + +// GetBuilds returns the Builds field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetBuilds() []V1Build { + if o == nil || o.Builds == nil { + var ret []V1Build + return ret + } + return *o.Builds +} + +// GetBuildsOk returns a tuple with the Builds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetBuildsOk() (*[]V1Build, bool) { + if o == nil || o.Builds == nil { + return nil, false + } + return o.Builds, true +} + +// HasBuilds returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasBuilds() bool { + if o != nil && o.Builds != nil { + return true + } + + return false +} + +// SetBuilds gets a reference to the given []V1Build and assigns it to the Builds field. +func (o *V1GetBuildBatchResponse) SetBuilds(v []V1Build) { + o.Builds = &v +} + +// GetPending returns the Pending field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetPending() int32 { + if o == nil || o.Pending == nil { + var ret int32 + return ret + } + return *o.Pending +} + +// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetPendingOk() (*int32, bool) { + if o == nil || o.Pending == nil { + return nil, false + } + return o.Pending, true +} + +// HasPending returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasPending() bool { + if o != nil && o.Pending != nil { + return true + } + + return false +} + +// SetPending gets a reference to the given int32 and assigns it to the Pending field. +func (o *V1GetBuildBatchResponse) SetPending(v int32) { + o.Pending = &v +} + +// GetRunning returns the Running field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetRunning() int32 { + if o == nil || o.Running == nil { + var ret int32 + return ret + } + return *o.Running +} + +// GetRunningOk returns a tuple with the Running field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetRunningOk() (*int32, bool) { + if o == nil || o.Running == nil { + return nil, false + } + return o.Running, true +} + +// HasRunning returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasRunning() bool { + if o != nil && o.Running != nil { + return true + } + + return false +} + +// SetRunning gets a reference to the given int32 and assigns it to the Running field. +func (o *V1GetBuildBatchResponse) SetRunning(v int32) { + o.Running = &v +} + +// GetSucceeded returns the Succeeded field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetSucceeded() int32 { + if o == nil || o.Succeeded == nil { + var ret int32 + return ret + } + return *o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetSucceededOk() (*int32, bool) { + if o == nil || o.Succeeded == nil { + return nil, false + } + return o.Succeeded, true +} + +// HasSucceeded returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasSucceeded() bool { + if o != nil && o.Succeeded != nil { + return true + } + + return false +} + +// SetSucceeded gets a reference to the given int32 and assigns it to the Succeeded field. +func (o *V1GetBuildBatchResponse) SetSucceeded(v int32) { + o.Succeeded = &v +} + +// GetFailed returns the Failed field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetFailed() int32 { + if o == nil || o.Failed == nil { + var ret int32 + return ret + } + return *o.Failed +} + +// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetFailedOk() (*int32, bool) { + if o == nil || o.Failed == nil { + return nil, false + } + return o.Failed, true +} + +// HasFailed returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasFailed() bool { + if o != nil && o.Failed != nil { + return true + } + + return false +} + +// SetFailed gets a reference to the given int32 and assigns it to the Failed field. +func (o *V1GetBuildBatchResponse) SetFailed(v int32) { + o.Failed = &v +} + +// GetCanceled returns the Canceled field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetCanceled() int32 { + if o == nil || o.Canceled == nil { + var ret int32 + return ret + } + return *o.Canceled +} + +// GetCanceledOk returns a tuple with the Canceled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetCanceledOk() (*int32, bool) { + if o == nil || o.Canceled == nil { + return nil, false + } + return o.Canceled, true +} + +// HasCanceled returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasCanceled() bool { + if o != nil && o.Canceled != nil { + return true + } + + return false +} + +// SetCanceled gets a reference to the given int32 and assigns it to the Canceled field. +func (o *V1GetBuildBatchResponse) SetCanceled(v int32) { + o.Canceled = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1GetBuildBatchResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1GetBuildBatchResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1GetBuildBatchResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1GetBuildBatchResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildBatchResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1GetBuildBatchResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1GetBuildBatchResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1GetBuildBatchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Builds != nil { + toSerialize["builds"] = o.Builds + } + if o.Pending != nil { + toSerialize["pending"] = o.Pending + } + if o.Running != nil { + toSerialize["running"] = o.Running + } + if o.Succeeded != nil { + toSerialize["succeeded"] = o.Succeeded + } + if o.Failed != nil { + toSerialize["failed"] = o.Failed + } + if o.Canceled != nil { + toSerialize["canceled"] = o.Canceled + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1GetBuildBatchResponse struct { + value *V1GetBuildBatchResponse + isSet bool +} + +func (v NullableV1GetBuildBatchResponse) Get() *V1GetBuildBatchResponse { + return v.value +} + +func (v *NullableV1GetBuildBatchResponse) Set(val *V1GetBuildBatchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetBuildBatchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetBuildBatchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetBuildBatchResponse(val *V1GetBuildBatchResponse) *NullableV1GetBuildBatchResponse { + return &NullableV1GetBuildBatchResponse{value: val, isSet: true} +} + +func (v NullableV1GetBuildBatchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetBuildBatchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_response.go new file mode 100644 index 0000000..101b656 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_build_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetBuildResponse struct for V1GetBuildResponse +type V1GetBuildResponse struct { + Build *V1Build `json:"build,omitempty"` +} + +// NewV1GetBuildResponse instantiates a new V1GetBuildResponse 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 NewV1GetBuildResponse() *V1GetBuildResponse { + this := V1GetBuildResponse{} + return &this +} + +// NewV1GetBuildResponseWithDefaults instantiates a new V1GetBuildResponse 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 NewV1GetBuildResponseWithDefaults() *V1GetBuildResponse { + this := V1GetBuildResponse{} + return &this +} + +// GetBuild returns the Build field value if set, zero value otherwise. +func (o *V1GetBuildResponse) GetBuild() V1Build { + if o == nil || o.Build == nil { + var ret V1Build + return ret + } + return *o.Build +} + +// GetBuildOk returns a tuple with the Build field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetBuildResponse) GetBuildOk() (*V1Build, bool) { + if o == nil || o.Build == nil { + return nil, false + } + return o.Build, true +} + +// HasBuild returns a boolean if a field has been set. +func (o *V1GetBuildResponse) HasBuild() bool { + if o != nil && o.Build != nil { + return true + } + + return false +} + +// SetBuild gets a reference to the given V1Build and assigns it to the Build field. +func (o *V1GetBuildResponse) SetBuild(v V1Build) { + o.Build = &v +} + +func (o V1GetBuildResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Build != nil { + toSerialize["build"] = o.Build + } + return json.Marshal(toSerialize) +} + +type NullableV1GetBuildResponse struct { + value *V1GetBuildResponse + isSet bool +} + +func (v NullableV1GetBuildResponse) Get() *V1GetBuildResponse { + return v.value +} + +func (v *NullableV1GetBuildResponse) Set(val *V1GetBuildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetBuildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetBuildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetBuildResponse(val *V1GetBuildResponse) *NullableV1GetBuildResponse { + return &NullableV1GetBuildResponse{value: val, isSet: true} +} + +func (v NullableV1GetBuildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetBuildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_batch_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_batch_response.go new file mode 100644 index 0000000..3da6bc0 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_batch_response.go @@ -0,0 +1,403 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetImportBatchResponse struct for V1GetImportBatchResponse +type V1GetImportBatchResponse struct { + Imports *[]V1Import `json:"imports,omitempty"` + Pending *int32 `json:"pending,omitempty"` + Running *int32 `json:"running,omitempty"` + Succeeded *int32 `json:"succeeded,omitempty"` + Failed *int32 `json:"failed,omitempty"` + Canceled *int32 `json:"canceled,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1GetImportBatchResponse instantiates a new V1GetImportBatchResponse 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 NewV1GetImportBatchResponse() *V1GetImportBatchResponse { + this := V1GetImportBatchResponse{} + return &this +} + +// NewV1GetImportBatchResponseWithDefaults instantiates a new V1GetImportBatchResponse 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 NewV1GetImportBatchResponseWithDefaults() *V1GetImportBatchResponse { + this := V1GetImportBatchResponse{} + return &this +} + +// GetImports returns the Imports field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetImports() []V1Import { + if o == nil || o.Imports == nil { + var ret []V1Import + return ret + } + return *o.Imports +} + +// GetImportsOk returns a tuple with the Imports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetImportsOk() (*[]V1Import, bool) { + if o == nil || o.Imports == nil { + return nil, false + } + return o.Imports, true +} + +// HasImports returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasImports() bool { + if o != nil && o.Imports != nil { + return true + } + + return false +} + +// SetImports gets a reference to the given []V1Import and assigns it to the Imports field. +func (o *V1GetImportBatchResponse) SetImports(v []V1Import) { + o.Imports = &v +} + +// GetPending returns the Pending field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetPending() int32 { + if o == nil || o.Pending == nil { + var ret int32 + return ret + } + return *o.Pending +} + +// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetPendingOk() (*int32, bool) { + if o == nil || o.Pending == nil { + return nil, false + } + return o.Pending, true +} + +// HasPending returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasPending() bool { + if o != nil && o.Pending != nil { + return true + } + + return false +} + +// SetPending gets a reference to the given int32 and assigns it to the Pending field. +func (o *V1GetImportBatchResponse) SetPending(v int32) { + o.Pending = &v +} + +// GetRunning returns the Running field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetRunning() int32 { + if o == nil || o.Running == nil { + var ret int32 + return ret + } + return *o.Running +} + +// GetRunningOk returns a tuple with the Running field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetRunningOk() (*int32, bool) { + if o == nil || o.Running == nil { + return nil, false + } + return o.Running, true +} + +// HasRunning returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasRunning() bool { + if o != nil && o.Running != nil { + return true + } + + return false +} + +// SetRunning gets a reference to the given int32 and assigns it to the Running field. +func (o *V1GetImportBatchResponse) SetRunning(v int32) { + o.Running = &v +} + +// GetSucceeded returns the Succeeded field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetSucceeded() int32 { + if o == nil || o.Succeeded == nil { + var ret int32 + return ret + } + return *o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetSucceededOk() (*int32, bool) { + if o == nil || o.Succeeded == nil { + return nil, false + } + return o.Succeeded, true +} + +// HasSucceeded returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasSucceeded() bool { + if o != nil && o.Succeeded != nil { + return true + } + + return false +} + +// SetSucceeded gets a reference to the given int32 and assigns it to the Succeeded field. +func (o *V1GetImportBatchResponse) SetSucceeded(v int32) { + o.Succeeded = &v +} + +// GetFailed returns the Failed field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetFailed() int32 { + if o == nil || o.Failed == nil { + var ret int32 + return ret + } + return *o.Failed +} + +// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetFailedOk() (*int32, bool) { + if o == nil || o.Failed == nil { + return nil, false + } + return o.Failed, true +} + +// HasFailed returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasFailed() bool { + if o != nil && o.Failed != nil { + return true + } + + return false +} + +// SetFailed gets a reference to the given int32 and assigns it to the Failed field. +func (o *V1GetImportBatchResponse) SetFailed(v int32) { + o.Failed = &v +} + +// GetCanceled returns the Canceled field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetCanceled() int32 { + if o == nil || o.Canceled == nil { + var ret int32 + return ret + } + return *o.Canceled +} + +// GetCanceledOk returns a tuple with the Canceled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetCanceledOk() (*int32, bool) { + if o == nil || o.Canceled == nil { + return nil, false + } + return o.Canceled, true +} + +// HasCanceled returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasCanceled() bool { + if o != nil && o.Canceled != nil { + return true + } + + return false +} + +// SetCanceled gets a reference to the given int32 and assigns it to the Canceled field. +func (o *V1GetImportBatchResponse) SetCanceled(v int32) { + o.Canceled = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1GetImportBatchResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1GetImportBatchResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1GetImportBatchResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1GetImportBatchResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportBatchResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1GetImportBatchResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1GetImportBatchResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1GetImportBatchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Imports != nil { + toSerialize["imports"] = o.Imports + } + if o.Pending != nil { + toSerialize["pending"] = o.Pending + } + if o.Running != nil { + toSerialize["running"] = o.Running + } + if o.Succeeded != nil { + toSerialize["succeeded"] = o.Succeeded + } + if o.Failed != nil { + toSerialize["failed"] = o.Failed + } + if o.Canceled != nil { + toSerialize["canceled"] = o.Canceled + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1GetImportBatchResponse struct { + value *V1GetImportBatchResponse + isSet bool +} + +func (v NullableV1GetImportBatchResponse) Get() *V1GetImportBatchResponse { + return v.value +} + +func (v *NullableV1GetImportBatchResponse) Set(val *V1GetImportBatchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetImportBatchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetImportBatchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetImportBatchResponse(val *V1GetImportBatchResponse) *NullableV1GetImportBatchResponse { + return &NullableV1GetImportBatchResponse{value: val, isSet: true} +} + +func (v NullableV1GetImportBatchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetImportBatchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_response.go new file mode 100644 index 0000000..1a39c10 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_import_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetImportResponse struct for V1GetImportResponse +type V1GetImportResponse struct { + Import *V1Import `json:"import,omitempty"` +} + +// NewV1GetImportResponse instantiates a new V1GetImportResponse 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 NewV1GetImportResponse() *V1GetImportResponse { + this := V1GetImportResponse{} + return &this +} + +// NewV1GetImportResponseWithDefaults instantiates a new V1GetImportResponse 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 NewV1GetImportResponseWithDefaults() *V1GetImportResponse { + this := V1GetImportResponse{} + return &this +} + +// GetImport returns the Import field value if set, zero value otherwise. +func (o *V1GetImportResponse) GetImport() V1Import { + if o == nil || o.Import == nil { + var ret V1Import + return ret + } + return *o.Import +} + +// GetImportOk returns a tuple with the Import field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetImportResponse) GetImportOk() (*V1Import, bool) { + if o == nil || o.Import == nil { + return nil, false + } + return o.Import, true +} + +// HasImport returns a boolean if a field has been set. +func (o *V1GetImportResponse) HasImport() bool { + if o != nil && o.Import != nil { + return true + } + + return false +} + +// SetImport gets a reference to the given V1Import and assigns it to the Import field. +func (o *V1GetImportResponse) SetImport(v V1Import) { + o.Import = &v +} + +func (o V1GetImportResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Import != nil { + toSerialize["import"] = o.Import + } + return json.Marshal(toSerialize) +} + +type NullableV1GetImportResponse struct { + value *V1GetImportResponse + isSet bool +} + +func (v NullableV1GetImportResponse) Get() *V1GetImportResponse { + return v.value +} + +func (v *NullableV1GetImportResponse) Set(val *V1GetImportResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetImportResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetImportResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetImportResponse(val *V1GetImportResponse) *NullableV1GetImportResponse { + return &NullableV1GetImportResponse{value: val, isSet: true} +} + +func (v NullableV1GetImportResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetImportResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_package_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_package_response.go new file mode 100644 index 0000000..e0491d0 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_package_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetPackageResponse struct for V1GetPackageResponse +type V1GetPackageResponse struct { + Package *V1Package `json:"package,omitempty"` +} + +// NewV1GetPackageResponse instantiates a new V1GetPackageResponse 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 NewV1GetPackageResponse() *V1GetPackageResponse { + this := V1GetPackageResponse{} + return &this +} + +// NewV1GetPackageResponseWithDefaults instantiates a new V1GetPackageResponse 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 NewV1GetPackageResponseWithDefaults() *V1GetPackageResponse { + this := V1GetPackageResponse{} + return &this +} + +// GetPackage returns the Package field value if set, zero value otherwise. +func (o *V1GetPackageResponse) GetPackage() V1Package { + if o == nil || o.Package == nil { + var ret V1Package + return ret + } + return *o.Package +} + +// GetPackageOk returns a tuple with the Package field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetPackageResponse) GetPackageOk() (*V1Package, bool) { + if o == nil || o.Package == nil { + return nil, false + } + return o.Package, true +} + +// HasPackage returns a boolean if a field has been set. +func (o *V1GetPackageResponse) HasPackage() bool { + if o != nil && o.Package != nil { + return true + } + + return false +} + +// SetPackage gets a reference to the given V1Package and assigns it to the Package field. +func (o *V1GetPackageResponse) SetPackage(v V1Package) { + o.Package = &v +} + +func (o V1GetPackageResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Package != nil { + toSerialize["package"] = o.Package + } + return json.Marshal(toSerialize) +} + +type NullableV1GetPackageResponse struct { + value *V1GetPackageResponse + isSet bool +} + +func (v NullableV1GetPackageResponse) Get() *V1GetPackageResponse { + return v.value +} + +func (v *NullableV1GetPackageResponse) Set(val *V1GetPackageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetPackageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetPackageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetPackageResponse(val *V1GetPackageResponse) *NullableV1GetPackageResponse { + return &NullableV1GetPackageResponse{value: val, isSet: true} +} + +func (v NullableV1GetPackageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetPackageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_credentials_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_credentials_response.go new file mode 100644 index 0000000..fafc998 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_credentials_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetProjectCredentialsResponse struct for V1GetProjectCredentialsResponse +type V1GetProjectCredentialsResponse struct { + GitlabUsername *string `json:"gitlabUsername,omitempty"` +} + +// NewV1GetProjectCredentialsResponse instantiates a new V1GetProjectCredentialsResponse 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 NewV1GetProjectCredentialsResponse() *V1GetProjectCredentialsResponse { + this := V1GetProjectCredentialsResponse{} + return &this +} + +// NewV1GetProjectCredentialsResponseWithDefaults instantiates a new V1GetProjectCredentialsResponse 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 NewV1GetProjectCredentialsResponseWithDefaults() *V1GetProjectCredentialsResponse { + this := V1GetProjectCredentialsResponse{} + return &this +} + +// GetGitlabUsername returns the GitlabUsername field value if set, zero value otherwise. +func (o *V1GetProjectCredentialsResponse) GetGitlabUsername() string { + if o == nil || o.GitlabUsername == nil { + var ret string + return ret + } + return *o.GitlabUsername +} + +// GetGitlabUsernameOk returns a tuple with the GitlabUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetProjectCredentialsResponse) GetGitlabUsernameOk() (*string, bool) { + if o == nil || o.GitlabUsername == nil { + return nil, false + } + return o.GitlabUsername, true +} + +// HasGitlabUsername returns a boolean if a field has been set. +func (o *V1GetProjectCredentialsResponse) HasGitlabUsername() bool { + if o != nil && o.GitlabUsername != nil { + return true + } + + return false +} + +// SetGitlabUsername gets a reference to the given string and assigns it to the GitlabUsername field. +func (o *V1GetProjectCredentialsResponse) SetGitlabUsername(v string) { + o.GitlabUsername = &v +} + +func (o V1GetProjectCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.GitlabUsername != nil { + toSerialize["gitlabUsername"] = o.GitlabUsername + } + return json.Marshal(toSerialize) +} + +type NullableV1GetProjectCredentialsResponse struct { + value *V1GetProjectCredentialsResponse + isSet bool +} + +func (v NullableV1GetProjectCredentialsResponse) Get() *V1GetProjectCredentialsResponse { + return v.value +} + +func (v *NullableV1GetProjectCredentialsResponse) Set(val *V1GetProjectCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetProjectCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetProjectCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetProjectCredentialsResponse(val *V1GetProjectCredentialsResponse) *NullableV1GetProjectCredentialsResponse { + return &NullableV1GetProjectCredentialsResponse{value: val, isSet: true} +} + +func (v NullableV1GetProjectCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetProjectCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_response.go new file mode 100644 index 0000000..1f763a3 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_project_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetProjectResponse struct for V1GetProjectResponse +type V1GetProjectResponse struct { + Project *V1Project `json:"project,omitempty"` +} + +// NewV1GetProjectResponse instantiates a new V1GetProjectResponse 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 NewV1GetProjectResponse() *V1GetProjectResponse { + this := V1GetProjectResponse{} + return &this +} + +// NewV1GetProjectResponseWithDefaults instantiates a new V1GetProjectResponse 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 NewV1GetProjectResponseWithDefaults() *V1GetProjectResponse { + this := V1GetProjectResponse{} + return &this +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *V1GetProjectResponse) GetProject() V1Project { + if o == nil || o.Project == nil { + var ret V1Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetProjectResponse) GetProjectOk() (*V1Project, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *V1GetProjectResponse) HasProject() bool { + if o != nil && o.Project != nil { + return true + } + + return false +} + +// SetProject gets a reference to the given V1Project and assigns it to the Project field. +func (o *V1GetProjectResponse) SetProject(v V1Project) { + o.Project = &v +} + +func (o V1GetProjectResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Project != nil { + toSerialize["project"] = o.Project + } + return json.Marshal(toSerialize) +} + +type NullableV1GetProjectResponse struct { + value *V1GetProjectResponse + isSet bool +} + +func (v NullableV1GetProjectResponse) Get() *V1GetProjectResponse { + return v.value +} + +func (v *NullableV1GetProjectResponse) Set(val *V1GetProjectResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetProjectResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetProjectResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetProjectResponse(val *V1GetProjectResponse) *NullableV1GetProjectResponse { + return &NullableV1GetProjectResponse{value: val, isSet: true} +} + +func (v NullableV1GetProjectResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetProjectResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_repository_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_repository_response.go new file mode 100644 index 0000000..0e566c9 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_repository_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetRepositoryResponse struct for V1GetRepositoryResponse +type V1GetRepositoryResponse struct { + Repository *V1Repository `json:"repository,omitempty"` +} + +// NewV1GetRepositoryResponse instantiates a new V1GetRepositoryResponse 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 NewV1GetRepositoryResponse() *V1GetRepositoryResponse { + this := V1GetRepositoryResponse{} + return &this +} + +// NewV1GetRepositoryResponseWithDefaults instantiates a new V1GetRepositoryResponse 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 NewV1GetRepositoryResponseWithDefaults() *V1GetRepositoryResponse { + this := V1GetRepositoryResponse{} + return &this +} + +// GetRepository returns the Repository field value if set, zero value otherwise. +func (o *V1GetRepositoryResponse) GetRepository() V1Repository { + if o == nil || o.Repository == nil { + var ret V1Repository + return ret + } + return *o.Repository +} + +// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetRepositoryResponse) GetRepositoryOk() (*V1Repository, bool) { + if o == nil || o.Repository == nil { + return nil, false + } + return o.Repository, true +} + +// HasRepository returns a boolean if a field has been set. +func (o *V1GetRepositoryResponse) HasRepository() bool { + if o != nil && o.Repository != nil { + return true + } + + return false +} + +// SetRepository gets a reference to the given V1Repository and assigns it to the Repository field. +func (o *V1GetRepositoryResponse) SetRepository(v V1Repository) { + o.Repository = &v +} + +func (o V1GetRepositoryResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Repository != nil { + toSerialize["repository"] = o.Repository + } + return json.Marshal(toSerialize) +} + +type NullableV1GetRepositoryResponse struct { + value *V1GetRepositoryResponse + isSet bool +} + +func (v NullableV1GetRepositoryResponse) Get() *V1GetRepositoryResponse { + return v.value +} + +func (v *NullableV1GetRepositoryResponse) Set(val *V1GetRepositoryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetRepositoryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetRepositoryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetRepositoryResponse(val *V1GetRepositoryResponse) *NullableV1GetRepositoryResponse { + return &NullableV1GetRepositoryResponse{value: val, isSet: true} +} + +func (v NullableV1GetRepositoryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetRepositoryResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_task_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_task_response.go new file mode 100644 index 0000000..e91f0cf --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_get_task_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1GetTaskResponse struct for V1GetTaskResponse +type V1GetTaskResponse struct { + Task *V1AsyncTask `json:"task,omitempty"` +} + +// NewV1GetTaskResponse instantiates a new V1GetTaskResponse 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 NewV1GetTaskResponse() *V1GetTaskResponse { + this := V1GetTaskResponse{} + return &this +} + +// NewV1GetTaskResponseWithDefaults instantiates a new V1GetTaskResponse 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 NewV1GetTaskResponseWithDefaults() *V1GetTaskResponse { + this := V1GetTaskResponse{} + return &this +} + +// GetTask returns the Task field value if set, zero value otherwise. +func (o *V1GetTaskResponse) GetTask() V1AsyncTask { + if o == nil || o.Task == nil { + var ret V1AsyncTask + return ret + } + return *o.Task +} + +// GetTaskOk returns a tuple with the Task field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1GetTaskResponse) GetTaskOk() (*V1AsyncTask, bool) { + if o == nil || o.Task == nil { + return nil, false + } + return o.Task, true +} + +// HasTask returns a boolean if a field has been set. +func (o *V1GetTaskResponse) HasTask() bool { + if o != nil && o.Task != nil { + return true + } + + return false +} + +// SetTask gets a reference to the given V1AsyncTask and assigns it to the Task field. +func (o *V1GetTaskResponse) SetTask(v V1AsyncTask) { + o.Task = &v +} + +func (o V1GetTaskResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Task != nil { + toSerialize["task"] = o.Task + } + return json.Marshal(toSerialize) +} + +type NullableV1GetTaskResponse struct { + value *V1GetTaskResponse + isSet bool +} + +func (v NullableV1GetTaskResponse) Get() *V1GetTaskResponse { + return v.value +} + +func (v *NullableV1GetTaskResponse) Set(val *V1GetTaskResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1GetTaskResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1GetTaskResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1GetTaskResponse(val *V1GetTaskResponse) *NullableV1GetTaskResponse { + return &NullableV1GetTaskResponse{value: val, isSet: true} +} + +func (v NullableV1GetTaskResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1GetTaskResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import.go new file mode 100644 index 0000000..61f1d43 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import.go @@ -0,0 +1,300 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Import struct for V1Import +type V1Import struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Name *string `json:"name,omitempty"` + TaskId *string `json:"taskId,omitempty"` + Status *V1TaskStatus `json:"status,omitempty"` + Revisions *[]V1ImportRevision `json:"revisions,omitempty"` +} + +// NewV1Import instantiates a new V1Import 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 NewV1Import() *V1Import { + this := V1Import{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// NewV1ImportWithDefaults instantiates a new V1Import 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 NewV1ImportWithDefaults() *V1Import { + this := V1Import{} + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Import) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Import) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Import) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Import) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1Import) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1Import) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1Import) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1Import) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1Import) GetName() string { + if o == nil || o.Name == nil { + 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 *V1Import) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1Import) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1Import) SetName(v string) { + o.Name = &v +} + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *V1Import) GetTaskId() string { + if o == nil || o.TaskId == nil { + var ret string + return ret + } + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Import) GetTaskIdOk() (*string, bool) { + if o == nil || o.TaskId == nil { + return nil, false + } + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *V1Import) HasTaskId() bool { + if o != nil && o.TaskId != nil { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *V1Import) SetTaskId(v string) { + o.TaskId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V1Import) GetStatus() V1TaskStatus { + if o == nil || o.Status == nil { + var ret V1TaskStatus + 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 *V1Import) GetStatusOk() (*V1TaskStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V1Import) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given V1TaskStatus and assigns it to the Status field. +func (o *V1Import) SetStatus(v V1TaskStatus) { + o.Status = &v +} + +// GetRevisions returns the Revisions field value if set, zero value otherwise. +func (o *V1Import) GetRevisions() []V1ImportRevision { + if o == nil || o.Revisions == nil { + var ret []V1ImportRevision + return ret + } + return *o.Revisions +} + +// GetRevisionsOk returns a tuple with the Revisions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Import) GetRevisionsOk() (*[]V1ImportRevision, bool) { + if o == nil || o.Revisions == nil { + return nil, false + } + return o.Revisions, true +} + +// HasRevisions returns a boolean if a field has been set. +func (o *V1Import) HasRevisions() bool { + if o != nil && o.Revisions != nil { + return true + } + + return false +} + +// SetRevisions gets a reference to the given []V1ImportRevision and assigns it to the Revisions field. +func (o *V1Import) SetRevisions(v []V1ImportRevision) { + o.Revisions = &v +} + +func (o V1Import) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.TaskId != nil { + toSerialize["taskId"] = o.TaskId + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Revisions != nil { + toSerialize["revisions"] = o.Revisions + } + return json.Marshal(toSerialize) +} + +type NullableV1Import struct { + value *V1Import + isSet bool +} + +func (v NullableV1Import) Get() *V1Import { + return v.value +} + +func (v *NullableV1Import) Set(val *V1Import) { + v.value = val + v.isSet = true +} + +func (v NullableV1Import) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Import) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Import(val *V1Import) *NullableV1Import { + return &NullableV1Import{value: val, isSet: true} +} + +func (v NullableV1Import) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Import) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch.go new file mode 100644 index 0000000..3ed11fd --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch.go @@ -0,0 +1,368 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1ImportBatch struct for V1ImportBatch +type V1ImportBatch struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Count *int32 `json:"count,omitempty"` + Pending *int32 `json:"pending,omitempty"` + Running *int32 `json:"running,omitempty"` + Succeeded *int32 `json:"succeeded,omitempty"` + Failed *int32 `json:"failed,omitempty"` + Canceled *int32 `json:"canceled,omitempty"` +} + +// NewV1ImportBatch instantiates a new V1ImportBatch 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 NewV1ImportBatch() *V1ImportBatch { + this := V1ImportBatch{} + return &this +} + +// NewV1ImportBatchWithDefaults instantiates a new V1ImportBatch 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 NewV1ImportBatchWithDefaults() *V1ImportBatch { + this := V1ImportBatch{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1ImportBatch) GetId() string { + if o == nil || o.Id == nil { + 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 *V1ImportBatch) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1ImportBatch) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1ImportBatch) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1ImportBatch) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1ImportBatch) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1ImportBatch) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1ImportBatch) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *V1ImportBatch) GetCount() int32 { + if o == nil || o.Count == nil { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetCountOk() (*int32, bool) { + if o == nil || o.Count == nil { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *V1ImportBatch) HasCount() bool { + if o != nil && o.Count != nil { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *V1ImportBatch) SetCount(v int32) { + o.Count = &v +} + +// GetPending returns the Pending field value if set, zero value otherwise. +func (o *V1ImportBatch) GetPending() int32 { + if o == nil || o.Pending == nil { + var ret int32 + return ret + } + return *o.Pending +} + +// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetPendingOk() (*int32, bool) { + if o == nil || o.Pending == nil { + return nil, false + } + return o.Pending, true +} + +// HasPending returns a boolean if a field has been set. +func (o *V1ImportBatch) HasPending() bool { + if o != nil && o.Pending != nil { + return true + } + + return false +} + +// SetPending gets a reference to the given int32 and assigns it to the Pending field. +func (o *V1ImportBatch) SetPending(v int32) { + o.Pending = &v +} + +// GetRunning returns the Running field value if set, zero value otherwise. +func (o *V1ImportBatch) GetRunning() int32 { + if o == nil || o.Running == nil { + var ret int32 + return ret + } + return *o.Running +} + +// GetRunningOk returns a tuple with the Running field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetRunningOk() (*int32, bool) { + if o == nil || o.Running == nil { + return nil, false + } + return o.Running, true +} + +// HasRunning returns a boolean if a field has been set. +func (o *V1ImportBatch) HasRunning() bool { + if o != nil && o.Running != nil { + return true + } + + return false +} + +// SetRunning gets a reference to the given int32 and assigns it to the Running field. +func (o *V1ImportBatch) SetRunning(v int32) { + o.Running = &v +} + +// GetSucceeded returns the Succeeded field value if set, zero value otherwise. +func (o *V1ImportBatch) GetSucceeded() int32 { + if o == nil || o.Succeeded == nil { + var ret int32 + return ret + } + return *o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetSucceededOk() (*int32, bool) { + if o == nil || o.Succeeded == nil { + return nil, false + } + return o.Succeeded, true +} + +// HasSucceeded returns a boolean if a field has been set. +func (o *V1ImportBatch) HasSucceeded() bool { + if o != nil && o.Succeeded != nil { + return true + } + + return false +} + +// SetSucceeded gets a reference to the given int32 and assigns it to the Succeeded field. +func (o *V1ImportBatch) SetSucceeded(v int32) { + o.Succeeded = &v +} + +// GetFailed returns the Failed field value if set, zero value otherwise. +func (o *V1ImportBatch) GetFailed() int32 { + if o == nil || o.Failed == nil { + var ret int32 + return ret + } + return *o.Failed +} + +// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetFailedOk() (*int32, bool) { + if o == nil || o.Failed == nil { + return nil, false + } + return o.Failed, true +} + +// HasFailed returns a boolean if a field has been set. +func (o *V1ImportBatch) HasFailed() bool { + if o != nil && o.Failed != nil { + return true + } + + return false +} + +// SetFailed gets a reference to the given int32 and assigns it to the Failed field. +func (o *V1ImportBatch) SetFailed(v int32) { + o.Failed = &v +} + +// GetCanceled returns the Canceled field value if set, zero value otherwise. +func (o *V1ImportBatch) GetCanceled() int32 { + if o == nil || o.Canceled == nil { + var ret int32 + return ret + } + return *o.Canceled +} + +// GetCanceledOk returns a tuple with the Canceled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatch) GetCanceledOk() (*int32, bool) { + if o == nil || o.Canceled == nil { + return nil, false + } + return o.Canceled, true +} + +// HasCanceled returns a boolean if a field has been set. +func (o *V1ImportBatch) HasCanceled() bool { + if o != nil && o.Canceled != nil { + return true + } + + return false +} + +// SetCanceled gets a reference to the given int32 and assigns it to the Canceled field. +func (o *V1ImportBatch) SetCanceled(v int32) { + o.Canceled = &v +} + +func (o V1ImportBatch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Count != nil { + toSerialize["count"] = o.Count + } + if o.Pending != nil { + toSerialize["pending"] = o.Pending + } + if o.Running != nil { + toSerialize["running"] = o.Running + } + if o.Succeeded != nil { + toSerialize["succeeded"] = o.Succeeded + } + if o.Failed != nil { + toSerialize["failed"] = o.Failed + } + if o.Canceled != nil { + toSerialize["canceled"] = o.Canceled + } + return json.Marshal(toSerialize) +} + +type NullableV1ImportBatch struct { + value *V1ImportBatch + isSet bool +} + +func (v NullableV1ImportBatch) Get() *V1ImportBatch { + return v.value +} + +func (v *NullableV1ImportBatch) Set(val *V1ImportBatch) { + v.value = val + v.isSet = true +} + +func (v NullableV1ImportBatch) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ImportBatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ImportBatch(val *V1ImportBatch) *NullableV1ImportBatch { + return &NullableV1ImportBatch{value: val, isSet: true} +} + +func (v NullableV1ImportBatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ImportBatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch_retry_failed_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch_retry_failed_response.go new file mode 100644 index 0000000..37c7be9 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_batch_retry_failed_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ImportBatchRetryFailedResponse struct for V1ImportBatchRetryFailedResponse +type V1ImportBatchRetryFailedResponse struct { + ImportBatchId *string `json:"importBatchId,omitempty"` +} + +// NewV1ImportBatchRetryFailedResponse instantiates a new V1ImportBatchRetryFailedResponse 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 NewV1ImportBatchRetryFailedResponse() *V1ImportBatchRetryFailedResponse { + this := V1ImportBatchRetryFailedResponse{} + return &this +} + +// NewV1ImportBatchRetryFailedResponseWithDefaults instantiates a new V1ImportBatchRetryFailedResponse 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 NewV1ImportBatchRetryFailedResponseWithDefaults() *V1ImportBatchRetryFailedResponse { + this := V1ImportBatchRetryFailedResponse{} + return &this +} + +// GetImportBatchId returns the ImportBatchId field value if set, zero value otherwise. +func (o *V1ImportBatchRetryFailedResponse) GetImportBatchId() string { + if o == nil || o.ImportBatchId == nil { + var ret string + return ret + } + return *o.ImportBatchId +} + +// GetImportBatchIdOk returns a tuple with the ImportBatchId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportBatchRetryFailedResponse) GetImportBatchIdOk() (*string, bool) { + if o == nil || o.ImportBatchId == nil { + return nil, false + } + return o.ImportBatchId, true +} + +// HasImportBatchId returns a boolean if a field has been set. +func (o *V1ImportBatchRetryFailedResponse) HasImportBatchId() bool { + if o != nil && o.ImportBatchId != nil { + return true + } + + return false +} + +// SetImportBatchId gets a reference to the given string and assigns it to the ImportBatchId field. +func (o *V1ImportBatchRetryFailedResponse) SetImportBatchId(v string) { + o.ImportBatchId = &v +} + +func (o V1ImportBatchRetryFailedResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImportBatchId != nil { + toSerialize["importBatchId"] = o.ImportBatchId + } + return json.Marshal(toSerialize) +} + +type NullableV1ImportBatchRetryFailedResponse struct { + value *V1ImportBatchRetryFailedResponse + isSet bool +} + +func (v NullableV1ImportBatchRetryFailedResponse) Get() *V1ImportBatchRetryFailedResponse { + return v.value +} + +func (v *NullableV1ImportBatchRetryFailedResponse) Set(val *V1ImportBatchRetryFailedResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ImportBatchRetryFailedResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ImportBatchRetryFailedResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ImportBatchRetryFailedResponse(val *V1ImportBatchRetryFailedResponse) *NullableV1ImportBatchRetryFailedResponse { + return &NullableV1ImportBatchRetryFailedResponse{value: val, isSet: true} +} + +func (v NullableV1ImportBatchRetryFailedResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ImportBatchRetryFailedResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_batch_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_batch_response.go new file mode 100644 index 0000000..0c14ca1 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_batch_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ImportPackageBatchResponse struct for V1ImportPackageBatchResponse +type V1ImportPackageBatchResponse struct { + ImportBatchId *string `json:"importBatchId,omitempty"` +} + +// NewV1ImportPackageBatchResponse instantiates a new V1ImportPackageBatchResponse 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 NewV1ImportPackageBatchResponse() *V1ImportPackageBatchResponse { + this := V1ImportPackageBatchResponse{} + return &this +} + +// NewV1ImportPackageBatchResponseWithDefaults instantiates a new V1ImportPackageBatchResponse 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 NewV1ImportPackageBatchResponseWithDefaults() *V1ImportPackageBatchResponse { + this := V1ImportPackageBatchResponse{} + return &this +} + +// GetImportBatchId returns the ImportBatchId field value if set, zero value otherwise. +func (o *V1ImportPackageBatchResponse) GetImportBatchId() string { + if o == nil || o.ImportBatchId == nil { + var ret string + return ret + } + return *o.ImportBatchId +} + +// GetImportBatchIdOk returns a tuple with the ImportBatchId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportPackageBatchResponse) GetImportBatchIdOk() (*string, bool) { + if o == nil || o.ImportBatchId == nil { + return nil, false + } + return o.ImportBatchId, true +} + +// HasImportBatchId returns a boolean if a field has been set. +func (o *V1ImportPackageBatchResponse) HasImportBatchId() bool { + if o != nil && o.ImportBatchId != nil { + return true + } + + return false +} + +// SetImportBatchId gets a reference to the given string and assigns it to the ImportBatchId field. +func (o *V1ImportPackageBatchResponse) SetImportBatchId(v string) { + o.ImportBatchId = &v +} + +func (o V1ImportPackageBatchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImportBatchId != nil { + toSerialize["importBatchId"] = o.ImportBatchId + } + return json.Marshal(toSerialize) +} + +type NullableV1ImportPackageBatchResponse struct { + value *V1ImportPackageBatchResponse + isSet bool +} + +func (v NullableV1ImportPackageBatchResponse) Get() *V1ImportPackageBatchResponse { + return v.value +} + +func (v *NullableV1ImportPackageBatchResponse) Set(val *V1ImportPackageBatchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ImportPackageBatchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ImportPackageBatchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ImportPackageBatchResponse(val *V1ImportPackageBatchResponse) *NullableV1ImportPackageBatchResponse { + return &NullableV1ImportPackageBatchResponse{value: val, isSet: true} +} + +func (v NullableV1ImportPackageBatchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ImportPackageBatchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_request.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_request.go new file mode 100644 index 0000000..22f3fde --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_package_request.go @@ -0,0 +1,260 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ImportPackageRequest struct for V1ImportPackageRequest +type V1ImportPackageRequest struct { + // Project ID that we want this import to be assigned to All import requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + ProjectId *string `json:"projectId,omitempty"` + PackageName *string `json:"packageName,omitempty"` + PackageId *string `json:"packageId,omitempty"` + Vre *V1VersionRelease `json:"vre,omitempty"` + SetInactive *bool `json:"setInactive,omitempty"` +} + +// NewV1ImportPackageRequest instantiates a new V1ImportPackageRequest 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 NewV1ImportPackageRequest() *V1ImportPackageRequest { + this := V1ImportPackageRequest{} + return &this +} + +// NewV1ImportPackageRequestWithDefaults instantiates a new V1ImportPackageRequest 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 NewV1ImportPackageRequestWithDefaults() *V1ImportPackageRequest { + this := V1ImportPackageRequest{} + return &this +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *V1ImportPackageRequest) GetProjectId() string { + if o == nil || o.ProjectId == nil { + 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 *V1ImportPackageRequest) GetProjectIdOk() (*string, bool) { + if o == nil || o.ProjectId == nil { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *V1ImportPackageRequest) HasProjectId() bool { + if o != nil && o.ProjectId != nil { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *V1ImportPackageRequest) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *V1ImportPackageRequest) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportPackageRequest) GetPackageNameOk() (*string, bool) { + if o == nil || o.PackageName == nil { + return nil, false + } + return o.PackageName, true +} + +// HasPackageName returns a boolean if a field has been set. +func (o *V1ImportPackageRequest) HasPackageName() bool { + if o != nil && o.PackageName != nil { + return true + } + + return false +} + +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *V1ImportPackageRequest) SetPackageName(v string) { + o.PackageName = &v +} + +// GetPackageId returns the PackageId field value if set, zero value otherwise. +func (o *V1ImportPackageRequest) GetPackageId() string { + if o == nil || o.PackageId == nil { + var ret string + return ret + } + return *o.PackageId +} + +// GetPackageIdOk returns a tuple with the PackageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportPackageRequest) GetPackageIdOk() (*string, bool) { + if o == nil || o.PackageId == nil { + return nil, false + } + return o.PackageId, true +} + +// HasPackageId returns a boolean if a field has been set. +func (o *V1ImportPackageRequest) HasPackageId() bool { + if o != nil && o.PackageId != nil { + return true + } + + return false +} + +// SetPackageId gets a reference to the given string and assigns it to the PackageId field. +func (o *V1ImportPackageRequest) SetPackageId(v string) { + o.PackageId = &v +} + +// GetVre returns the Vre field value if set, zero value otherwise. +func (o *V1ImportPackageRequest) GetVre() V1VersionRelease { + if o == nil || o.Vre == nil { + var ret V1VersionRelease + return ret + } + return *o.Vre +} + +// GetVreOk returns a tuple with the Vre field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportPackageRequest) GetVreOk() (*V1VersionRelease, bool) { + if o == nil || o.Vre == nil { + return nil, false + } + return o.Vre, true +} + +// HasVre returns a boolean if a field has been set. +func (o *V1ImportPackageRequest) HasVre() bool { + if o != nil && o.Vre != nil { + return true + } + + return false +} + +// SetVre gets a reference to the given V1VersionRelease and assigns it to the Vre field. +func (o *V1ImportPackageRequest) SetVre(v V1VersionRelease) { + o.Vre = &v +} + +// GetSetInactive returns the SetInactive field value if set, zero value otherwise. +func (o *V1ImportPackageRequest) GetSetInactive() bool { + if o == nil || o.SetInactive == nil { + var ret bool + return ret + } + return *o.SetInactive +} + +// GetSetInactiveOk returns a tuple with the SetInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportPackageRequest) GetSetInactiveOk() (*bool, bool) { + if o == nil || o.SetInactive == nil { + return nil, false + } + return o.SetInactive, true +} + +// HasSetInactive returns a boolean if a field has been set. +func (o *V1ImportPackageRequest) HasSetInactive() bool { + if o != nil && o.SetInactive != nil { + return true + } + + return false +} + +// SetSetInactive gets a reference to the given bool and assigns it to the SetInactive field. +func (o *V1ImportPackageRequest) SetSetInactive(v bool) { + o.SetInactive = &v +} + +func (o V1ImportPackageRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ProjectId != nil { + toSerialize["projectId"] = o.ProjectId + } + if o.PackageName != nil { + toSerialize["packageName"] = o.PackageName + } + if o.PackageId != nil { + toSerialize["packageId"] = o.PackageId + } + if o.Vre != nil { + toSerialize["vre"] = o.Vre + } + if o.SetInactive != nil { + toSerialize["setInactive"] = o.SetInactive + } + return json.Marshal(toSerialize) +} + +type NullableV1ImportPackageRequest struct { + value *V1ImportPackageRequest + isSet bool +} + +func (v NullableV1ImportPackageRequest) Get() *V1ImportPackageRequest { + return v.value +} + +func (v *NullableV1ImportPackageRequest) Set(val *V1ImportPackageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableV1ImportPackageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ImportPackageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ImportPackageRequest(val *V1ImportPackageRequest) *NullableV1ImportPackageRequest { + return &NullableV1ImportPackageRequest{value: val, isSet: true} +} + +func (v NullableV1ImportPackageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ImportPackageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_revision.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_revision.go new file mode 100644 index 0000000..736babd --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_import_revision.go @@ -0,0 +1,331 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ImportRevision ImportRevision is SCM metadata as well as versioning information of a specific import element. +type V1ImportRevision struct { + ScmHash *string `json:"scmHash,omitempty"` + ScmBranchName *string `json:"scmBranchName,omitempty"` + Vre *V1VersionRelease `json:"vre,omitempty"` + Module *bool `json:"module,omitempty"` + ModuleStream *bool `json:"moduleStream,omitempty"` + ScmUrl *string `json:"scmUrl,omitempty"` + PackageVersionId *string `json:"packageVersionId,omitempty"` +} + +// NewV1ImportRevision instantiates a new V1ImportRevision 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 NewV1ImportRevision() *V1ImportRevision { + this := V1ImportRevision{} + return &this +} + +// NewV1ImportRevisionWithDefaults instantiates a new V1ImportRevision 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 NewV1ImportRevisionWithDefaults() *V1ImportRevision { + this := V1ImportRevision{} + return &this +} + +// GetScmHash returns the ScmHash field value if set, zero value otherwise. +func (o *V1ImportRevision) GetScmHash() string { + if o == nil || o.ScmHash == nil { + var ret string + return ret + } + return *o.ScmHash +} + +// GetScmHashOk returns a tuple with the ScmHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetScmHashOk() (*string, bool) { + if o == nil || o.ScmHash == nil { + return nil, false + } + return o.ScmHash, true +} + +// HasScmHash returns a boolean if a field has been set. +func (o *V1ImportRevision) HasScmHash() bool { + if o != nil && o.ScmHash != nil { + return true + } + + return false +} + +// SetScmHash gets a reference to the given string and assigns it to the ScmHash field. +func (o *V1ImportRevision) SetScmHash(v string) { + o.ScmHash = &v +} + +// GetScmBranchName returns the ScmBranchName field value if set, zero value otherwise. +func (o *V1ImportRevision) GetScmBranchName() string { + if o == nil || o.ScmBranchName == nil { + var ret string + return ret + } + return *o.ScmBranchName +} + +// GetScmBranchNameOk returns a tuple with the ScmBranchName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetScmBranchNameOk() (*string, bool) { + if o == nil || o.ScmBranchName == nil { + return nil, false + } + return o.ScmBranchName, true +} + +// HasScmBranchName returns a boolean if a field has been set. +func (o *V1ImportRevision) HasScmBranchName() bool { + if o != nil && o.ScmBranchName != nil { + return true + } + + return false +} + +// SetScmBranchName gets a reference to the given string and assigns it to the ScmBranchName field. +func (o *V1ImportRevision) SetScmBranchName(v string) { + o.ScmBranchName = &v +} + +// GetVre returns the Vre field value if set, zero value otherwise. +func (o *V1ImportRevision) GetVre() V1VersionRelease { + if o == nil || o.Vre == nil { + var ret V1VersionRelease + return ret + } + return *o.Vre +} + +// GetVreOk returns a tuple with the Vre field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetVreOk() (*V1VersionRelease, bool) { + if o == nil || o.Vre == nil { + return nil, false + } + return o.Vre, true +} + +// HasVre returns a boolean if a field has been set. +func (o *V1ImportRevision) HasVre() bool { + if o != nil && o.Vre != nil { + return true + } + + return false +} + +// SetVre gets a reference to the given V1VersionRelease and assigns it to the Vre field. +func (o *V1ImportRevision) SetVre(v V1VersionRelease) { + o.Vre = &v +} + +// GetModule returns the Module field value if set, zero value otherwise. +func (o *V1ImportRevision) GetModule() bool { + if o == nil || o.Module == nil { + var ret bool + return ret + } + return *o.Module +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetModuleOk() (*bool, bool) { + if o == nil || o.Module == nil { + return nil, false + } + return o.Module, true +} + +// HasModule returns a boolean if a field has been set. +func (o *V1ImportRevision) HasModule() bool { + if o != nil && o.Module != nil { + return true + } + + return false +} + +// SetModule gets a reference to the given bool and assigns it to the Module field. +func (o *V1ImportRevision) SetModule(v bool) { + o.Module = &v +} + +// GetModuleStream returns the ModuleStream field value if set, zero value otherwise. +func (o *V1ImportRevision) GetModuleStream() bool { + if o == nil || o.ModuleStream == nil { + var ret bool + return ret + } + return *o.ModuleStream +} + +// GetModuleStreamOk returns a tuple with the ModuleStream field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetModuleStreamOk() (*bool, bool) { + if o == nil || o.ModuleStream == nil { + return nil, false + } + return o.ModuleStream, true +} + +// HasModuleStream returns a boolean if a field has been set. +func (o *V1ImportRevision) HasModuleStream() bool { + if o != nil && o.ModuleStream != nil { + return true + } + + return false +} + +// SetModuleStream gets a reference to the given bool and assigns it to the ModuleStream field. +func (o *V1ImportRevision) SetModuleStream(v bool) { + o.ModuleStream = &v +} + +// GetScmUrl returns the ScmUrl field value if set, zero value otherwise. +func (o *V1ImportRevision) GetScmUrl() string { + if o == nil || o.ScmUrl == nil { + var ret string + return ret + } + return *o.ScmUrl +} + +// GetScmUrlOk returns a tuple with the ScmUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetScmUrlOk() (*string, bool) { + if o == nil || o.ScmUrl == nil { + return nil, false + } + return o.ScmUrl, true +} + +// HasScmUrl returns a boolean if a field has been set. +func (o *V1ImportRevision) HasScmUrl() bool { + if o != nil && o.ScmUrl != nil { + return true + } + + return false +} + +// SetScmUrl gets a reference to the given string and assigns it to the ScmUrl field. +func (o *V1ImportRevision) SetScmUrl(v string) { + o.ScmUrl = &v +} + +// GetPackageVersionId returns the PackageVersionId field value if set, zero value otherwise. +func (o *V1ImportRevision) GetPackageVersionId() string { + if o == nil || o.PackageVersionId == nil { + var ret string + return ret + } + return *o.PackageVersionId +} + +// GetPackageVersionIdOk returns a tuple with the PackageVersionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ImportRevision) GetPackageVersionIdOk() (*string, bool) { + if o == nil || o.PackageVersionId == nil { + return nil, false + } + return o.PackageVersionId, true +} + +// HasPackageVersionId returns a boolean if a field has been set. +func (o *V1ImportRevision) HasPackageVersionId() bool { + if o != nil && o.PackageVersionId != nil { + return true + } + + return false +} + +// SetPackageVersionId gets a reference to the given string and assigns it to the PackageVersionId field. +func (o *V1ImportRevision) SetPackageVersionId(v string) { + o.PackageVersionId = &v +} + +func (o V1ImportRevision) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ScmHash != nil { + toSerialize["scmHash"] = o.ScmHash + } + if o.ScmBranchName != nil { + toSerialize["scmBranchName"] = o.ScmBranchName + } + if o.Vre != nil { + toSerialize["vre"] = o.Vre + } + if o.Module != nil { + toSerialize["module"] = o.Module + } + if o.ModuleStream != nil { + toSerialize["moduleStream"] = o.ModuleStream + } + if o.ScmUrl != nil { + toSerialize["scmUrl"] = o.ScmUrl + } + if o.PackageVersionId != nil { + toSerialize["packageVersionId"] = o.PackageVersionId + } + return json.Marshal(toSerialize) +} + +type NullableV1ImportRevision struct { + value *V1ImportRevision + isSet bool +} + +func (v NullableV1ImportRevision) Get() *V1ImportRevision { + return v.value +} + +func (v *NullableV1ImportRevision) Set(val *V1ImportRevision) { + v.value = val + v.isSet = true +} + +func (v NullableV1ImportRevision) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ImportRevision) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ImportRevision(val *V1ImportRevision) *NullableV1ImportRevision { + return &NullableV1ImportRevision{value: val, isSet: true} +} + +func (v NullableV1ImportRevision) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ImportRevision) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_build_batches_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_build_batches_response.go new file mode 100644 index 0000000..1ff8202 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_build_batches_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListBuildBatchesResponse struct for V1ListBuildBatchesResponse +type V1ListBuildBatchesResponse struct { + BuildBatches *[]V1BuildBatch `json:"buildBatches,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListBuildBatchesResponse instantiates a new V1ListBuildBatchesResponse 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 NewV1ListBuildBatchesResponse() *V1ListBuildBatchesResponse { + this := V1ListBuildBatchesResponse{} + return &this +} + +// NewV1ListBuildBatchesResponseWithDefaults instantiates a new V1ListBuildBatchesResponse 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 NewV1ListBuildBatchesResponseWithDefaults() *V1ListBuildBatchesResponse { + this := V1ListBuildBatchesResponse{} + return &this +} + +// GetBuildBatches returns the BuildBatches field value if set, zero value otherwise. +func (o *V1ListBuildBatchesResponse) GetBuildBatches() []V1BuildBatch { + if o == nil || o.BuildBatches == nil { + var ret []V1BuildBatch + return ret + } + return *o.BuildBatches +} + +// GetBuildBatchesOk returns a tuple with the BuildBatches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildBatchesResponse) GetBuildBatchesOk() (*[]V1BuildBatch, bool) { + if o == nil || o.BuildBatches == nil { + return nil, false + } + return o.BuildBatches, true +} + +// HasBuildBatches returns a boolean if a field has been set. +func (o *V1ListBuildBatchesResponse) HasBuildBatches() bool { + if o != nil && o.BuildBatches != nil { + return true + } + + return false +} + +// SetBuildBatches gets a reference to the given []V1BuildBatch and assigns it to the BuildBatches field. +func (o *V1ListBuildBatchesResponse) SetBuildBatches(v []V1BuildBatch) { + o.BuildBatches = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListBuildBatchesResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListBuildBatchesResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListBuildBatchesResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListBuildBatchesResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListBuildBatchesResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildBatchesResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListBuildBatchesResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListBuildBatchesResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListBuildBatchesResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildBatchesResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListBuildBatchesResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListBuildBatchesResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListBuildBatchesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BuildBatches != nil { + toSerialize["buildBatches"] = o.BuildBatches + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListBuildBatchesResponse struct { + value *V1ListBuildBatchesResponse + isSet bool +} + +func (v NullableV1ListBuildBatchesResponse) Get() *V1ListBuildBatchesResponse { + return v.value +} + +func (v *NullableV1ListBuildBatchesResponse) Set(val *V1ListBuildBatchesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListBuildBatchesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListBuildBatchesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListBuildBatchesResponse(val *V1ListBuildBatchesResponse) *NullableV1ListBuildBatchesResponse { + return &NullableV1ListBuildBatchesResponse{value: val, isSet: true} +} + +func (v NullableV1ListBuildBatchesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListBuildBatchesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_builds_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_builds_response.go new file mode 100644 index 0000000..63735e3 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_builds_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListBuildsResponse struct for V1ListBuildsResponse +type V1ListBuildsResponse struct { + Builds *[]V1Build `json:"builds,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListBuildsResponse instantiates a new V1ListBuildsResponse 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 NewV1ListBuildsResponse() *V1ListBuildsResponse { + this := V1ListBuildsResponse{} + return &this +} + +// NewV1ListBuildsResponseWithDefaults instantiates a new V1ListBuildsResponse 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 NewV1ListBuildsResponseWithDefaults() *V1ListBuildsResponse { + this := V1ListBuildsResponse{} + return &this +} + +// GetBuilds returns the Builds field value if set, zero value otherwise. +func (o *V1ListBuildsResponse) GetBuilds() []V1Build { + if o == nil || o.Builds == nil { + var ret []V1Build + return ret + } + return *o.Builds +} + +// GetBuildsOk returns a tuple with the Builds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildsResponse) GetBuildsOk() (*[]V1Build, bool) { + if o == nil || o.Builds == nil { + return nil, false + } + return o.Builds, true +} + +// HasBuilds returns a boolean if a field has been set. +func (o *V1ListBuildsResponse) HasBuilds() bool { + if o != nil && o.Builds != nil { + return true + } + + return false +} + +// SetBuilds gets a reference to the given []V1Build and assigns it to the Builds field. +func (o *V1ListBuildsResponse) SetBuilds(v []V1Build) { + o.Builds = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListBuildsResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListBuildsResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListBuildsResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListBuildsResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListBuildsResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildsResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListBuildsResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListBuildsResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListBuildsResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListBuildsResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListBuildsResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListBuildsResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListBuildsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Builds != nil { + toSerialize["builds"] = o.Builds + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListBuildsResponse struct { + value *V1ListBuildsResponse + isSet bool +} + +func (v NullableV1ListBuildsResponse) Get() *V1ListBuildsResponse { + return v.value +} + +func (v *NullableV1ListBuildsResponse) Set(val *V1ListBuildsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListBuildsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListBuildsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListBuildsResponse(val *V1ListBuildsResponse) *NullableV1ListBuildsResponse { + return &NullableV1ListBuildsResponse{value: val, isSet: true} +} + +func (v NullableV1ListBuildsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListBuildsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_import_batches_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_import_batches_response.go new file mode 100644 index 0000000..9a616c3 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_import_batches_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListImportBatchesResponse struct for V1ListImportBatchesResponse +type V1ListImportBatchesResponse struct { + ImportBatches *[]V1ImportBatch `json:"importBatches,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListImportBatchesResponse instantiates a new V1ListImportBatchesResponse 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 NewV1ListImportBatchesResponse() *V1ListImportBatchesResponse { + this := V1ListImportBatchesResponse{} + return &this +} + +// NewV1ListImportBatchesResponseWithDefaults instantiates a new V1ListImportBatchesResponse 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 NewV1ListImportBatchesResponseWithDefaults() *V1ListImportBatchesResponse { + this := V1ListImportBatchesResponse{} + return &this +} + +// GetImportBatches returns the ImportBatches field value if set, zero value otherwise. +func (o *V1ListImportBatchesResponse) GetImportBatches() []V1ImportBatch { + if o == nil || o.ImportBatches == nil { + var ret []V1ImportBatch + return ret + } + return *o.ImportBatches +} + +// GetImportBatchesOk returns a tuple with the ImportBatches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportBatchesResponse) GetImportBatchesOk() (*[]V1ImportBatch, bool) { + if o == nil || o.ImportBatches == nil { + return nil, false + } + return o.ImportBatches, true +} + +// HasImportBatches returns a boolean if a field has been set. +func (o *V1ListImportBatchesResponse) HasImportBatches() bool { + if o != nil && o.ImportBatches != nil { + return true + } + + return false +} + +// SetImportBatches gets a reference to the given []V1ImportBatch and assigns it to the ImportBatches field. +func (o *V1ListImportBatchesResponse) SetImportBatches(v []V1ImportBatch) { + o.ImportBatches = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListImportBatchesResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListImportBatchesResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListImportBatchesResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListImportBatchesResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListImportBatchesResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportBatchesResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListImportBatchesResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListImportBatchesResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListImportBatchesResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportBatchesResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListImportBatchesResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListImportBatchesResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListImportBatchesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ImportBatches != nil { + toSerialize["importBatches"] = o.ImportBatches + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListImportBatchesResponse struct { + value *V1ListImportBatchesResponse + isSet bool +} + +func (v NullableV1ListImportBatchesResponse) Get() *V1ListImportBatchesResponse { + return v.value +} + +func (v *NullableV1ListImportBatchesResponse) Set(val *V1ListImportBatchesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListImportBatchesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListImportBatchesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListImportBatchesResponse(val *V1ListImportBatchesResponse) *NullableV1ListImportBatchesResponse { + return &NullableV1ListImportBatchesResponse{value: val, isSet: true} +} + +func (v NullableV1ListImportBatchesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListImportBatchesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_imports_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_imports_response.go new file mode 100644 index 0000000..54c7def --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_imports_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListImportsResponse struct for V1ListImportsResponse +type V1ListImportsResponse struct { + Imports *[]V1Import `json:"imports,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListImportsResponse instantiates a new V1ListImportsResponse 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 NewV1ListImportsResponse() *V1ListImportsResponse { + this := V1ListImportsResponse{} + return &this +} + +// NewV1ListImportsResponseWithDefaults instantiates a new V1ListImportsResponse 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 NewV1ListImportsResponseWithDefaults() *V1ListImportsResponse { + this := V1ListImportsResponse{} + return &this +} + +// GetImports returns the Imports field value if set, zero value otherwise. +func (o *V1ListImportsResponse) GetImports() []V1Import { + if o == nil || o.Imports == nil { + var ret []V1Import + return ret + } + return *o.Imports +} + +// GetImportsOk returns a tuple with the Imports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportsResponse) GetImportsOk() (*[]V1Import, bool) { + if o == nil || o.Imports == nil { + return nil, false + } + return o.Imports, true +} + +// HasImports returns a boolean if a field has been set. +func (o *V1ListImportsResponse) HasImports() bool { + if o != nil && o.Imports != nil { + return true + } + + return false +} + +// SetImports gets a reference to the given []V1Import and assigns it to the Imports field. +func (o *V1ListImportsResponse) SetImports(v []V1Import) { + o.Imports = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListImportsResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListImportsResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListImportsResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListImportsResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListImportsResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportsResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListImportsResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListImportsResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListImportsResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListImportsResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListImportsResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListImportsResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListImportsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Imports != nil { + toSerialize["imports"] = o.Imports + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListImportsResponse struct { + value *V1ListImportsResponse + isSet bool +} + +func (v NullableV1ListImportsResponse) Get() *V1ListImportsResponse { + return v.value +} + +func (v *NullableV1ListImportsResponse) Set(val *V1ListImportsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListImportsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListImportsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListImportsResponse(val *V1ListImportsResponse) *NullableV1ListImportsResponse { + return &NullableV1ListImportsResponse{value: val, isSet: true} +} + +func (v NullableV1ListImportsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListImportsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_packages_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_packages_response.go new file mode 100644 index 0000000..dede4d4 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_packages_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListPackagesResponse struct for V1ListPackagesResponse +type V1ListPackagesResponse struct { + Packages *[]V1Package `json:"packages,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListPackagesResponse instantiates a new V1ListPackagesResponse 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 NewV1ListPackagesResponse() *V1ListPackagesResponse { + this := V1ListPackagesResponse{} + return &this +} + +// NewV1ListPackagesResponseWithDefaults instantiates a new V1ListPackagesResponse 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 NewV1ListPackagesResponseWithDefaults() *V1ListPackagesResponse { + this := V1ListPackagesResponse{} + return &this +} + +// GetPackages returns the Packages field value if set, zero value otherwise. +func (o *V1ListPackagesResponse) GetPackages() []V1Package { + if o == nil || o.Packages == nil { + var ret []V1Package + return ret + } + return *o.Packages +} + +// GetPackagesOk returns a tuple with the Packages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListPackagesResponse) GetPackagesOk() (*[]V1Package, bool) { + if o == nil || o.Packages == nil { + return nil, false + } + return o.Packages, true +} + +// HasPackages returns a boolean if a field has been set. +func (o *V1ListPackagesResponse) HasPackages() bool { + if o != nil && o.Packages != nil { + return true + } + + return false +} + +// SetPackages gets a reference to the given []V1Package and assigns it to the Packages field. +func (o *V1ListPackagesResponse) SetPackages(v []V1Package) { + o.Packages = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListPackagesResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListPackagesResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListPackagesResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListPackagesResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListPackagesResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListPackagesResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListPackagesResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListPackagesResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListPackagesResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListPackagesResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListPackagesResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListPackagesResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListPackagesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Packages != nil { + toSerialize["packages"] = o.Packages + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListPackagesResponse struct { + value *V1ListPackagesResponse + isSet bool +} + +func (v NullableV1ListPackagesResponse) Get() *V1ListPackagesResponse { + return v.value +} + +func (v *NullableV1ListPackagesResponse) Set(val *V1ListPackagesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListPackagesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListPackagesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListPackagesResponse(val *V1ListPackagesResponse) *NullableV1ListPackagesResponse { + return &NullableV1ListPackagesResponse{value: val, isSet: true} +} + +func (v NullableV1ListPackagesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListPackagesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_projects_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_projects_response.go new file mode 100644 index 0000000..c1b03af --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_projects_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListProjectsResponse struct for V1ListProjectsResponse +type V1ListProjectsResponse struct { + Projects *[]V1Project `json:"projects,omitempty"` + Total *string `json:"total,omitempty"` + Current *string `json:"current,omitempty"` + Page *string `json:"page,omitempty"` +} + +// NewV1ListProjectsResponse instantiates a new V1ListProjectsResponse 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 NewV1ListProjectsResponse() *V1ListProjectsResponse { + this := V1ListProjectsResponse{} + return &this +} + +// NewV1ListProjectsResponseWithDefaults instantiates a new V1ListProjectsResponse 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 NewV1ListProjectsResponseWithDefaults() *V1ListProjectsResponse { + this := V1ListProjectsResponse{} + return &this +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *V1ListProjectsResponse) GetProjects() []V1Project { + if o == nil || o.Projects == nil { + var ret []V1Project + return ret + } + return *o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListProjectsResponse) GetProjectsOk() (*[]V1Project, bool) { + if o == nil || o.Projects == nil { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *V1ListProjectsResponse) HasProjects() bool { + if o != nil && o.Projects != nil { + return true + } + + return false +} + +// SetProjects gets a reference to the given []V1Project and assigns it to the Projects field. +func (o *V1ListProjectsResponse) SetProjects(v []V1Project) { + o.Projects = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListProjectsResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListProjectsResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListProjectsResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListProjectsResponse) SetTotal(v string) { + o.Total = &v +} + +// GetCurrent returns the Current field value if set, zero value otherwise. +func (o *V1ListProjectsResponse) GetCurrent() string { + if o == nil || o.Current == nil { + var ret string + return ret + } + return *o.Current +} + +// GetCurrentOk returns a tuple with the Current field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListProjectsResponse) GetCurrentOk() (*string, bool) { + if o == nil || o.Current == nil { + return nil, false + } + return o.Current, true +} + +// HasCurrent returns a boolean if a field has been set. +func (o *V1ListProjectsResponse) HasCurrent() bool { + if o != nil && o.Current != nil { + return true + } + + return false +} + +// SetCurrent gets a reference to the given string and assigns it to the Current field. +func (o *V1ListProjectsResponse) SetCurrent(v string) { + o.Current = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListProjectsResponse) GetPage() string { + if o == nil || o.Page == nil { + var ret string + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListProjectsResponse) GetPageOk() (*string, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListProjectsResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given string and assigns it to the Page field. +func (o *V1ListProjectsResponse) SetPage(v string) { + o.Page = &v +} + +func (o V1ListProjectsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Projects != nil { + toSerialize["projects"] = o.Projects + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Current != nil { + toSerialize["current"] = o.Current + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListProjectsResponse struct { + value *V1ListProjectsResponse + isSet bool +} + +func (v NullableV1ListProjectsResponse) Get() *V1ListProjectsResponse { + return v.value +} + +func (v *NullableV1ListProjectsResponse) Set(val *V1ListProjectsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListProjectsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListProjectsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListProjectsResponse(val *V1ListProjectsResponse) *NullableV1ListProjectsResponse { + return &NullableV1ListProjectsResponse{value: val, isSet: true} +} + +func (v NullableV1ListProjectsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListProjectsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_repositories_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_repositories_response.go new file mode 100644 index 0000000..28bb436 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_repositories_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListRepositoriesResponse struct for V1ListRepositoriesResponse +type V1ListRepositoriesResponse struct { + Repositories *[]V1Repository `json:"repositories,omitempty"` +} + +// NewV1ListRepositoriesResponse instantiates a new V1ListRepositoriesResponse 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 NewV1ListRepositoriesResponse() *V1ListRepositoriesResponse { + this := V1ListRepositoriesResponse{} + return &this +} + +// NewV1ListRepositoriesResponseWithDefaults instantiates a new V1ListRepositoriesResponse 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 NewV1ListRepositoriesResponseWithDefaults() *V1ListRepositoriesResponse { + this := V1ListRepositoriesResponse{} + return &this +} + +// GetRepositories returns the Repositories field value if set, zero value otherwise. +func (o *V1ListRepositoriesResponse) GetRepositories() []V1Repository { + if o == nil || o.Repositories == nil { + var ret []V1Repository + return ret + } + return *o.Repositories +} + +// GetRepositoriesOk returns a tuple with the Repositories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListRepositoriesResponse) GetRepositoriesOk() (*[]V1Repository, bool) { + if o == nil || o.Repositories == nil { + return nil, false + } + return o.Repositories, true +} + +// HasRepositories returns a boolean if a field has been set. +func (o *V1ListRepositoriesResponse) HasRepositories() bool { + if o != nil && o.Repositories != nil { + return true + } + + return false +} + +// SetRepositories gets a reference to the given []V1Repository and assigns it to the Repositories field. +func (o *V1ListRepositoriesResponse) SetRepositories(v []V1Repository) { + o.Repositories = &v +} + +func (o V1ListRepositoriesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Repositories != nil { + toSerialize["repositories"] = o.Repositories + } + return json.Marshal(toSerialize) +} + +type NullableV1ListRepositoriesResponse struct { + value *V1ListRepositoriesResponse + isSet bool +} + +func (v NullableV1ListRepositoriesResponse) Get() *V1ListRepositoriesResponse { + return v.value +} + +func (v *NullableV1ListRepositoriesResponse) Set(val *V1ListRepositoriesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListRepositoriesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListRepositoriesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListRepositoriesResponse(val *V1ListRepositoriesResponse) *NullableV1ListRepositoriesResponse { + return &NullableV1ListRepositoriesResponse{value: val, isSet: true} +} + +func (v NullableV1ListRepositoriesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListRepositoriesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_tasks_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_tasks_response.go new file mode 100644 index 0000000..932b361 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_list_tasks_response.go @@ -0,0 +1,223 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1ListTasksResponse struct for V1ListTasksResponse +type V1ListTasksResponse struct { + Tasks *[]V1AsyncTask `json:"tasks,omitempty"` + Total *string `json:"total,omitempty"` + Size *int32 `json:"size,omitempty"` + Page *int32 `json:"page,omitempty"` +} + +// NewV1ListTasksResponse instantiates a new V1ListTasksResponse 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 NewV1ListTasksResponse() *V1ListTasksResponse { + this := V1ListTasksResponse{} + return &this +} + +// NewV1ListTasksResponseWithDefaults instantiates a new V1ListTasksResponse 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 NewV1ListTasksResponseWithDefaults() *V1ListTasksResponse { + this := V1ListTasksResponse{} + return &this +} + +// GetTasks returns the Tasks field value if set, zero value otherwise. +func (o *V1ListTasksResponse) GetTasks() []V1AsyncTask { + if o == nil || o.Tasks == nil { + var ret []V1AsyncTask + return ret + } + return *o.Tasks +} + +// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListTasksResponse) GetTasksOk() (*[]V1AsyncTask, bool) { + if o == nil || o.Tasks == nil { + return nil, false + } + return o.Tasks, true +} + +// HasTasks returns a boolean if a field has been set. +func (o *V1ListTasksResponse) HasTasks() bool { + if o != nil && o.Tasks != nil { + return true + } + + return false +} + +// SetTasks gets a reference to the given []V1AsyncTask and assigns it to the Tasks field. +func (o *V1ListTasksResponse) SetTasks(v []V1AsyncTask) { + o.Tasks = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *V1ListTasksResponse) GetTotal() string { + if o == nil || o.Total == nil { + var ret string + 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 *V1ListTasksResponse) GetTotalOk() (*string, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *V1ListTasksResponse) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *V1ListTasksResponse) SetTotal(v string) { + o.Total = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V1ListTasksResponse) GetSize() int32 { + if o == nil || o.Size == nil { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListTasksResponse) GetSizeOk() (*int32, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V1ListTasksResponse) HasSize() bool { + if o != nil && o.Size != nil { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *V1ListTasksResponse) SetSize(v int32) { + o.Size = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *V1ListTasksResponse) GetPage() int32 { + if o == nil || o.Page == nil { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1ListTasksResponse) GetPageOk() (*int32, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *V1ListTasksResponse) HasPage() bool { + if o != nil && o.Page != nil { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *V1ListTasksResponse) SetPage(v int32) { + o.Page = &v +} + +func (o V1ListTasksResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Tasks != nil { + toSerialize["tasks"] = o.Tasks + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + return json.Marshal(toSerialize) +} + +type NullableV1ListTasksResponse struct { + value *V1ListTasksResponse + isSet bool +} + +func (v NullableV1ListTasksResponse) Get() *V1ListTasksResponse { + return v.value +} + +func (v *NullableV1ListTasksResponse) Set(val *V1ListTasksResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1ListTasksResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1ListTasksResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1ListTasksResponse(val *V1ListTasksResponse) *NullableV1ListTasksResponse { + return &NullableV1ListTasksResponse{value: val, isSet: true} +} + +func (v NullableV1ListTasksResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1ListTasksResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_lookaside_file_upload_request.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_lookaside_file_upload_request.go new file mode 100644 index 0000000..9eac32f --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_lookaside_file_upload_request.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1LookasideFileUploadRequest struct for V1LookasideFileUploadRequest +type V1LookasideFileUploadRequest struct { + File *string `json:"file,omitempty"` +} + +// NewV1LookasideFileUploadRequest instantiates a new V1LookasideFileUploadRequest 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 NewV1LookasideFileUploadRequest() *V1LookasideFileUploadRequest { + this := V1LookasideFileUploadRequest{} + return &this +} + +// NewV1LookasideFileUploadRequestWithDefaults instantiates a new V1LookasideFileUploadRequest 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 NewV1LookasideFileUploadRequestWithDefaults() *V1LookasideFileUploadRequest { + this := V1LookasideFileUploadRequest{} + return &this +} + +// GetFile returns the File field value if set, zero value otherwise. +func (o *V1LookasideFileUploadRequest) GetFile() string { + if o == nil || o.File == nil { + var ret string + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1LookasideFileUploadRequest) GetFileOk() (*string, bool) { + if o == nil || o.File == nil { + return nil, false + } + return o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *V1LookasideFileUploadRequest) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given string and assigns it to the File field. +func (o *V1LookasideFileUploadRequest) SetFile(v string) { + o.File = &v +} + +func (o V1LookasideFileUploadRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.File != nil { + toSerialize["file"] = o.File + } + return json.Marshal(toSerialize) +} + +type NullableV1LookasideFileUploadRequest struct { + value *V1LookasideFileUploadRequest + isSet bool +} + +func (v NullableV1LookasideFileUploadRequest) Get() *V1LookasideFileUploadRequest { + return v.value +} + +func (v *NullableV1LookasideFileUploadRequest) Set(val *V1LookasideFileUploadRequest) { + v.value = val + v.isSet = true +} + +func (v NullableV1LookasideFileUploadRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableV1LookasideFileUploadRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1LookasideFileUploadRequest(val *V1LookasideFileUploadRequest) *NullableV1LookasideFileUploadRequest { + return &NullableV1LookasideFileUploadRequest{value: val, isSet: true} +} + +func (v NullableV1LookasideFileUploadRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1LookasideFileUploadRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package.go new file mode 100644 index 0000000..584bbb8 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package.go @@ -0,0 +1,264 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Package struct for V1Package +type V1Package struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *V1PackageType `json:"type,omitempty"` + LastImportAt *time.Time `json:"lastImportAt,omitempty"` + LastBuildAt *time.Time `json:"lastBuildAt,omitempty"` +} + +// NewV1Package instantiates a new V1Package 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 NewV1Package() *V1Package { + this := V1Package{} + var type_ V1PackageType = DEFAULT + this.Type = &type_ + return &this +} + +// NewV1PackageWithDefaults instantiates a new V1Package 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 NewV1PackageWithDefaults() *V1Package { + this := V1Package{} + var type_ V1PackageType = DEFAULT + this.Type = &type_ + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Package) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Package) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Package) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Package) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1Package) GetName() string { + if o == nil || o.Name == nil { + 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 *V1Package) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1Package) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1Package) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *V1Package) GetType() V1PackageType { + if o == nil || o.Type == nil { + var ret V1PackageType + 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 *V1Package) GetTypeOk() (*V1PackageType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *V1Package) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given V1PackageType and assigns it to the Type field. +func (o *V1Package) SetType(v V1PackageType) { + o.Type = &v +} + +// GetLastImportAt returns the LastImportAt field value if set, zero value otherwise. +func (o *V1Package) GetLastImportAt() time.Time { + if o == nil || o.LastImportAt == nil { + var ret time.Time + return ret + } + return *o.LastImportAt +} + +// GetLastImportAtOk returns a tuple with the LastImportAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Package) GetLastImportAtOk() (*time.Time, bool) { + if o == nil || o.LastImportAt == nil { + return nil, false + } + return o.LastImportAt, true +} + +// HasLastImportAt returns a boolean if a field has been set. +func (o *V1Package) HasLastImportAt() bool { + if o != nil && o.LastImportAt != nil { + return true + } + + return false +} + +// SetLastImportAt gets a reference to the given time.Time and assigns it to the LastImportAt field. +func (o *V1Package) SetLastImportAt(v time.Time) { + o.LastImportAt = &v +} + +// GetLastBuildAt returns the LastBuildAt field value if set, zero value otherwise. +func (o *V1Package) GetLastBuildAt() time.Time { + if o == nil || o.LastBuildAt == nil { + var ret time.Time + return ret + } + return *o.LastBuildAt +} + +// GetLastBuildAtOk returns a tuple with the LastBuildAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Package) GetLastBuildAtOk() (*time.Time, bool) { + if o == nil || o.LastBuildAt == nil { + return nil, false + } + return o.LastBuildAt, true +} + +// HasLastBuildAt returns a boolean if a field has been set. +func (o *V1Package) HasLastBuildAt() bool { + if o != nil && o.LastBuildAt != nil { + return true + } + + return false +} + +// SetLastBuildAt gets a reference to the given time.Time and assigns it to the LastBuildAt field. +func (o *V1Package) SetLastBuildAt(v time.Time) { + o.LastBuildAt = &v +} + +func (o V1Package) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.LastImportAt != nil { + toSerialize["lastImportAt"] = o.LastImportAt + } + if o.LastBuildAt != nil { + toSerialize["lastBuildAt"] = o.LastBuildAt + } + return json.Marshal(toSerialize) +} + +type NullableV1Package struct { + value *V1Package + isSet bool +} + +func (v NullableV1Package) Get() *V1Package { + return v.value +} + +func (v *NullableV1Package) Set(val *V1Package) { + v.value = val + v.isSet = true +} + +func (v NullableV1Package) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Package) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Package(val *V1Package) *NullableV1Package { + return &NullableV1Package{value: val, isSet: true} +} + +func (v NullableV1Package) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Package) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_filters.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_filters.go new file mode 100644 index 0000000..bb616f0 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_filters.go @@ -0,0 +1,295 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1PackageFilters struct for V1PackageFilters +type V1PackageFilters struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Modular *bool `json:"modular,omitempty"` + NameExact *string `json:"nameExact,omitempty"` + NoImports *bool `json:"noImports,omitempty"` + NoBuilds *bool `json:"noBuilds,omitempty"` +} + +// NewV1PackageFilters instantiates a new V1PackageFilters 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 NewV1PackageFilters() *V1PackageFilters { + this := V1PackageFilters{} + return &this +} + +// NewV1PackageFiltersWithDefaults instantiates a new V1PackageFilters 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 NewV1PackageFiltersWithDefaults() *V1PackageFilters { + this := V1PackageFilters{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1PackageFilters) GetId() string { + if o == nil || o.Id == nil { + 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 *V1PackageFilters) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1PackageFilters) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1PackageFilters) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1PackageFilters) GetName() string { + if o == nil || o.Name == nil { + 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 *V1PackageFilters) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1PackageFilters) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1PackageFilters) SetName(v string) { + o.Name = &v +} + +// GetModular returns the Modular field value if set, zero value otherwise. +func (o *V1PackageFilters) GetModular() bool { + if o == nil || o.Modular == nil { + var ret bool + return ret + } + return *o.Modular +} + +// GetModularOk returns a tuple with the Modular field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1PackageFilters) GetModularOk() (*bool, bool) { + if o == nil || o.Modular == nil { + return nil, false + } + return o.Modular, true +} + +// HasModular returns a boolean if a field has been set. +func (o *V1PackageFilters) HasModular() bool { + if o != nil && o.Modular != nil { + return true + } + + return false +} + +// SetModular gets a reference to the given bool and assigns it to the Modular field. +func (o *V1PackageFilters) SetModular(v bool) { + o.Modular = &v +} + +// GetNameExact returns the NameExact field value if set, zero value otherwise. +func (o *V1PackageFilters) GetNameExact() string { + if o == nil || o.NameExact == nil { + var ret string + return ret + } + return *o.NameExact +} + +// GetNameExactOk returns a tuple with the NameExact field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1PackageFilters) GetNameExactOk() (*string, bool) { + if o == nil || o.NameExact == nil { + return nil, false + } + return o.NameExact, true +} + +// HasNameExact returns a boolean if a field has been set. +func (o *V1PackageFilters) HasNameExact() bool { + if o != nil && o.NameExact != nil { + return true + } + + return false +} + +// SetNameExact gets a reference to the given string and assigns it to the NameExact field. +func (o *V1PackageFilters) SetNameExact(v string) { + o.NameExact = &v +} + +// GetNoImports returns the NoImports field value if set, zero value otherwise. +func (o *V1PackageFilters) GetNoImports() bool { + if o == nil || o.NoImports == nil { + var ret bool + return ret + } + return *o.NoImports +} + +// GetNoImportsOk returns a tuple with the NoImports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1PackageFilters) GetNoImportsOk() (*bool, bool) { + if o == nil || o.NoImports == nil { + return nil, false + } + return o.NoImports, true +} + +// HasNoImports returns a boolean if a field has been set. +func (o *V1PackageFilters) HasNoImports() bool { + if o != nil && o.NoImports != nil { + return true + } + + return false +} + +// SetNoImports gets a reference to the given bool and assigns it to the NoImports field. +func (o *V1PackageFilters) SetNoImports(v bool) { + o.NoImports = &v +} + +// GetNoBuilds returns the NoBuilds field value if set, zero value otherwise. +func (o *V1PackageFilters) GetNoBuilds() bool { + if o == nil || o.NoBuilds == nil { + var ret bool + return ret + } + return *o.NoBuilds +} + +// GetNoBuildsOk returns a tuple with the NoBuilds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1PackageFilters) GetNoBuildsOk() (*bool, bool) { + if o == nil || o.NoBuilds == nil { + return nil, false + } + return o.NoBuilds, true +} + +// HasNoBuilds returns a boolean if a field has been set. +func (o *V1PackageFilters) HasNoBuilds() bool { + if o != nil && o.NoBuilds != nil { + return true + } + + return false +} + +// SetNoBuilds gets a reference to the given bool and assigns it to the NoBuilds field. +func (o *V1PackageFilters) SetNoBuilds(v bool) { + o.NoBuilds = &v +} + +func (o V1PackageFilters) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Modular != nil { + toSerialize["modular"] = o.Modular + } + if o.NameExact != nil { + toSerialize["nameExact"] = o.NameExact + } + if o.NoImports != nil { + toSerialize["noImports"] = o.NoImports + } + if o.NoBuilds != nil { + toSerialize["noBuilds"] = o.NoBuilds + } + return json.Marshal(toSerialize) +} + +type NullableV1PackageFilters struct { + value *V1PackageFilters + isSet bool +} + +func (v NullableV1PackageFilters) Get() *V1PackageFilters { + return v.value +} + +func (v *NullableV1PackageFilters) Set(val *V1PackageFilters) { + v.value = val + v.isSet = true +} + +func (v NullableV1PackageFilters) IsSet() bool { + return v.isSet +} + +func (v *NullableV1PackageFilters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1PackageFilters(val *V1PackageFilters) *NullableV1PackageFilters { + return &NullableV1PackageFilters{value: val, isSet: true} +} + +func (v NullableV1PackageFilters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1PackageFilters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_type.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_type.go new file mode 100644 index 0000000..403c064 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_package_type.go @@ -0,0 +1,91 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "fmt" +) + +// V1PackageType - PACKAGE_TYPE_DEFAULT: Unknown value. Should never be used - PACKAGE_TYPE_NORMAL: Normal packages from downstream dist-git The repos are imported as-is This will never be used as PACKAGE_TYPE_NORMAL_FORK accomplishes the same task without duplicate work - PACKAGE_TYPE_NORMAL_FORK: Normal packages from upstream dist-git The repos are first imported into target dist-git using srpmproc (with eventual patches) and then imported as-is into Peridot - PACKAGE_TYPE_NORMAL_SRC: Source packages from downstream src-git The sources are packaged into tarballs and uploaded into lookaside, and the repo with sources removed is then pushed into dist-git with a following metadata file. This package type enables an automatic src-git packaging workflow, but a manual workflow may be adapted as well with manual packaging. The package should then be set to PACKAGE_TYPE_NORMAL if manual packaging is desired. - PACKAGE_TYPE_MODULE_FORK: todo(mustafa): Document rest PACKAGE_TYPE_MODULE = 4; PACKAGE_TYPE_MODULE_COMPONENT = 5; - PACKAGE_TYPE_NORMAL_FORK_MODULE: A package may be both a normally forked package and a module So we need to differentiate between the two - PACKAGE_TYPE_NORMAL_FORK_MODULE_COMPONENT: A package may also be a module component and a normal package So we need to differentiate between the two - PACKAGE_TYPE_MODULE_FORK_MODULE_COMPONENT: A package may be both a module and a module component +type V1PackageType string + +// List of v1PackageType +const ( + DEFAULT V1PackageType = "PACKAGE_TYPE_DEFAULT" + NORMAL V1PackageType = "PACKAGE_TYPE_NORMAL" + NORMAL_FORK V1PackageType = "PACKAGE_TYPE_NORMAL_FORK" + NORMAL_SRC V1PackageType = "PACKAGE_TYPE_NORMAL_SRC" + MODULE_FORK V1PackageType = "PACKAGE_TYPE_MODULE_FORK" + MODULE_FORK_COMPONENT V1PackageType = "PACKAGE_TYPE_MODULE_FORK_COMPONENT" + NORMAL_FORK_MODULE V1PackageType = "PACKAGE_TYPE_NORMAL_FORK_MODULE" + NORMAL_FORK_MODULE_COMPONENT V1PackageType = "PACKAGE_TYPE_NORMAL_FORK_MODULE_COMPONENT" + MODULE_FORK_MODULE_COMPONENT V1PackageType = "PACKAGE_TYPE_MODULE_FORK_MODULE_COMPONENT" +) + +func (v *V1PackageType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := V1PackageType(value) + for _, existing := range []V1PackageType{ "PACKAGE_TYPE_DEFAULT", "PACKAGE_TYPE_NORMAL", "PACKAGE_TYPE_NORMAL_FORK", "PACKAGE_TYPE_NORMAL_SRC", "PACKAGE_TYPE_MODULE_FORK", "PACKAGE_TYPE_MODULE_FORK_COMPONENT", "PACKAGE_TYPE_NORMAL_FORK_MODULE", "PACKAGE_TYPE_NORMAL_FORK_MODULE_COMPONENT", "PACKAGE_TYPE_MODULE_FORK_MODULE_COMPONENT", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid V1PackageType", value) +} + +// Ptr returns reference to v1PackageType value +func (v V1PackageType) Ptr() *V1PackageType { + return &v +} + +type NullableV1PackageType struct { + value *V1PackageType + isSet bool +} + +func (v NullableV1PackageType) Get() *V1PackageType { + return v.value +} + +func (v *NullableV1PackageType) Set(val *V1PackageType) { + v.value = val + v.isSet = true +} + +func (v NullableV1PackageType) IsSet() bool { + return v.isSet +} + +func (v *NullableV1PackageType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1PackageType(val *V1PackageType) *NullableV1PackageType { + return &NullableV1PackageType{value: val, isSet: true} +} + +func (v NullableV1PackageType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1PackageType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_project.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_project.go new file mode 100644 index 0000000..9f7f2c8 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_project.go @@ -0,0 +1,872 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Project struct for V1Project +type V1Project struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Name *string `json:"name,omitempty"` + MajorVersion *int32 `json:"majorVersion,omitempty"` + Archs *[]string `json:"archs,omitempty"` + DistTag *string `json:"distTag,omitempty"` + TargetGitlabHost *string `json:"targetGitlabHost,omitempty"` + TargetPrefix *string `json:"targetPrefix,omitempty"` + TargetBranchPrefix *string `json:"targetBranchPrefix,omitempty"` + SourceGitHost *string `json:"sourceGitHost,omitempty"` + SourcePrefix *string `json:"sourcePrefix,omitempty"` + SourceBranchPrefix *string `json:"sourceBranchPrefix,omitempty"` + CdnUrl *string `json:"cdnUrl,omitempty"` + StreamMode *bool `json:"streamMode,omitempty"` + TargetVendor *string `json:"targetVendor,omitempty"` + AdditionalVendor *string `json:"additionalVendor,omitempty"` + FollowImportDist *bool `json:"followImportDist,omitempty"` + BranchSuffix *string `json:"branchSuffix,omitempty"` + GitMakePublic *bool `json:"gitMakePublic,omitempty"` + VendorMacro *string `json:"vendorMacro,omitempty"` + PackagerMacro *string `json:"packagerMacro,omitempty"` +} + +// NewV1Project instantiates a new V1Project 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 NewV1Project() *V1Project { + this := V1Project{} + return &this +} + +// NewV1ProjectWithDefaults instantiates a new V1Project 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 NewV1ProjectWithDefaults() *V1Project { + this := V1Project{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Project) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Project) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Project) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Project) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1Project) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1Project) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1Project) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1Project) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *V1Project) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt == nil { + var ret time.Time + 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 *V1Project) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || o.UpdatedAt == nil { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *V1Project) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt != nil { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *V1Project) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1Project) GetName() string { + if o == nil || o.Name == nil { + 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 *V1Project) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1Project) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1Project) SetName(v string) { + o.Name = &v +} + +// GetMajorVersion returns the MajorVersion field value if set, zero value otherwise. +func (o *V1Project) GetMajorVersion() int32 { + if o == nil || o.MajorVersion == nil { + var ret int32 + return ret + } + return *o.MajorVersion +} + +// GetMajorVersionOk returns a tuple with the MajorVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetMajorVersionOk() (*int32, bool) { + if o == nil || o.MajorVersion == nil { + return nil, false + } + return o.MajorVersion, true +} + +// HasMajorVersion returns a boolean if a field has been set. +func (o *V1Project) HasMajorVersion() bool { + if o != nil && o.MajorVersion != nil { + return true + } + + return false +} + +// SetMajorVersion gets a reference to the given int32 and assigns it to the MajorVersion field. +func (o *V1Project) SetMajorVersion(v int32) { + o.MajorVersion = &v +} + +// GetArchs returns the Archs field value if set, zero value otherwise. +func (o *V1Project) GetArchs() []string { + if o == nil || o.Archs == nil { + var ret []string + return ret + } + return *o.Archs +} + +// GetArchsOk returns a tuple with the Archs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetArchsOk() (*[]string, bool) { + if o == nil || o.Archs == nil { + return nil, false + } + return o.Archs, true +} + +// HasArchs returns a boolean if a field has been set. +func (o *V1Project) HasArchs() bool { + if o != nil && o.Archs != nil { + return true + } + + return false +} + +// SetArchs gets a reference to the given []string and assigns it to the Archs field. +func (o *V1Project) SetArchs(v []string) { + o.Archs = &v +} + +// GetDistTag returns the DistTag field value if set, zero value otherwise. +func (o *V1Project) GetDistTag() string { + if o == nil || o.DistTag == nil { + var ret string + return ret + } + return *o.DistTag +} + +// GetDistTagOk returns a tuple with the DistTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetDistTagOk() (*string, bool) { + if o == nil || o.DistTag == nil { + return nil, false + } + return o.DistTag, true +} + +// HasDistTag returns a boolean if a field has been set. +func (o *V1Project) HasDistTag() bool { + if o != nil && o.DistTag != nil { + return true + } + + return false +} + +// SetDistTag gets a reference to the given string and assigns it to the DistTag field. +func (o *V1Project) SetDistTag(v string) { + o.DistTag = &v +} + +// GetTargetGitlabHost returns the TargetGitlabHost field value if set, zero value otherwise. +func (o *V1Project) GetTargetGitlabHost() string { + if o == nil || o.TargetGitlabHost == nil { + var ret string + return ret + } + return *o.TargetGitlabHost +} + +// GetTargetGitlabHostOk returns a tuple with the TargetGitlabHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetTargetGitlabHostOk() (*string, bool) { + if o == nil || o.TargetGitlabHost == nil { + return nil, false + } + return o.TargetGitlabHost, true +} + +// HasTargetGitlabHost returns a boolean if a field has been set. +func (o *V1Project) HasTargetGitlabHost() bool { + if o != nil && o.TargetGitlabHost != nil { + return true + } + + return false +} + +// SetTargetGitlabHost gets a reference to the given string and assigns it to the TargetGitlabHost field. +func (o *V1Project) SetTargetGitlabHost(v string) { + o.TargetGitlabHost = &v +} + +// GetTargetPrefix returns the TargetPrefix field value if set, zero value otherwise. +func (o *V1Project) GetTargetPrefix() string { + if o == nil || o.TargetPrefix == nil { + var ret string + return ret + } + return *o.TargetPrefix +} + +// GetTargetPrefixOk returns a tuple with the TargetPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetTargetPrefixOk() (*string, bool) { + if o == nil || o.TargetPrefix == nil { + return nil, false + } + return o.TargetPrefix, true +} + +// HasTargetPrefix returns a boolean if a field has been set. +func (o *V1Project) HasTargetPrefix() bool { + if o != nil && o.TargetPrefix != nil { + return true + } + + return false +} + +// SetTargetPrefix gets a reference to the given string and assigns it to the TargetPrefix field. +func (o *V1Project) SetTargetPrefix(v string) { + o.TargetPrefix = &v +} + +// GetTargetBranchPrefix returns the TargetBranchPrefix field value if set, zero value otherwise. +func (o *V1Project) GetTargetBranchPrefix() string { + if o == nil || o.TargetBranchPrefix == nil { + var ret string + return ret + } + return *o.TargetBranchPrefix +} + +// GetTargetBranchPrefixOk returns a tuple with the TargetBranchPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetTargetBranchPrefixOk() (*string, bool) { + if o == nil || o.TargetBranchPrefix == nil { + return nil, false + } + return o.TargetBranchPrefix, true +} + +// HasTargetBranchPrefix returns a boolean if a field has been set. +func (o *V1Project) HasTargetBranchPrefix() bool { + if o != nil && o.TargetBranchPrefix != nil { + return true + } + + return false +} + +// SetTargetBranchPrefix gets a reference to the given string and assigns it to the TargetBranchPrefix field. +func (o *V1Project) SetTargetBranchPrefix(v string) { + o.TargetBranchPrefix = &v +} + +// GetSourceGitHost returns the SourceGitHost field value if set, zero value otherwise. +func (o *V1Project) GetSourceGitHost() string { + if o == nil || o.SourceGitHost == nil { + var ret string + return ret + } + return *o.SourceGitHost +} + +// GetSourceGitHostOk returns a tuple with the SourceGitHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetSourceGitHostOk() (*string, bool) { + if o == nil || o.SourceGitHost == nil { + return nil, false + } + return o.SourceGitHost, true +} + +// HasSourceGitHost returns a boolean if a field has been set. +func (o *V1Project) HasSourceGitHost() bool { + if o != nil && o.SourceGitHost != nil { + return true + } + + return false +} + +// SetSourceGitHost gets a reference to the given string and assigns it to the SourceGitHost field. +func (o *V1Project) SetSourceGitHost(v string) { + o.SourceGitHost = &v +} + +// GetSourcePrefix returns the SourcePrefix field value if set, zero value otherwise. +func (o *V1Project) GetSourcePrefix() string { + if o == nil || o.SourcePrefix == nil { + var ret string + return ret + } + return *o.SourcePrefix +} + +// GetSourcePrefixOk returns a tuple with the SourcePrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetSourcePrefixOk() (*string, bool) { + if o == nil || o.SourcePrefix == nil { + return nil, false + } + return o.SourcePrefix, true +} + +// HasSourcePrefix returns a boolean if a field has been set. +func (o *V1Project) HasSourcePrefix() bool { + if o != nil && o.SourcePrefix != nil { + return true + } + + return false +} + +// SetSourcePrefix gets a reference to the given string and assigns it to the SourcePrefix field. +func (o *V1Project) SetSourcePrefix(v string) { + o.SourcePrefix = &v +} + +// GetSourceBranchPrefix returns the SourceBranchPrefix field value if set, zero value otherwise. +func (o *V1Project) GetSourceBranchPrefix() string { + if o == nil || o.SourceBranchPrefix == nil { + var ret string + return ret + } + return *o.SourceBranchPrefix +} + +// GetSourceBranchPrefixOk returns a tuple with the SourceBranchPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetSourceBranchPrefixOk() (*string, bool) { + if o == nil || o.SourceBranchPrefix == nil { + return nil, false + } + return o.SourceBranchPrefix, true +} + +// HasSourceBranchPrefix returns a boolean if a field has been set. +func (o *V1Project) HasSourceBranchPrefix() bool { + if o != nil && o.SourceBranchPrefix != nil { + return true + } + + return false +} + +// SetSourceBranchPrefix gets a reference to the given string and assigns it to the SourceBranchPrefix field. +func (o *V1Project) SetSourceBranchPrefix(v string) { + o.SourceBranchPrefix = &v +} + +// GetCdnUrl returns the CdnUrl field value if set, zero value otherwise. +func (o *V1Project) GetCdnUrl() string { + if o == nil || o.CdnUrl == nil { + var ret string + return ret + } + return *o.CdnUrl +} + +// GetCdnUrlOk returns a tuple with the CdnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetCdnUrlOk() (*string, bool) { + if o == nil || o.CdnUrl == nil { + return nil, false + } + return o.CdnUrl, true +} + +// HasCdnUrl returns a boolean if a field has been set. +func (o *V1Project) HasCdnUrl() bool { + if o != nil && o.CdnUrl != nil { + return true + } + + return false +} + +// SetCdnUrl gets a reference to the given string and assigns it to the CdnUrl field. +func (o *V1Project) SetCdnUrl(v string) { + o.CdnUrl = &v +} + +// GetStreamMode returns the StreamMode field value if set, zero value otherwise. +func (o *V1Project) GetStreamMode() bool { + if o == nil || o.StreamMode == nil { + var ret bool + return ret + } + return *o.StreamMode +} + +// GetStreamModeOk returns a tuple with the StreamMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetStreamModeOk() (*bool, bool) { + if o == nil || o.StreamMode == nil { + return nil, false + } + return o.StreamMode, true +} + +// HasStreamMode returns a boolean if a field has been set. +func (o *V1Project) HasStreamMode() bool { + if o != nil && o.StreamMode != nil { + return true + } + + return false +} + +// SetStreamMode gets a reference to the given bool and assigns it to the StreamMode field. +func (o *V1Project) SetStreamMode(v bool) { + o.StreamMode = &v +} + +// GetTargetVendor returns the TargetVendor field value if set, zero value otherwise. +func (o *V1Project) GetTargetVendor() string { + if o == nil || o.TargetVendor == nil { + var ret string + return ret + } + return *o.TargetVendor +} + +// GetTargetVendorOk returns a tuple with the TargetVendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetTargetVendorOk() (*string, bool) { + if o == nil || o.TargetVendor == nil { + return nil, false + } + return o.TargetVendor, true +} + +// HasTargetVendor returns a boolean if a field has been set. +func (o *V1Project) HasTargetVendor() bool { + if o != nil && o.TargetVendor != nil { + return true + } + + return false +} + +// SetTargetVendor gets a reference to the given string and assigns it to the TargetVendor field. +func (o *V1Project) SetTargetVendor(v string) { + o.TargetVendor = &v +} + +// GetAdditionalVendor returns the AdditionalVendor field value if set, zero value otherwise. +func (o *V1Project) GetAdditionalVendor() string { + if o == nil || o.AdditionalVendor == nil { + var ret string + return ret + } + return *o.AdditionalVendor +} + +// GetAdditionalVendorOk returns a tuple with the AdditionalVendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetAdditionalVendorOk() (*string, bool) { + if o == nil || o.AdditionalVendor == nil { + return nil, false + } + return o.AdditionalVendor, true +} + +// HasAdditionalVendor returns a boolean if a field has been set. +func (o *V1Project) HasAdditionalVendor() bool { + if o != nil && o.AdditionalVendor != nil { + return true + } + + return false +} + +// SetAdditionalVendor gets a reference to the given string and assigns it to the AdditionalVendor field. +func (o *V1Project) SetAdditionalVendor(v string) { + o.AdditionalVendor = &v +} + +// GetFollowImportDist returns the FollowImportDist field value if set, zero value otherwise. +func (o *V1Project) GetFollowImportDist() bool { + if o == nil || o.FollowImportDist == nil { + var ret bool + return ret + } + return *o.FollowImportDist +} + +// GetFollowImportDistOk returns a tuple with the FollowImportDist field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetFollowImportDistOk() (*bool, bool) { + if o == nil || o.FollowImportDist == nil { + return nil, false + } + return o.FollowImportDist, true +} + +// HasFollowImportDist returns a boolean if a field has been set. +func (o *V1Project) HasFollowImportDist() bool { + if o != nil && o.FollowImportDist != nil { + return true + } + + return false +} + +// SetFollowImportDist gets a reference to the given bool and assigns it to the FollowImportDist field. +func (o *V1Project) SetFollowImportDist(v bool) { + o.FollowImportDist = &v +} + +// GetBranchSuffix returns the BranchSuffix field value if set, zero value otherwise. +func (o *V1Project) GetBranchSuffix() string { + if o == nil || o.BranchSuffix == nil { + var ret string + return ret + } + return *o.BranchSuffix +} + +// GetBranchSuffixOk returns a tuple with the BranchSuffix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetBranchSuffixOk() (*string, bool) { + if o == nil || o.BranchSuffix == nil { + return nil, false + } + return o.BranchSuffix, true +} + +// HasBranchSuffix returns a boolean if a field has been set. +func (o *V1Project) HasBranchSuffix() bool { + if o != nil && o.BranchSuffix != nil { + return true + } + + return false +} + +// SetBranchSuffix gets a reference to the given string and assigns it to the BranchSuffix field. +func (o *V1Project) SetBranchSuffix(v string) { + o.BranchSuffix = &v +} + +// GetGitMakePublic returns the GitMakePublic field value if set, zero value otherwise. +func (o *V1Project) GetGitMakePublic() bool { + if o == nil || o.GitMakePublic == nil { + var ret bool + return ret + } + return *o.GitMakePublic +} + +// GetGitMakePublicOk returns a tuple with the GitMakePublic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetGitMakePublicOk() (*bool, bool) { + if o == nil || o.GitMakePublic == nil { + return nil, false + } + return o.GitMakePublic, true +} + +// HasGitMakePublic returns a boolean if a field has been set. +func (o *V1Project) HasGitMakePublic() bool { + if o != nil && o.GitMakePublic != nil { + return true + } + + return false +} + +// SetGitMakePublic gets a reference to the given bool and assigns it to the GitMakePublic field. +func (o *V1Project) SetGitMakePublic(v bool) { + o.GitMakePublic = &v +} + +// GetVendorMacro returns the VendorMacro field value if set, zero value otherwise. +func (o *V1Project) GetVendorMacro() string { + if o == nil || o.VendorMacro == nil { + var ret string + return ret + } + return *o.VendorMacro +} + +// GetVendorMacroOk returns a tuple with the VendorMacro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetVendorMacroOk() (*string, bool) { + if o == nil || o.VendorMacro == nil { + return nil, false + } + return o.VendorMacro, true +} + +// HasVendorMacro returns a boolean if a field has been set. +func (o *V1Project) HasVendorMacro() bool { + if o != nil && o.VendorMacro != nil { + return true + } + + return false +} + +// SetVendorMacro gets a reference to the given string and assigns it to the VendorMacro field. +func (o *V1Project) SetVendorMacro(v string) { + o.VendorMacro = &v +} + +// GetPackagerMacro returns the PackagerMacro field value if set, zero value otherwise. +func (o *V1Project) GetPackagerMacro() string { + if o == nil || o.PackagerMacro == nil { + var ret string + return ret + } + return *o.PackagerMacro +} + +// GetPackagerMacroOk returns a tuple with the PackagerMacro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Project) GetPackagerMacroOk() (*string, bool) { + if o == nil || o.PackagerMacro == nil { + return nil, false + } + return o.PackagerMacro, true +} + +// HasPackagerMacro returns a boolean if a field has been set. +func (o *V1Project) HasPackagerMacro() bool { + if o != nil && o.PackagerMacro != nil { + return true + } + + return false +} + +// SetPackagerMacro gets a reference to the given string and assigns it to the PackagerMacro field. +func (o *V1Project) SetPackagerMacro(v string) { + o.PackagerMacro = &v +} + +func (o V1Project) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.UpdatedAt != nil { + toSerialize["updatedAt"] = o.UpdatedAt + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.MajorVersion != nil { + toSerialize["majorVersion"] = o.MajorVersion + } + if o.Archs != nil { + toSerialize["archs"] = o.Archs + } + if o.DistTag != nil { + toSerialize["distTag"] = o.DistTag + } + if o.TargetGitlabHost != nil { + toSerialize["targetGitlabHost"] = o.TargetGitlabHost + } + if o.TargetPrefix != nil { + toSerialize["targetPrefix"] = o.TargetPrefix + } + if o.TargetBranchPrefix != nil { + toSerialize["targetBranchPrefix"] = o.TargetBranchPrefix + } + if o.SourceGitHost != nil { + toSerialize["sourceGitHost"] = o.SourceGitHost + } + if o.SourcePrefix != nil { + toSerialize["sourcePrefix"] = o.SourcePrefix + } + if o.SourceBranchPrefix != nil { + toSerialize["sourceBranchPrefix"] = o.SourceBranchPrefix + } + if o.CdnUrl != nil { + toSerialize["cdnUrl"] = o.CdnUrl + } + if o.StreamMode != nil { + toSerialize["streamMode"] = o.StreamMode + } + if o.TargetVendor != nil { + toSerialize["targetVendor"] = o.TargetVendor + } + if o.AdditionalVendor != nil { + toSerialize["additionalVendor"] = o.AdditionalVendor + } + if o.FollowImportDist != nil { + toSerialize["followImportDist"] = o.FollowImportDist + } + if o.BranchSuffix != nil { + toSerialize["branchSuffix"] = o.BranchSuffix + } + if o.GitMakePublic != nil { + toSerialize["gitMakePublic"] = o.GitMakePublic + } + if o.VendorMacro != nil { + toSerialize["vendorMacro"] = o.VendorMacro + } + if o.PackagerMacro != nil { + toSerialize["packagerMacro"] = o.PackagerMacro + } + return json.Marshal(toSerialize) +} + +type NullableV1Project struct { + value *V1Project + isSet bool +} + +func (v NullableV1Project) Get() *V1Project { + return v.value +} + +func (v *NullableV1Project) Set(val *V1Project) { + v.value = val + v.isSet = true +} + +func (v NullableV1Project) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Project) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Project(val *V1Project) *NullableV1Project { + return &NullableV1Project{value: val, isSet: true} +} + +func (v NullableV1Project) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Project) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_repository.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_repository.go new file mode 100644 index 0000000..6243e1e --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_repository.go @@ -0,0 +1,477 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Repository struct for V1Repository +type V1Repository struct { + Id *string `json:"id,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Name *string `json:"name,omitempty"` + ProjectId *string `json:"projectId,omitempty"` + Packages *[]string `json:"packages,omitempty"` + ExcludeFilter *[]string `json:"excludeFilter,omitempty"` + // Whether an RPM from a package should be included in the repository If list contains a NA that is in exclude_list as well, then it will be excluded. + IncludeList *[]string `json:"includeList,omitempty"` + AdditionalMultilib *[]string `json:"additionalMultilib,omitempty"` + ExcludeMultilibFilter *[]string `json:"excludeMultilibFilter,omitempty"` + Multilib *[]string `json:"multilib,omitempty"` + GlobIncludeFilter *[]string `json:"globIncludeFilter,omitempty"` +} + +// NewV1Repository instantiates a new V1Repository 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 NewV1Repository() *V1Repository { + this := V1Repository{} + return &this +} + +// NewV1RepositoryWithDefaults instantiates a new V1Repository 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 NewV1RepositoryWithDefaults() *V1Repository { + this := V1Repository{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Repository) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Repository) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Repository) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Repository) SetId(v string) { + o.Id = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1Repository) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1Repository) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1Repository) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1Repository) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V1Repository) GetName() string { + if o == nil || o.Name == nil { + 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 *V1Repository) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V1Repository) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V1Repository) SetName(v string) { + o.Name = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *V1Repository) GetProjectId() string { + if o == nil || o.ProjectId == nil { + 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 *V1Repository) GetProjectIdOk() (*string, bool) { + if o == nil || o.ProjectId == nil { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *V1Repository) HasProjectId() bool { + if o != nil && o.ProjectId != nil { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *V1Repository) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetPackages returns the Packages field value if set, zero value otherwise. +func (o *V1Repository) GetPackages() []string { + if o == nil || o.Packages == nil { + var ret []string + return ret + } + return *o.Packages +} + +// GetPackagesOk returns a tuple with the Packages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetPackagesOk() (*[]string, bool) { + if o == nil || o.Packages == nil { + return nil, false + } + return o.Packages, true +} + +// HasPackages returns a boolean if a field has been set. +func (o *V1Repository) HasPackages() bool { + if o != nil && o.Packages != nil { + return true + } + + return false +} + +// SetPackages gets a reference to the given []string and assigns it to the Packages field. +func (o *V1Repository) SetPackages(v []string) { + o.Packages = &v +} + +// GetExcludeFilter returns the ExcludeFilter field value if set, zero value otherwise. +func (o *V1Repository) GetExcludeFilter() []string { + if o == nil || o.ExcludeFilter == nil { + var ret []string + return ret + } + return *o.ExcludeFilter +} + +// GetExcludeFilterOk returns a tuple with the ExcludeFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetExcludeFilterOk() (*[]string, bool) { + if o == nil || o.ExcludeFilter == nil { + return nil, false + } + return o.ExcludeFilter, true +} + +// HasExcludeFilter returns a boolean if a field has been set. +func (o *V1Repository) HasExcludeFilter() bool { + if o != nil && o.ExcludeFilter != nil { + return true + } + + return false +} + +// SetExcludeFilter gets a reference to the given []string and assigns it to the ExcludeFilter field. +func (o *V1Repository) SetExcludeFilter(v []string) { + o.ExcludeFilter = &v +} + +// GetIncludeList returns the IncludeList field value if set, zero value otherwise. +func (o *V1Repository) GetIncludeList() []string { + if o == nil || o.IncludeList == nil { + var ret []string + return ret + } + return *o.IncludeList +} + +// GetIncludeListOk returns a tuple with the IncludeList field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetIncludeListOk() (*[]string, bool) { + if o == nil || o.IncludeList == nil { + return nil, false + } + return o.IncludeList, true +} + +// HasIncludeList returns a boolean if a field has been set. +func (o *V1Repository) HasIncludeList() bool { + if o != nil && o.IncludeList != nil { + return true + } + + return false +} + +// SetIncludeList gets a reference to the given []string and assigns it to the IncludeList field. +func (o *V1Repository) SetIncludeList(v []string) { + o.IncludeList = &v +} + +// GetAdditionalMultilib returns the AdditionalMultilib field value if set, zero value otherwise. +func (o *V1Repository) GetAdditionalMultilib() []string { + if o == nil || o.AdditionalMultilib == nil { + var ret []string + return ret + } + return *o.AdditionalMultilib +} + +// GetAdditionalMultilibOk returns a tuple with the AdditionalMultilib field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetAdditionalMultilibOk() (*[]string, bool) { + if o == nil || o.AdditionalMultilib == nil { + return nil, false + } + return o.AdditionalMultilib, true +} + +// HasAdditionalMultilib returns a boolean if a field has been set. +func (o *V1Repository) HasAdditionalMultilib() bool { + if o != nil && o.AdditionalMultilib != nil { + return true + } + + return false +} + +// SetAdditionalMultilib gets a reference to the given []string and assigns it to the AdditionalMultilib field. +func (o *V1Repository) SetAdditionalMultilib(v []string) { + o.AdditionalMultilib = &v +} + +// GetExcludeMultilibFilter returns the ExcludeMultilibFilter field value if set, zero value otherwise. +func (o *V1Repository) GetExcludeMultilibFilter() []string { + if o == nil || o.ExcludeMultilibFilter == nil { + var ret []string + return ret + } + return *o.ExcludeMultilibFilter +} + +// GetExcludeMultilibFilterOk returns a tuple with the ExcludeMultilibFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetExcludeMultilibFilterOk() (*[]string, bool) { + if o == nil || o.ExcludeMultilibFilter == nil { + return nil, false + } + return o.ExcludeMultilibFilter, true +} + +// HasExcludeMultilibFilter returns a boolean if a field has been set. +func (o *V1Repository) HasExcludeMultilibFilter() bool { + if o != nil && o.ExcludeMultilibFilter != nil { + return true + } + + return false +} + +// SetExcludeMultilibFilter gets a reference to the given []string and assigns it to the ExcludeMultilibFilter field. +func (o *V1Repository) SetExcludeMultilibFilter(v []string) { + o.ExcludeMultilibFilter = &v +} + +// GetMultilib returns the Multilib field value if set, zero value otherwise. +func (o *V1Repository) GetMultilib() []string { + if o == nil || o.Multilib == nil { + var ret []string + return ret + } + return *o.Multilib +} + +// GetMultilibOk returns a tuple with the Multilib field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetMultilibOk() (*[]string, bool) { + if o == nil || o.Multilib == nil { + return nil, false + } + return o.Multilib, true +} + +// HasMultilib returns a boolean if a field has been set. +func (o *V1Repository) HasMultilib() bool { + if o != nil && o.Multilib != nil { + return true + } + + return false +} + +// SetMultilib gets a reference to the given []string and assigns it to the Multilib field. +func (o *V1Repository) SetMultilib(v []string) { + o.Multilib = &v +} + +// GetGlobIncludeFilter returns the GlobIncludeFilter field value if set, zero value otherwise. +func (o *V1Repository) GetGlobIncludeFilter() []string { + if o == nil || o.GlobIncludeFilter == nil { + var ret []string + return ret + } + return *o.GlobIncludeFilter +} + +// GetGlobIncludeFilterOk returns a tuple with the GlobIncludeFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Repository) GetGlobIncludeFilterOk() (*[]string, bool) { + if o == nil || o.GlobIncludeFilter == nil { + return nil, false + } + return o.GlobIncludeFilter, true +} + +// HasGlobIncludeFilter returns a boolean if a field has been set. +func (o *V1Repository) HasGlobIncludeFilter() bool { + if o != nil && o.GlobIncludeFilter != nil { + return true + } + + return false +} + +// SetGlobIncludeFilter gets a reference to the given []string and assigns it to the GlobIncludeFilter field. +func (o *V1Repository) SetGlobIncludeFilter(v []string) { + o.GlobIncludeFilter = &v +} + +func (o V1Repository) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ProjectId != nil { + toSerialize["projectId"] = o.ProjectId + } + if o.Packages != nil { + toSerialize["packages"] = o.Packages + } + if o.ExcludeFilter != nil { + toSerialize["excludeFilter"] = o.ExcludeFilter + } + if o.IncludeList != nil { + toSerialize["includeList"] = o.IncludeList + } + if o.AdditionalMultilib != nil { + toSerialize["additionalMultilib"] = o.AdditionalMultilib + } + if o.ExcludeMultilibFilter != nil { + toSerialize["excludeMultilibFilter"] = o.ExcludeMultilibFilter + } + if o.Multilib != nil { + toSerialize["multilib"] = o.Multilib + } + if o.GlobIncludeFilter != nil { + toSerialize["globIncludeFilter"] = o.GlobIncludeFilter + } + return json.Marshal(toSerialize) +} + +type NullableV1Repository struct { + value *V1Repository + isSet bool +} + +func (v NullableV1Repository) Get() *V1Repository { + return v.value +} + +func (v *NullableV1Repository) Set(val *V1Repository) { + v.value = val + v.isSet = true +} + +func (v NullableV1Repository) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Repository) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Repository(val *V1Repository) *NullableV1Repository { + return &NullableV1Repository{value: val, isSet: true} +} + +func (v NullableV1Repository) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Repository) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_request.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_request.go new file mode 100644 index 0000000..0c02f07 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_request.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1SearchRequest struct for V1SearchRequest +type V1SearchRequest struct { + Query *string `json:"query,omitempty"` + ProjectId *string `json:"projectId,omitempty"` +} + +// NewV1SearchRequest instantiates a new V1SearchRequest 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 NewV1SearchRequest() *V1SearchRequest { + this := V1SearchRequest{} + return &this +} + +// NewV1SearchRequestWithDefaults instantiates a new V1SearchRequest 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 NewV1SearchRequestWithDefaults() *V1SearchRequest { + this := V1SearchRequest{} + return &this +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *V1SearchRequest) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SearchRequest) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *V1SearchRequest) HasQuery() bool { + if o != nil && o.Query != nil { + return true + } + + return false +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *V1SearchRequest) SetQuery(v string) { + o.Query = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *V1SearchRequest) GetProjectId() string { + if o == nil || o.ProjectId == nil { + 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 *V1SearchRequest) GetProjectIdOk() (*string, bool) { + if o == nil || o.ProjectId == nil { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *V1SearchRequest) HasProjectId() bool { + if o != nil && o.ProjectId != nil { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *V1SearchRequest) SetProjectId(v string) { + o.ProjectId = &v +} + +func (o V1SearchRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.ProjectId != nil { + toSerialize["projectId"] = o.ProjectId + } + return json.Marshal(toSerialize) +} + +type NullableV1SearchRequest struct { + value *V1SearchRequest + isSet bool +} + +func (v NullableV1SearchRequest) Get() *V1SearchRequest { + return v.value +} + +func (v *NullableV1SearchRequest) Set(val *V1SearchRequest) { + v.value = val + v.isSet = true +} + +func (v NullableV1SearchRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableV1SearchRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1SearchRequest(val *V1SearchRequest) *NullableV1SearchRequest { + return &NullableV1SearchRequest{value: val, isSet: true} +} + +func (v NullableV1SearchRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1SearchRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_response.go new file mode 100644 index 0000000..9edb5fe --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_search_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1SearchResponse struct for V1SearchResponse +type V1SearchResponse struct { + Hits *[]ProtobufAny `json:"hits,omitempty"` +} + +// NewV1SearchResponse instantiates a new V1SearchResponse 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 NewV1SearchResponse() *V1SearchResponse { + this := V1SearchResponse{} + return &this +} + +// NewV1SearchResponseWithDefaults instantiates a new V1SearchResponse 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 NewV1SearchResponseWithDefaults() *V1SearchResponse { + this := V1SearchResponse{} + return &this +} + +// GetHits returns the Hits field value if set, zero value otherwise. +func (o *V1SearchResponse) GetHits() []ProtobufAny { + if o == nil || o.Hits == nil { + var ret []ProtobufAny + return ret + } + return *o.Hits +} + +// GetHitsOk returns a tuple with the Hits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SearchResponse) GetHitsOk() (*[]ProtobufAny, bool) { + if o == nil || o.Hits == nil { + return nil, false + } + return o.Hits, true +} + +// HasHits returns a boolean if a field has been set. +func (o *V1SearchResponse) HasHits() bool { + if o != nil && o.Hits != nil { + return true + } + + return false +} + +// SetHits gets a reference to the given []ProtobufAny and assigns it to the Hits field. +func (o *V1SearchResponse) SetHits(v []ProtobufAny) { + o.Hits = &v +} + +func (o V1SearchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Hits != nil { + toSerialize["hits"] = o.Hits + } + return json.Marshal(toSerialize) +} + +type NullableV1SearchResponse struct { + value *V1SearchResponse + isSet bool +} + +func (v NullableV1SearchResponse) Get() *V1SearchResponse { + return v.value +} + +func (v *NullableV1SearchResponse) Set(val *V1SearchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1SearchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1SearchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1SearchResponse(val *V1SearchResponse) *NullableV1SearchResponse { + return &NullableV1SearchResponse{value: val, isSet: true} +} + +func (v NullableV1SearchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1SearchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_set_project_credentials_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_set_project_credentials_response.go new file mode 100644 index 0000000..b712ad7 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_set_project_credentials_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1SetProjectCredentialsResponse struct for V1SetProjectCredentialsResponse +type V1SetProjectCredentialsResponse struct { + GitlabUsername *string `json:"gitlabUsername,omitempty"` +} + +// NewV1SetProjectCredentialsResponse instantiates a new V1SetProjectCredentialsResponse 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 NewV1SetProjectCredentialsResponse() *V1SetProjectCredentialsResponse { + this := V1SetProjectCredentialsResponse{} + return &this +} + +// NewV1SetProjectCredentialsResponseWithDefaults instantiates a new V1SetProjectCredentialsResponse 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 NewV1SetProjectCredentialsResponseWithDefaults() *V1SetProjectCredentialsResponse { + this := V1SetProjectCredentialsResponse{} + return &this +} + +// GetGitlabUsername returns the GitlabUsername field value if set, zero value otherwise. +func (o *V1SetProjectCredentialsResponse) GetGitlabUsername() string { + if o == nil || o.GitlabUsername == nil { + var ret string + return ret + } + return *o.GitlabUsername +} + +// GetGitlabUsernameOk returns a tuple with the GitlabUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SetProjectCredentialsResponse) GetGitlabUsernameOk() (*string, bool) { + if o == nil || o.GitlabUsername == nil { + return nil, false + } + return o.GitlabUsername, true +} + +// HasGitlabUsername returns a boolean if a field has been set. +func (o *V1SetProjectCredentialsResponse) HasGitlabUsername() bool { + if o != nil && o.GitlabUsername != nil { + return true + } + + return false +} + +// SetGitlabUsername gets a reference to the given string and assigns it to the GitlabUsername field. +func (o *V1SetProjectCredentialsResponse) SetGitlabUsername(v string) { + o.GitlabUsername = &v +} + +func (o V1SetProjectCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.GitlabUsername != nil { + toSerialize["gitlabUsername"] = o.GitlabUsername + } + return json.Marshal(toSerialize) +} + +type NullableV1SetProjectCredentialsResponse struct { + value *V1SetProjectCredentialsResponse + isSet bool +} + +func (v NullableV1SetProjectCredentialsResponse) Get() *V1SetProjectCredentialsResponse { + return v.value +} + +func (v *NullableV1SetProjectCredentialsResponse) Set(val *V1SetProjectCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1SetProjectCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1SetProjectCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1SetProjectCredentialsResponse(val *V1SetProjectCredentialsResponse) *NullableV1SetProjectCredentialsResponse { + return &NullableV1SetProjectCredentialsResponse{value: val, isSet: true} +} + +func (v NullableV1SetProjectCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1SetProjectCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_batch_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_batch_response.go new file mode 100644 index 0000000..0a45d65 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_batch_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1SubmitBuildBatchResponse struct for V1SubmitBuildBatchResponse +type V1SubmitBuildBatchResponse struct { + BuildBatchId *string `json:"buildBatchId,omitempty"` +} + +// NewV1SubmitBuildBatchResponse instantiates a new V1SubmitBuildBatchResponse 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 NewV1SubmitBuildBatchResponse() *V1SubmitBuildBatchResponse { + this := V1SubmitBuildBatchResponse{} + return &this +} + +// NewV1SubmitBuildBatchResponseWithDefaults instantiates a new V1SubmitBuildBatchResponse 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 NewV1SubmitBuildBatchResponseWithDefaults() *V1SubmitBuildBatchResponse { + this := V1SubmitBuildBatchResponse{} + return &this +} + +// GetBuildBatchId returns the BuildBatchId field value if set, zero value otherwise. +func (o *V1SubmitBuildBatchResponse) GetBuildBatchId() string { + if o == nil || o.BuildBatchId == nil { + var ret string + return ret + } + return *o.BuildBatchId +} + +// GetBuildBatchIdOk returns a tuple with the BuildBatchId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildBatchResponse) GetBuildBatchIdOk() (*string, bool) { + if o == nil || o.BuildBatchId == nil { + return nil, false + } + return o.BuildBatchId, true +} + +// HasBuildBatchId returns a boolean if a field has been set. +func (o *V1SubmitBuildBatchResponse) HasBuildBatchId() bool { + if o != nil && o.BuildBatchId != nil { + return true + } + + return false +} + +// SetBuildBatchId gets a reference to the given string and assigns it to the BuildBatchId field. +func (o *V1SubmitBuildBatchResponse) SetBuildBatchId(v string) { + o.BuildBatchId = &v +} + +func (o V1SubmitBuildBatchResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BuildBatchId != nil { + toSerialize["buildBatchId"] = o.BuildBatchId + } + return json.Marshal(toSerialize) +} + +type NullableV1SubmitBuildBatchResponse struct { + value *V1SubmitBuildBatchResponse + isSet bool +} + +func (v NullableV1SubmitBuildBatchResponse) Get() *V1SubmitBuildBatchResponse { + return v.value +} + +func (v *NullableV1SubmitBuildBatchResponse) Set(val *V1SubmitBuildBatchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1SubmitBuildBatchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1SubmitBuildBatchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1SubmitBuildBatchResponse(val *V1SubmitBuildBatchResponse) *NullableV1SubmitBuildBatchResponse { + return &NullableV1SubmitBuildBatchResponse{value: val, isSet: true} +} + +func (v NullableV1SubmitBuildBatchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1SubmitBuildBatchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_request.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_request.go new file mode 100644 index 0000000..ca3fc5d --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_submit_build_request.go @@ -0,0 +1,404 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1SubmitBuildRequest struct for V1SubmitBuildRequest +type V1SubmitBuildRequest struct { + // Project ID that we want this build to be assigned to All build requests need a project id, however after the initial import, sharing the VRE in an inter-project way is possible. + ProjectId *string `json:"projectId,omitempty"` + PackageName *string `json:"packageName,omitempty"` + PackageId *string `json:"packageId,omitempty"` + ScmHash *string `json:"scmHash,omitempty"` + DisableChecks *bool `json:"disableChecks,omitempty"` + Branches *[]string `json:"branches,omitempty"` + ModuleVariant *bool `json:"moduleVariant,omitempty"` + SideNvrs *[]string `json:"sideNvrs,omitempty"` + SetInactive *bool `json:"setInactive,omitempty"` +} + +// NewV1SubmitBuildRequest instantiates a new V1SubmitBuildRequest 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 NewV1SubmitBuildRequest() *V1SubmitBuildRequest { + this := V1SubmitBuildRequest{} + return &this +} + +// NewV1SubmitBuildRequestWithDefaults instantiates a new V1SubmitBuildRequest 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 NewV1SubmitBuildRequestWithDefaults() *V1SubmitBuildRequest { + this := V1SubmitBuildRequest{} + return &this +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetProjectId() string { + if o == nil || o.ProjectId == nil { + 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 *V1SubmitBuildRequest) GetProjectIdOk() (*string, bool) { + if o == nil || o.ProjectId == nil { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasProjectId() bool { + if o != nil && o.ProjectId != nil { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *V1SubmitBuildRequest) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetPackageNameOk() (*string, bool) { + if o == nil || o.PackageName == nil { + return nil, false + } + return o.PackageName, true +} + +// HasPackageName returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasPackageName() bool { + if o != nil && o.PackageName != nil { + return true + } + + return false +} + +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *V1SubmitBuildRequest) SetPackageName(v string) { + o.PackageName = &v +} + +// GetPackageId returns the PackageId field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetPackageId() string { + if o == nil || o.PackageId == nil { + var ret string + return ret + } + return *o.PackageId +} + +// GetPackageIdOk returns a tuple with the PackageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetPackageIdOk() (*string, bool) { + if o == nil || o.PackageId == nil { + return nil, false + } + return o.PackageId, true +} + +// HasPackageId returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasPackageId() bool { + if o != nil && o.PackageId != nil { + return true + } + + return false +} + +// SetPackageId gets a reference to the given string and assigns it to the PackageId field. +func (o *V1SubmitBuildRequest) SetPackageId(v string) { + o.PackageId = &v +} + +// GetScmHash returns the ScmHash field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetScmHash() string { + if o == nil || o.ScmHash == nil { + var ret string + return ret + } + return *o.ScmHash +} + +// GetScmHashOk returns a tuple with the ScmHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetScmHashOk() (*string, bool) { + if o == nil || o.ScmHash == nil { + return nil, false + } + return o.ScmHash, true +} + +// HasScmHash returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasScmHash() bool { + if o != nil && o.ScmHash != nil { + return true + } + + return false +} + +// SetScmHash gets a reference to the given string and assigns it to the ScmHash field. +func (o *V1SubmitBuildRequest) SetScmHash(v string) { + o.ScmHash = &v +} + +// GetDisableChecks returns the DisableChecks field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetDisableChecks() bool { + if o == nil || o.DisableChecks == nil { + var ret bool + return ret + } + return *o.DisableChecks +} + +// GetDisableChecksOk returns a tuple with the DisableChecks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetDisableChecksOk() (*bool, bool) { + if o == nil || o.DisableChecks == nil { + return nil, false + } + return o.DisableChecks, true +} + +// HasDisableChecks returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasDisableChecks() bool { + if o != nil && o.DisableChecks != nil { + return true + } + + return false +} + +// SetDisableChecks gets a reference to the given bool and assigns it to the DisableChecks field. +func (o *V1SubmitBuildRequest) SetDisableChecks(v bool) { + o.DisableChecks = &v +} + +// GetBranches returns the Branches field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetBranches() []string { + if o == nil || o.Branches == nil { + var ret []string + return ret + } + return *o.Branches +} + +// GetBranchesOk returns a tuple with the Branches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetBranchesOk() (*[]string, bool) { + if o == nil || o.Branches == nil { + return nil, false + } + return o.Branches, true +} + +// HasBranches returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasBranches() bool { + if o != nil && o.Branches != nil { + return true + } + + return false +} + +// SetBranches gets a reference to the given []string and assigns it to the Branches field. +func (o *V1SubmitBuildRequest) SetBranches(v []string) { + o.Branches = &v +} + +// GetModuleVariant returns the ModuleVariant field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetModuleVariant() bool { + if o == nil || o.ModuleVariant == nil { + var ret bool + return ret + } + return *o.ModuleVariant +} + +// GetModuleVariantOk returns a tuple with the ModuleVariant field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetModuleVariantOk() (*bool, bool) { + if o == nil || o.ModuleVariant == nil { + return nil, false + } + return o.ModuleVariant, true +} + +// HasModuleVariant returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasModuleVariant() bool { + if o != nil && o.ModuleVariant != nil { + return true + } + + return false +} + +// SetModuleVariant gets a reference to the given bool and assigns it to the ModuleVariant field. +func (o *V1SubmitBuildRequest) SetModuleVariant(v bool) { + o.ModuleVariant = &v +} + +// GetSideNvrs returns the SideNvrs field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetSideNvrs() []string { + if o == nil || o.SideNvrs == nil { + var ret []string + return ret + } + return *o.SideNvrs +} + +// GetSideNvrsOk returns a tuple with the SideNvrs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetSideNvrsOk() (*[]string, bool) { + if o == nil || o.SideNvrs == nil { + return nil, false + } + return o.SideNvrs, true +} + +// HasSideNvrs returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasSideNvrs() bool { + if o != nil && o.SideNvrs != nil { + return true + } + + return false +} + +// SetSideNvrs gets a reference to the given []string and assigns it to the SideNvrs field. +func (o *V1SubmitBuildRequest) SetSideNvrs(v []string) { + o.SideNvrs = &v +} + +// GetSetInactive returns the SetInactive field value if set, zero value otherwise. +func (o *V1SubmitBuildRequest) GetSetInactive() bool { + if o == nil || o.SetInactive == nil { + var ret bool + return ret + } + return *o.SetInactive +} + +// GetSetInactiveOk returns a tuple with the SetInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1SubmitBuildRequest) GetSetInactiveOk() (*bool, bool) { + if o == nil || o.SetInactive == nil { + return nil, false + } + return o.SetInactive, true +} + +// HasSetInactive returns a boolean if a field has been set. +func (o *V1SubmitBuildRequest) HasSetInactive() bool { + if o != nil && o.SetInactive != nil { + return true + } + + return false +} + +// SetSetInactive gets a reference to the given bool and assigns it to the SetInactive field. +func (o *V1SubmitBuildRequest) SetSetInactive(v bool) { + o.SetInactive = &v +} + +func (o V1SubmitBuildRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ProjectId != nil { + toSerialize["projectId"] = o.ProjectId + } + if o.PackageName != nil { + toSerialize["packageName"] = o.PackageName + } + if o.PackageId != nil { + toSerialize["packageId"] = o.PackageId + } + if o.ScmHash != nil { + toSerialize["scmHash"] = o.ScmHash + } + if o.DisableChecks != nil { + toSerialize["disableChecks"] = o.DisableChecks + } + if o.Branches != nil { + toSerialize["branches"] = o.Branches + } + if o.ModuleVariant != nil { + toSerialize["moduleVariant"] = o.ModuleVariant + } + if o.SideNvrs != nil { + toSerialize["sideNvrs"] = o.SideNvrs + } + if o.SetInactive != nil { + toSerialize["setInactive"] = o.SetInactive + } + return json.Marshal(toSerialize) +} + +type NullableV1SubmitBuildRequest struct { + value *V1SubmitBuildRequest + isSet bool +} + +func (v NullableV1SubmitBuildRequest) Get() *V1SubmitBuildRequest { + return v.value +} + +func (v *NullableV1SubmitBuildRequest) Set(val *V1SubmitBuildRequest) { + v.value = val + v.isSet = true +} + +func (v NullableV1SubmitBuildRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableV1SubmitBuildRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1SubmitBuildRequest(val *V1SubmitBuildRequest) *NullableV1SubmitBuildRequest { + return &NullableV1SubmitBuildRequest{value: val, isSet: true} +} + +func (v NullableV1SubmitBuildRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1SubmitBuildRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_subtask.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_subtask.go new file mode 100644 index 0000000..77486d3 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_subtask.go @@ -0,0 +1,520 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "time" +) + +// V1Subtask struct for V1Subtask +type V1Subtask struct { + Arch *string `json:"arch,omitempty"` + Type *V1TaskType `json:"type,omitempty"` + Response *ProtobufAny `json:"response,omitempty"` + Metadata *ProtobufAny `json:"metadata,omitempty"` + Status *V1TaskStatus `json:"status,omitempty"` + ParentTaskId *string `json:"parentTaskId,omitempty"` + Id *string `json:"id,omitempty"` + SubmitterId *string `json:"submitterId,omitempty"` + SubmitterDisplayName *string `json:"submitterDisplayName,omitempty"` + SubmitterEmail *string `json:"submitterEmail,omitempty"` + FinishedAt *time.Time `json:"finishedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` +} + +// NewV1Subtask instantiates a new V1Subtask 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 NewV1Subtask() *V1Subtask { + this := V1Subtask{} + var type_ V1TaskType = UNKNOWN + this.Type = &type_ + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// NewV1SubtaskWithDefaults instantiates a new V1Subtask 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 NewV1SubtaskWithDefaults() *V1Subtask { + this := V1Subtask{} + var type_ V1TaskType = UNKNOWN + this.Type = &type_ + var status V1TaskStatus = UNSPECIFIED + this.Status = &status + return &this +} + +// GetArch returns the Arch field value if set, zero value otherwise. +func (o *V1Subtask) GetArch() string { + if o == nil || o.Arch == nil { + var ret string + return ret + } + return *o.Arch +} + +// GetArchOk returns a tuple with the Arch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetArchOk() (*string, bool) { + if o == nil || o.Arch == nil { + return nil, false + } + return o.Arch, true +} + +// HasArch returns a boolean if a field has been set. +func (o *V1Subtask) HasArch() bool { + if o != nil && o.Arch != nil { + return true + } + + return false +} + +// SetArch gets a reference to the given string and assigns it to the Arch field. +func (o *V1Subtask) SetArch(v string) { + o.Arch = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *V1Subtask) GetType() V1TaskType { + if o == nil || o.Type == nil { + var ret V1TaskType + 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 *V1Subtask) GetTypeOk() (*V1TaskType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *V1Subtask) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given V1TaskType and assigns it to the Type field. +func (o *V1Subtask) SetType(v V1TaskType) { + o.Type = &v +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *V1Subtask) GetResponse() ProtobufAny { + if o == nil || o.Response == nil { + var ret ProtobufAny + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetResponseOk() (*ProtobufAny, bool) { + if o == nil || o.Response == nil { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *V1Subtask) HasResponse() bool { + if o != nil && o.Response != nil { + return true + } + + return false +} + +// SetResponse gets a reference to the given ProtobufAny and assigns it to the Response field. +func (o *V1Subtask) SetResponse(v ProtobufAny) { + o.Response = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *V1Subtask) GetMetadata() ProtobufAny { + if o == nil || o.Metadata == nil { + var ret ProtobufAny + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetMetadataOk() (*ProtobufAny, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *V1Subtask) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given ProtobufAny and assigns it to the Metadata field. +func (o *V1Subtask) SetMetadata(v ProtobufAny) { + o.Metadata = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V1Subtask) GetStatus() V1TaskStatus { + if o == nil || o.Status == nil { + var ret V1TaskStatus + 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 *V1Subtask) GetStatusOk() (*V1TaskStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V1Subtask) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given V1TaskStatus and assigns it to the Status field. +func (o *V1Subtask) SetStatus(v V1TaskStatus) { + o.Status = &v +} + +// GetParentTaskId returns the ParentTaskId field value if set, zero value otherwise. +func (o *V1Subtask) GetParentTaskId() string { + if o == nil || o.ParentTaskId == nil { + var ret string + return ret + } + return *o.ParentTaskId +} + +// GetParentTaskIdOk returns a tuple with the ParentTaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetParentTaskIdOk() (*string, bool) { + if o == nil || o.ParentTaskId == nil { + return nil, false + } + return o.ParentTaskId, true +} + +// HasParentTaskId returns a boolean if a field has been set. +func (o *V1Subtask) HasParentTaskId() bool { + if o != nil && o.ParentTaskId != nil { + return true + } + + return false +} + +// SetParentTaskId gets a reference to the given string and assigns it to the ParentTaskId field. +func (o *V1Subtask) SetParentTaskId(v string) { + o.ParentTaskId = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V1Subtask) GetId() string { + if o == nil || o.Id == nil { + 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 *V1Subtask) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V1Subtask) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V1Subtask) SetId(v string) { + o.Id = &v +} + +// GetSubmitterId returns the SubmitterId field value if set, zero value otherwise. +func (o *V1Subtask) GetSubmitterId() string { + if o == nil || o.SubmitterId == nil { + var ret string + return ret + } + return *o.SubmitterId +} + +// GetSubmitterIdOk returns a tuple with the SubmitterId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetSubmitterIdOk() (*string, bool) { + if o == nil || o.SubmitterId == nil { + return nil, false + } + return o.SubmitterId, true +} + +// HasSubmitterId returns a boolean if a field has been set. +func (o *V1Subtask) HasSubmitterId() bool { + if o != nil && o.SubmitterId != nil { + return true + } + + return false +} + +// SetSubmitterId gets a reference to the given string and assigns it to the SubmitterId field. +func (o *V1Subtask) SetSubmitterId(v string) { + o.SubmitterId = &v +} + +// GetSubmitterDisplayName returns the SubmitterDisplayName field value if set, zero value otherwise. +func (o *V1Subtask) GetSubmitterDisplayName() string { + if o == nil || o.SubmitterDisplayName == nil { + var ret string + return ret + } + return *o.SubmitterDisplayName +} + +// GetSubmitterDisplayNameOk returns a tuple with the SubmitterDisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetSubmitterDisplayNameOk() (*string, bool) { + if o == nil || o.SubmitterDisplayName == nil { + return nil, false + } + return o.SubmitterDisplayName, true +} + +// HasSubmitterDisplayName returns a boolean if a field has been set. +func (o *V1Subtask) HasSubmitterDisplayName() bool { + if o != nil && o.SubmitterDisplayName != nil { + return true + } + + return false +} + +// SetSubmitterDisplayName gets a reference to the given string and assigns it to the SubmitterDisplayName field. +func (o *V1Subtask) SetSubmitterDisplayName(v string) { + o.SubmitterDisplayName = &v +} + +// GetSubmitterEmail returns the SubmitterEmail field value if set, zero value otherwise. +func (o *V1Subtask) GetSubmitterEmail() string { + if o == nil || o.SubmitterEmail == nil { + var ret string + return ret + } + return *o.SubmitterEmail +} + +// GetSubmitterEmailOk returns a tuple with the SubmitterEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetSubmitterEmailOk() (*string, bool) { + if o == nil || o.SubmitterEmail == nil { + return nil, false + } + return o.SubmitterEmail, true +} + +// HasSubmitterEmail returns a boolean if a field has been set. +func (o *V1Subtask) HasSubmitterEmail() bool { + if o != nil && o.SubmitterEmail != nil { + return true + } + + return false +} + +// SetSubmitterEmail gets a reference to the given string and assigns it to the SubmitterEmail field. +func (o *V1Subtask) SetSubmitterEmail(v string) { + o.SubmitterEmail = &v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. +func (o *V1Subtask) GetFinishedAt() time.Time { + if o == nil || o.FinishedAt == nil { + var ret time.Time + return ret + } + return *o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1Subtask) GetFinishedAtOk() (*time.Time, bool) { + if o == nil || o.FinishedAt == nil { + return nil, false + } + return o.FinishedAt, true +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *V1Subtask) HasFinishedAt() bool { + if o != nil && o.FinishedAt != nil { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given time.Time and assigns it to the FinishedAt field. +func (o *V1Subtask) SetFinishedAt(v time.Time) { + o.FinishedAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V1Subtask) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + 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 *V1Subtask) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V1Subtask) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V1Subtask) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +func (o V1Subtask) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Arch != nil { + toSerialize["arch"] = o.Arch + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Response != nil { + toSerialize["response"] = o.Response + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.ParentTaskId != nil { + toSerialize["parentTaskId"] = o.ParentTaskId + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.SubmitterId != nil { + toSerialize["submitterId"] = o.SubmitterId + } + if o.SubmitterDisplayName != nil { + toSerialize["submitterDisplayName"] = o.SubmitterDisplayName + } + if o.SubmitterEmail != nil { + toSerialize["submitterEmail"] = o.SubmitterEmail + } + if o.FinishedAt != nil { + toSerialize["finishedAt"] = o.FinishedAt + } + if o.CreatedAt != nil { + toSerialize["createdAt"] = o.CreatedAt + } + return json.Marshal(toSerialize) +} + +type NullableV1Subtask struct { + value *V1Subtask + isSet bool +} + +func (v NullableV1Subtask) Get() *V1Subtask { + return v.value +} + +func (v *NullableV1Subtask) Set(val *V1Subtask) { + v.value = val + v.isSet = true +} + +func (v NullableV1Subtask) IsSet() bool { + return v.isSet +} + +func (v *NullableV1Subtask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1Subtask(val *V1Subtask) *NullableV1Subtask { + return &NullableV1Subtask{value: val, isSet: true} +} + +func (v NullableV1Subtask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1Subtask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_status.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_status.go new file mode 100644 index 0000000..0d50c32 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_status.go @@ -0,0 +1,88 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "fmt" +) + +// V1TaskStatus the model 'V1TaskStatus' +type V1TaskStatus string + +// List of v1TaskStatus +const ( + UNSPECIFIED V1TaskStatus = "TASK_STATUS_UNSPECIFIED" + PENDING V1TaskStatus = "TASK_STATUS_PENDING" + RUNNING V1TaskStatus = "TASK_STATUS_RUNNING" + SUCCEEDED V1TaskStatus = "TASK_STATUS_SUCCEEDED" + FAILED V1TaskStatus = "TASK_STATUS_FAILED" + CANCELED V1TaskStatus = "TASK_STATUS_CANCELED" +) + +func (v *V1TaskStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := V1TaskStatus(value) + for _, existing := range []V1TaskStatus{ "TASK_STATUS_UNSPECIFIED", "TASK_STATUS_PENDING", "TASK_STATUS_RUNNING", "TASK_STATUS_SUCCEEDED", "TASK_STATUS_FAILED", "TASK_STATUS_CANCELED", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid V1TaskStatus", value) +} + +// Ptr returns reference to v1TaskStatus value +func (v V1TaskStatus) Ptr() *V1TaskStatus { + return &v +} + +type NullableV1TaskStatus struct { + value *V1TaskStatus + isSet bool +} + +func (v NullableV1TaskStatus) Get() *V1TaskStatus { + return v.value +} + +func (v *NullableV1TaskStatus) Set(val *V1TaskStatus) { + v.value = val + v.isSet = true +} + +func (v NullableV1TaskStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableV1TaskStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1TaskStatus(val *V1TaskStatus) *NullableV1TaskStatus { + return &NullableV1TaskStatus{value: val, isSet: true} +} + +func (v NullableV1TaskStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1TaskStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_type.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_type.go new file mode 100644 index 0000000..15a9954 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_task_type.go @@ -0,0 +1,102 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "fmt" +) + +// V1TaskType the model 'V1TaskType' +type V1TaskType string + +// List of v1TaskType +const ( + UNKNOWN V1TaskType = "TASK_TYPE_UNKNOWN" + IMPORT V1TaskType = "TASK_TYPE_IMPORT" + IMPORT_SRC_GIT V1TaskType = "TASK_TYPE_IMPORT_SRC_GIT" + IMPORT_SRC_GIT_TO_DIST_GIT V1TaskType = "TASK_TYPE_IMPORT_SRC_GIT_TO_DIST_GIT" + IMPORT_DOWNSTREAM V1TaskType = "TASK_TYPE_IMPORT_DOWNSTREAM" + IMPORT_UPSTREAM V1TaskType = "TASK_TYPE_IMPORT_UPSTREAM" + BUILD V1TaskType = "TASK_TYPE_BUILD" + BUILD_SRPM V1TaskType = "TASK_TYPE_BUILD_SRPM" + BUILD_ARCH V1TaskType = "TASK_TYPE_BUILD_ARCH" + BUILD_SRPM_UPLOAD V1TaskType = "TASK_TYPE_BUILD_SRPM_UPLOAD" + BUILD_ARCH_UPLOAD V1TaskType = "TASK_TYPE_BUILD_ARCH_UPLOAD" + WORKER_PROVISION V1TaskType = "TASK_TYPE_WORKER_PROVISION" + WORKER_DESTROY V1TaskType = "TASK_TYPE_WORKER_DESTROY" + YUMREPOFS_UPDATE V1TaskType = "TASK_TYPE_YUMREPOFS_UPDATE" + KEYKEEPER_SIGN_ARTIFACT V1TaskType = "TASK_TYPE_KEYKEEPER_SIGN_ARTIFACT" + SYNC_CATALOG V1TaskType = "TASK_TYPE_SYNC_CATALOG" + RPM_IMPORT V1TaskType = "TASK_TYPE_RPM_IMPORT" + CREATE_HASHED_REPOSITORIES V1TaskType = "TASK_TYPE_CREATE_HASHED_REPOSITORIES" + LOOKASIDE_FILE_UPLOAD V1TaskType = "TASK_TYPE_LOOKASIDE_FILE_UPLOAD" + RPM_LOOKASIDE_BATCH_IMPORT V1TaskType = "TASK_TYPE_RPM_LOOKASIDE_BATCH_IMPORT" +) + +func (v *V1TaskType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := V1TaskType(value) + for _, existing := range []V1TaskType{ "TASK_TYPE_UNKNOWN", "TASK_TYPE_IMPORT", "TASK_TYPE_IMPORT_SRC_GIT", "TASK_TYPE_IMPORT_SRC_GIT_TO_DIST_GIT", "TASK_TYPE_IMPORT_DOWNSTREAM", "TASK_TYPE_IMPORT_UPSTREAM", "TASK_TYPE_BUILD", "TASK_TYPE_BUILD_SRPM", "TASK_TYPE_BUILD_ARCH", "TASK_TYPE_BUILD_SRPM_UPLOAD", "TASK_TYPE_BUILD_ARCH_UPLOAD", "TASK_TYPE_WORKER_PROVISION", "TASK_TYPE_WORKER_DESTROY", "TASK_TYPE_YUMREPOFS_UPDATE", "TASK_TYPE_KEYKEEPER_SIGN_ARTIFACT", "TASK_TYPE_SYNC_CATALOG", "TASK_TYPE_RPM_IMPORT", "TASK_TYPE_CREATE_HASHED_REPOSITORIES", "TASK_TYPE_LOOKASIDE_FILE_UPLOAD", "TASK_TYPE_RPM_LOOKASIDE_BATCH_IMPORT", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid V1TaskType", value) +} + +// Ptr returns reference to v1TaskType value +func (v V1TaskType) Ptr() *V1TaskType { + return &v +} + +type NullableV1TaskType struct { + value *V1TaskType + isSet bool +} + +func (v NullableV1TaskType) Get() *V1TaskType { + return v.value +} + +func (v *NullableV1TaskType) Set(val *V1TaskType) { + v.value = val + v.isSet = true +} + +func (v NullableV1TaskType) IsSet() bool { + return v.isSet +} + +func (v *NullableV1TaskType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1TaskType(val *V1TaskType) *NullableV1TaskType { + return &NullableV1TaskType{value: val, isSet: true} +} + +func (v NullableV1TaskType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1TaskType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_update_project_response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_update_project_response.go new file mode 100644 index 0000000..3b86b1f --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_update_project_response.go @@ -0,0 +1,115 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1UpdateProjectResponse struct for V1UpdateProjectResponse +type V1UpdateProjectResponse struct { + Project *V1Project `json:"project,omitempty"` +} + +// NewV1UpdateProjectResponse instantiates a new V1UpdateProjectResponse 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 NewV1UpdateProjectResponse() *V1UpdateProjectResponse { + this := V1UpdateProjectResponse{} + return &this +} + +// NewV1UpdateProjectResponseWithDefaults instantiates a new V1UpdateProjectResponse 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 NewV1UpdateProjectResponseWithDefaults() *V1UpdateProjectResponse { + this := V1UpdateProjectResponse{} + return &this +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *V1UpdateProjectResponse) GetProject() V1Project { + if o == nil || o.Project == nil { + var ret V1Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1UpdateProjectResponse) GetProjectOk() (*V1Project, bool) { + if o == nil || o.Project == nil { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *V1UpdateProjectResponse) HasProject() bool { + if o != nil && o.Project != nil { + return true + } + + return false +} + +// SetProject gets a reference to the given V1Project and assigns it to the Project field. +func (o *V1UpdateProjectResponse) SetProject(v V1Project) { + o.Project = &v +} + +func (o V1UpdateProjectResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Project != nil { + toSerialize["project"] = o.Project + } + return json.Marshal(toSerialize) +} + +type NullableV1UpdateProjectResponse struct { + value *V1UpdateProjectResponse + isSet bool +} + +func (v NullableV1UpdateProjectResponse) Get() *V1UpdateProjectResponse { + return v.value +} + +func (v *NullableV1UpdateProjectResponse) Set(val *V1UpdateProjectResponse) { + v.value = val + v.isSet = true +} + +func (v NullableV1UpdateProjectResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableV1UpdateProjectResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1UpdateProjectResponse(val *V1UpdateProjectResponse) *NullableV1UpdateProjectResponse { + return &NullableV1UpdateProjectResponse{value: val, isSet: true} +} + +func (v NullableV1UpdateProjectResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1UpdateProjectResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_version_release.go b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_version_release.go new file mode 100644 index 0000000..9f45cd8 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/model_v1_version_release.go @@ -0,0 +1,151 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" +) + +// V1VersionRelease struct for V1VersionRelease +type V1VersionRelease struct { + Version *string `json:"version,omitempty"` + Release *string `json:"release,omitempty"` +} + +// NewV1VersionRelease instantiates a new V1VersionRelease 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 NewV1VersionRelease() *V1VersionRelease { + this := V1VersionRelease{} + return &this +} + +// NewV1VersionReleaseWithDefaults instantiates a new V1VersionRelease 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 NewV1VersionReleaseWithDefaults() *V1VersionRelease { + this := V1VersionRelease{} + return &this +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *V1VersionRelease) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1VersionRelease) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *V1VersionRelease) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *V1VersionRelease) SetVersion(v string) { + o.Version = &v +} + +// GetRelease returns the Release field value if set, zero value otherwise. +func (o *V1VersionRelease) GetRelease() string { + if o == nil || o.Release == nil { + var ret string + return ret + } + return *o.Release +} + +// GetReleaseOk returns a tuple with the Release field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1VersionRelease) GetReleaseOk() (*string, bool) { + if o == nil || o.Release == nil { + return nil, false + } + return o.Release, true +} + +// HasRelease returns a boolean if a field has been set. +func (o *V1VersionRelease) HasRelease() bool { + if o != nil && o.Release != nil { + return true + } + + return false +} + +// SetRelease gets a reference to the given string and assigns it to the Release field. +func (o *V1VersionRelease) SetRelease(v string) { + o.Release = &v +} + +func (o V1VersionRelease) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Version != nil { + toSerialize["version"] = o.Version + } + if o.Release != nil { + toSerialize["release"] = o.Release + } + return json.Marshal(toSerialize) +} + +type NullableV1VersionRelease struct { + value *V1VersionRelease + isSet bool +} + +func (v NullableV1VersionRelease) Get() *V1VersionRelease { + return v.value +} + +func (v *NullableV1VersionRelease) Set(val *V1VersionRelease) { + v.value = val + v.isSet = true +} + +func (v NullableV1VersionRelease) IsSet() bool { + return v.isSet +} + +func (v *NullableV1VersionRelease) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1VersionRelease(val *V1VersionRelease) *NullableV1VersionRelease { + return &NullableV1VersionRelease{value: val, isSet: true} +} + +func (v NullableV1VersionRelease) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1VersionRelease) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/openapi.peridot.resf.org/peridotopenapi/response.go b/vendor/openapi.peridot.resf.org/peridotopenapi/response.go new file mode 100644 index 0000000..59de1a7 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/response.go @@ -0,0 +1,47 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +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 APIResonse 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/vendor/openapi.peridot.resf.org/peridotopenapi/utils.go b/vendor/openapi.peridot.resf.org/peridotopenapi/utils.go new file mode 100644 index 0000000..e6ba020 --- /dev/null +++ b/vendor/openapi.peridot.resf.org/peridotopenapi/utils.go @@ -0,0 +1,328 @@ +/* + * peridot/proto/v1/batch.proto + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: version not set + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package peridotopenapi + +import ( + "encoding/json" + "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 v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}