From 25230fbb8e6d4dad86365d7aba63b7b40e7ac340 Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Thu, 13 Aug 2020 17:09:10 -0700 Subject: [PATCH 1/6] chore(gateapi): update gateapi from 5c625da5 using swagger 2.4.14 --- gateapi/.swagger-codegen/VERSION | 2 +- gateapi/README.md | 4 +- .../amazon_infrastructure_controller_api.go | 363 --- gateapi/api/swagger.yaml | 1962 ++++++++------- .../api_amazon_infrastructure_controller.go | 480 ++++ gateapi/api_application_controller.go | 1473 ++++++++++++ gateapi/api_artifact_controller.go | 318 +++ gateapi/api_auth_controller.go | 433 ++++ gateapi/api_bake_controller.go | 291 +++ gateapi/api_build_controller.go | 939 ++++++++ gateapi/api_ci_controller.go | 127 + gateapi/api_cluster_controller.go | 871 +++++++ gateapi/api_concourse_controller.go | 301 +++ gateapi/api_credentials_controller.go | 342 +++ gateapi/api_deck_plugins_controller.go | 205 ++ ...api_ecs_server_group_events_controller.go} | 86 +- gateapi/api_executions_controller.go | 292 +++ gateapi/api_firewall_controller.go | 449 ++++ gateapi/api_image_controller.go | 357 +++ gateapi/api_instance_controller.go | 237 ++ gateapi/api_job_controller.go | 137 ++ gateapi/api_load_balancer_controller.go | 437 ++++ gateapi/api_managed_controller.go | 2136 +++++++++++++++++ gateapi/api_network_controller.go | 222 ++ gateapi/api_pipeline_config_controller.go | 300 +++ gateapi/api_pipeline_controller.go | 1611 +++++++++++++ gateapi/api_pipeline_templates_controller.go | 687 ++++++ gateapi/api_plugin_info_controller.go | 376 +++ ...pi.go => api_plugin_publish_controller.go} | 68 +- gateapi/api_plugins_installed_controller.go | 123 + gateapi/api_project_controller.go | 403 ++++ gateapi/api_pubsub_subscription_controller.go | 112 + ...go => api_reorder_pipelines_controller.go} | 76 +- gateapi/api_search_controller.go | 150 ++ gateapi/api_security_group_controller.go | 344 +++ gateapi/api_server_group_controller.go | 250 ++ ...=> api_server_group_manager_controller.go} | 76 +- gateapi/api_snapshot_controller.go | 218 ++ gateapi/api_subnet_controller.go | 115 + gateapi/api_task_controller.go | 569 +++++ gateapi/api_v2_canary_config_controller.go | 507 ++++ gateapi/api_v2_canary_controller.go | 937 ++++++++ .../api_v2_pipeline_templates_controller.go | 799 ++++++ gateapi/api_version_controller.go | 112 + gateapi/api_webhook_controller.go | 230 ++ gateapi/application_controller_api.go | 1102 --------- gateapi/artifact_controller_api.go | 243 -- gateapi/auth_controller_api.go | 336 --- gateapi/bake_controller_api.go | 221 -- gateapi/build_controller_api.go | 696 ------ gateapi/ci_controller_api.go | 102 - gateapi/{api_client.go => client.go} | 225 +- gateapi/cluster_controller_api.go | 672 ------ gateapi/concourse_controller_api.go | 231 -- gateapi/configuration.go | 32 +- gateapi/credentials_controller_api.go | 327 --- gateapi/deck_plugins_controller_api.go | 159 -- .../docs/AmazonInfrastructureControllerApi.md | 14 +- gateapi/docs/ApplicationControllerApi.md | 108 +- gateapi/docs/ArtifactControllerApi.md | 24 +- gateapi/docs/AuthControllerApi.md | 10 +- gateapi/docs/BakeControllerApi.md | 4 +- gateapi/docs/BuildControllerApi.md | 32 +- gateapi/docs/CiControllerApi.md | 12 +- gateapi/docs/ClusterControllerApi.md | 126 +- gateapi/docs/ConcourseControllerApi.md | 6 +- gateapi/docs/CredentialsControllerApi.md | 66 +- gateapi/docs/DeckPluginsControllerApi.md | 2 +- .../docs/EcsServerGroupEventsControllerApi.md | 2 +- gateapi/docs/ExecutionsControllerApi.md | 46 +- gateapi/docs/FirewallControllerApi.md | 54 +- gateapi/docs/ImageControllerApi.md | 46 +- gateapi/docs/InstanceControllerApi.md | 30 +- gateapi/docs/JobControllerApi.md | 18 +- gateapi/docs/LoadBalancerControllerApi.md | 48 +- gateapi/docs/ManagedControllerApi.md | 78 +- gateapi/docs/NetworkControllerApi.md | 18 +- gateapi/docs/PipelineConfigControllerApi.md | 12 +- gateapi/docs/PipelineControllerApi.md | 78 +- .../docs/PipelineTemplatesControllerApi.md | 56 +- gateapi/docs/PluginInfoControllerApi.md | 14 +- gateapi/docs/PluginPublishControllerApi.md | 4 +- gateapi/docs/PluginsInstalledControllerApi.md | 8 +- gateapi/docs/ProjectControllerApi.md | 24 +- gateapi/docs/ReorderPipelinesControllerApi.md | 2 +- gateapi/docs/SearchControllerApi.md | 20 +- gateapi/docs/SecurityGroupControllerApi.md | 40 +- gateapi/docs/ServerGroupControllerApi.md | 34 +- .../docs/ServerGroupManagerControllerApi.md | 2 +- gateapi/docs/SnapshotControllerApi.md | 14 +- gateapi/docs/SubnetControllerApi.md | 2 +- gateapi/docs/TaskControllerApi.md | 22 +- gateapi/docs/V2CanaryConfigControllerApi.md | 52 +- gateapi/docs/V2CanaryControllerApi.md | 92 +- .../docs/V2PipelineTemplatesControllerApi.md | 70 +- gateapi/docs/WebhookControllerApi.md | 16 +- gateapi/executions_controller_api.go | 269 --- gateapi/firewall_controller_api.go | 356 --- gateapi/image_controller_api.go | 292 --- gateapi/instance_controller_api.go | 188 -- gateapi/job_controller_api.go | 114 - gateapi/load_balancer_controller_api.go | 340 --- gateapi/managed_controller_api.go | 1639 ------------- gateapi/{account.go => model_account.go} | 5 - ...nt_details.go => model_account_details.go} | 10 - ...int_state.go => model_constraint_state.go} | 10 - ...t_status.go => model_constraint_status.go} | 4 - ...ersion.go => model_deck_plugin_version.go} | 2 - ...ery_config.go => model_delivery_config.go} | 6 - .../{environment.go => model_environment.go} | 5 - ...n.go => model_environment_artifact_pin.go} | 5 - ....go => model_environment_artifact_veto.go} | 4 - gateapi/{file.go => model_file.go} | 19 - ...uthority.go => model_granted_authority.go} | 1 - ...bject.go => model_hash_mapstringobject.go} | 0 .../{http_entity.go => model_http_entity.go} | 1 - ...{input_stream.go => model_input_stream.go} | 0 ...ringobject.go => model_mapstringobject.go} | 0 ...ringstring.go => model_mapstringstring.go} | 0 ...{notification.go => model_notification.go} | 3 - ...o => model_pipeline_template_dependent.go} | 3 - ...pendency.go => model_plugin_dependency.go} | 3 - ....go => model_reorder_pipelines_command.go} | 2 - gateapi/{resource.go => model_resource.go} | 8 - ...nse_entity.go => model_response_entity.go} | 3 - ...o => model_spinnaker_plugin_descriptor.go} | 9 - ...info.go => model_spinnaker_plugin_info.go} | 7 - ...e.go => model_spinnaker_plugin_release.go} | 6 - gateapi/{uri.go => model_uri.go} | 17 - gateapi/{url.go => model_url.go} | 13 - ...handler.go => model_url_stream_handler.go} | 0 gateapi/{user.go => model_user.go} | 11 - gateapi/{version.go => model_version.go} | 1 - gateapi/network_controller_api.go | 171 -- gateapi/pipeline_config_controller_api.go | 227 -- gateapi/pipeline_controller_api.go | 1221 ---------- gateapi/pipeline_templates_controller_api.go | 511 ---- gateapi/plugin_info_controller_api.go | 281 --- gateapi/plugins_installed_controller_api.go | 98 - gateapi/project_controller_api.go | 306 --- gateapi/pubsub_subscription_controller_api.go | 90 - gateapi/{api_response.go => response.go} | 10 +- gateapi/search_controller_api.go | 135 -- gateapi/security_group_controller_api.go | 275 --- gateapi/server_group_controller_api.go | 207 -- gateapi/snapshot_controller_api.go | 169 -- gateapi/subnet_controller_api.go | 93 - gateapi/task_controller_api.go | 424 ---- gateapi/v2_canary_config_controller_api.go | 392 --- gateapi/v2_canary_controller_api.go | 726 ------ .../v2_pipeline_templates_controller_api.go | 600 ----- gateapi/version_controller_api.go | 90 - gateapi/webhook_controller_api.go | 177 -- 153 files changed, 20041 insertions(+), 15697 deletions(-) delete mode 100644 gateapi/amazon_infrastructure_controller_api.go create mode 100644 gateapi/api_amazon_infrastructure_controller.go create mode 100644 gateapi/api_application_controller.go create mode 100644 gateapi/api_artifact_controller.go create mode 100644 gateapi/api_auth_controller.go create mode 100644 gateapi/api_bake_controller.go create mode 100644 gateapi/api_build_controller.go create mode 100644 gateapi/api_ci_controller.go create mode 100644 gateapi/api_cluster_controller.go create mode 100644 gateapi/api_concourse_controller.go create mode 100644 gateapi/api_credentials_controller.go create mode 100644 gateapi/api_deck_plugins_controller.go rename gateapi/{ecs_server_group_events_controller_api.go => api_ecs_server_group_events_controller.go} (55%) create mode 100644 gateapi/api_executions_controller.go create mode 100644 gateapi/api_firewall_controller.go create mode 100644 gateapi/api_image_controller.go create mode 100644 gateapi/api_instance_controller.go create mode 100644 gateapi/api_job_controller.go create mode 100644 gateapi/api_load_balancer_controller.go create mode 100644 gateapi/api_managed_controller.go create mode 100644 gateapi/api_network_controller.go create mode 100644 gateapi/api_pipeline_config_controller.go create mode 100644 gateapi/api_pipeline_controller.go create mode 100644 gateapi/api_pipeline_templates_controller.go create mode 100644 gateapi/api_plugin_info_controller.go rename gateapi/{plugin_publish_controller_api.go => api_plugin_publish_controller.go} (64%) create mode 100644 gateapi/api_plugins_installed_controller.go create mode 100644 gateapi/api_project_controller.go create mode 100644 gateapi/api_pubsub_subscription_controller.go rename gateapi/{reorder_pipelines_controller_api.go => api_reorder_pipelines_controller.go} (50%) create mode 100644 gateapi/api_search_controller.go create mode 100644 gateapi/api_security_group_controller.go create mode 100644 gateapi/api_server_group_controller.go rename gateapi/{server_group_manager_controller_api.go => api_server_group_manager_controller.go} (51%) create mode 100644 gateapi/api_snapshot_controller.go create mode 100644 gateapi/api_subnet_controller.go create mode 100644 gateapi/api_task_controller.go create mode 100644 gateapi/api_v2_canary_config_controller.go create mode 100644 gateapi/api_v2_canary_controller.go create mode 100644 gateapi/api_v2_pipeline_templates_controller.go create mode 100644 gateapi/api_version_controller.go create mode 100644 gateapi/api_webhook_controller.go delete mode 100644 gateapi/application_controller_api.go delete mode 100644 gateapi/artifact_controller_api.go delete mode 100644 gateapi/auth_controller_api.go delete mode 100644 gateapi/bake_controller_api.go delete mode 100644 gateapi/build_controller_api.go delete mode 100644 gateapi/ci_controller_api.go rename gateapi/{api_client.go => client.go} (73%) delete mode 100644 gateapi/cluster_controller_api.go delete mode 100644 gateapi/concourse_controller_api.go delete mode 100644 gateapi/credentials_controller_api.go delete mode 100644 gateapi/deck_plugins_controller_api.go delete mode 100644 gateapi/executions_controller_api.go delete mode 100644 gateapi/firewall_controller_api.go delete mode 100644 gateapi/image_controller_api.go delete mode 100644 gateapi/instance_controller_api.go delete mode 100644 gateapi/job_controller_api.go delete mode 100644 gateapi/load_balancer_controller_api.go delete mode 100644 gateapi/managed_controller_api.go rename gateapi/{account.go => model_account.go} (99%) rename gateapi/{account_details.go => model_account_details.go} (98%) rename gateapi/{constraint_state.go => model_constraint_state.go} (98%) rename gateapi/{constraint_status.go => model_constraint_status.go} (99%) rename gateapi/{deck_plugin_version.go => model_deck_plugin_version.go} (99%) rename gateapi/{delivery_config.go => model_delivery_config.go} (99%) rename gateapi/{environment.go => model_environment.go} (99%) rename gateapi/{environment_artifact_pin.go => model_environment_artifact_pin.go} (99%) rename gateapi/{environment_artifact_veto.go => model_environment_artifact_veto.go} (99%) rename gateapi/{file.go => model_file.go} (98%) rename gateapi/{granted_authority.go => model_granted_authority.go} (99%) rename gateapi/{hash_mapstringobject.go => model_hash_mapstringobject.go} (100%) rename gateapi/{http_entity.go => model_http_entity.go} (99%) rename gateapi/{input_stream.go => model_input_stream.go} (100%) rename gateapi/{mapstringobject.go => model_mapstringobject.go} (100%) rename gateapi/{mapstringstring.go => model_mapstringstring.go} (100%) rename gateapi/{notification.go => model_notification.go} (99%) rename gateapi/{pipeline_template_dependent.go => model_pipeline_template_dependent.go} (99%) rename gateapi/{plugin_dependency.go => model_plugin_dependency.go} (99%) rename gateapi/{reorder_pipelines_command.go => model_reorder_pipelines_command.go} (99%) rename gateapi/{resource.go => model_resource.go} (98%) rename gateapi/{response_entity.go => model_response_entity.go} (99%) rename gateapi/{spinnaker_plugin_descriptor.go => model_spinnaker_plugin_descriptor.go} (98%) rename gateapi/{spinnaker_plugin_info.go => model_spinnaker_plugin_info.go} (98%) rename gateapi/{spinnaker_plugin_release.go => model_spinnaker_plugin_release.go} (98%) rename gateapi/{uri.go => model_uri.go} (98%) rename gateapi/{url.go => model_url.go} (98%) rename gateapi/{url_stream_handler.go => model_url_stream_handler.go} (100%) rename gateapi/{user.go => model_user.go} (98%) rename gateapi/{version.go => model_version.go} (99%) delete mode 100644 gateapi/network_controller_api.go delete mode 100644 gateapi/pipeline_config_controller_api.go delete mode 100644 gateapi/pipeline_controller_api.go delete mode 100644 gateapi/pipeline_templates_controller_api.go delete mode 100644 gateapi/plugin_info_controller_api.go delete mode 100644 gateapi/plugins_installed_controller_api.go delete mode 100644 gateapi/project_controller_api.go delete mode 100644 gateapi/pubsub_subscription_controller_api.go rename gateapi/{api_response.go => response.go} (84%) delete mode 100644 gateapi/search_controller_api.go delete mode 100644 gateapi/security_group_controller_api.go delete mode 100644 gateapi/server_group_controller_api.go delete mode 100644 gateapi/snapshot_controller_api.go delete mode 100644 gateapi/subnet_controller_api.go delete mode 100644 gateapi/task_controller_api.go delete mode 100644 gateapi/v2_canary_config_controller_api.go delete mode 100644 gateapi/v2_canary_controller_api.go delete mode 100644 gateapi/v2_pipeline_templates_controller_api.go delete mode 100644 gateapi/version_controller_api.go delete mode 100644 gateapi/webhook_controller_api.go diff --git a/gateapi/.swagger-codegen/VERSION b/gateapi/.swagger-codegen/VERSION index a6254504..3eb2ae3e 100644 --- a/gateapi/.swagger-codegen/VERSION +++ b/gateapi/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.14 \ No newline at end of file diff --git a/gateapi/README.md b/gateapi/README.md index 6194e5a0..e7b7be3c 100644 --- a/gateapi/README.md +++ b/gateapi/README.md @@ -11,8 +11,8 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge ## Installation Put the package under your project folder and add the following in import: -``` - "./swagger" +```golang +import "./swagger" ``` ## Documentation for API Endpoints diff --git a/gateapi/amazon_infrastructure_controller_api.go b/gateapi/amazon_infrastructure_controller_api.go deleted file mode 100644 index 0f9db2b0..00000000 --- a/gateapi/amazon_infrastructure_controller_api.go +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type AmazonInfrastructureControllerApiService service - - -/* AmazonInfrastructureControllerApiService Get application functions - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return []interface{}*/ -func (a *AmazonInfrastructureControllerApiService) ApplicationFunctionsUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/functions" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AmazonInfrastructureControllerApiService Get functions - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "account" (string) account - @param "functionName" (string) functionName - @param "region" (string) region - @return []interface{}*/ -func (a *AmazonInfrastructureControllerApiService) FunctionsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/functions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["account"], "string", "account"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["functionName"], "string", "functionName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["region"], "string", "region"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["account"].(string); localVarOk { - localVarQueryParams.Add("account", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["functionName"].(string); localVarOk { - localVarQueryParams.Add("functionName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["region"].(string); localVarOk { - localVarQueryParams.Add("region", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AmazonInfrastructureControllerApiService Get instance types - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *AmazonInfrastructureControllerApiService) InstanceTypesUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/instanceTypes" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AmazonInfrastructureControllerApiService Get subnets - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *AmazonInfrastructureControllerApiService) SubnetsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subnets" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AmazonInfrastructureControllerApiService Get VPCs - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *AmazonInfrastructureControllerApiService) VpcsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/vpcs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/api/swagger.yaml b/gateapi/api/swagger.yaml index b7b4f11a..3c6cf7c7 100644 --- a/gateapi/api/swagger.yaml +++ b/gateapi/api/swagger.yaml @@ -108,19 +108,19 @@ paths: $ref: "#/definitions/ReorderPipelinesCommand" x-exportParamName: "ReorderPipelinesCommand" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications: get: tags: @@ -138,6 +138,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Account" + x-optionalDataType: "String" - name: "owner" in: "query" description: "filters results to only include applications owned by the specified\ @@ -146,20 +147,22 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Owner" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{applicationName}/jobs/{account}/{region}/{name}: get: tags: @@ -175,6 +178,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -194,6 +198,7 @@ paths: type: "string" default: "false" x-exportParamName: "Expand" + x-optionalDataType: "String" - name: "name" in: "path" description: "name" @@ -207,19 +212,20 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{applicationName}/serverGroups: get: tags: @@ -235,6 +241,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "applicationName" in: "path" description: "applicationName" @@ -247,12 +254,14 @@ paths: required: false type: "string" x-exportParamName: "CloudProvider" + x-optionalDataType: "String" - name: "clusters" in: "query" description: "clusters" required: false type: "string" x-exportParamName: "Clusters" + x-optionalDataType: "String" - name: "expand" in: "query" description: "expand" @@ -260,20 +269,22 @@ paths: type: "string" default: "false" x-exportParamName: "Expand" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{applicationName}/serverGroups/{account}/{region}/{serverGroupName}: get: tags: @@ -289,6 +300,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -308,6 +320,7 @@ paths: type: "string" default: "true" x-exportParamName: "IncludeDetails" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -321,17 +334,17 @@ paths: type: "string" x-exportParamName: "ServerGroupName" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}: get: tags: @@ -354,20 +367,22 @@ paths: type: "boolean" default: true x-exportParamName: "Expand" + x-optionalDataType: "Bool" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters: get: tags: @@ -383,6 +398,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "application" in: "path" description: "application" @@ -390,19 +406,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}: get: tags: @@ -418,6 +435,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -431,19 +449,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}: get: tags: @@ -459,6 +478,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -478,19 +498,20 @@ paths: type: "string" x-exportParamName: "ClusterName" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}/serverGroups: get: tags: @@ -506,6 +527,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -525,19 +547,20 @@ paths: type: "string" x-exportParamName: "ClusterName" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}: get: tags: @@ -553,6 +576,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -578,19 +602,20 @@ paths: type: "string" x-exportParamName: "ServerGroupName" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}/scalingActivities: get: tags: @@ -606,6 +631,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -631,12 +657,14 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "query" description: "region" required: false type: "string" x-exportParamName: "Region" + x-optionalDataType: "String" - name: "serverGroupName" in: "path" description: "serverGroupName" @@ -644,19 +672,20 @@ paths: type: "string" x-exportParamName: "ServerGroupName" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}/{cloudProvider}/{scope}/serverGroups/target/{target}: get: tags: @@ -674,6 +703,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -704,6 +734,7 @@ paths: required: false type: "boolean" x-exportParamName: "OnlyEnabled" + x-optionalDataType: "Bool" - name: "scope" in: "path" description: "scope" @@ -722,20 +753,22 @@ paths: required: false type: "boolean" x-exportParamName: "ValidateOldest" + x-optionalDataType: "Bool" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/clusters/{account}/{clusterName}/{type}/loadBalancers: get: tags: @@ -751,6 +784,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -776,19 +810,20 @@ paths: type: "string" x-exportParamName: "Type_" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/executions/search: get: tags: @@ -815,6 +850,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "EventId" + x-optionalDataType: "String" - name: "expand" in: "query" description: "Expands each execution object in the resulting list. If this\ @@ -825,6 +861,7 @@ paths: allowEmptyValue: false x-example: false x-exportParamName: "Expand" + x-optionalDataType: "Bool" - name: "pipelineName" in: "query" description: "Only includes executions that with this pipeline name." @@ -832,6 +869,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "PipelineName" + x-optionalDataType: "String" - name: "reverse" in: "query" description: "Reverses the resulting list before it is paginated. If this\ @@ -842,6 +880,7 @@ paths: allowEmptyValue: false x-example: false x-exportParamName: "Reverse" + x-optionalDataType: "Bool" - name: "size" in: "query" description: "Sets the size of the resulting list for pagination. This value\ @@ -849,9 +888,10 @@ paths: required: false type: "integer" default: 10 - allowEmptyValue: false format: "int32" + allowEmptyValue: false x-exportParamName: "Size" + x-optionalDataType: "Int32" - name: "startIndex" in: "query" description: "Sets the first item of the resulting list for pagination. The\ @@ -860,9 +900,10 @@ paths: required: false type: "integer" default: 0 - allowEmptyValue: false format: "int32" + allowEmptyValue: false x-exportParamName: "StartIndex" + x-optionalDataType: "Int32" - name: "statuses" in: "query" description: "Only includes executions with a status that is equal to a status\ @@ -874,6 +915,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Statuses" + x-optionalDataType: "String" - name: "trigger" in: "query" description: "Only includes executions that were triggered by a trigger that\ @@ -895,6 +937,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Trigger" + x-optionalDataType: "String" - name: "triggerTimeEndBoundary" in: "query" description: "Only includes executions that were built at or before the given\ @@ -904,9 +947,10 @@ paths: required: false type: "integer" default: 9223372036854775807 - allowEmptyValue: false format: "int64" + allowEmptyValue: false x-exportParamName: "TriggerTimeEndBoundary" + x-optionalDataType: "Int64" - name: "triggerTimeStartBoundary" in: "query" description: "Only includes executions that were built at or after the given\ @@ -916,9 +960,10 @@ paths: required: false type: "integer" default: 0 - allowEmptyValue: false format: "int64" + allowEmptyValue: false x-exportParamName: "TriggerTimeStartBoundary" + x-optionalDataType: "Int64" - name: "triggerTypes" in: "query" description: "Only includes executions that were triggered by a trigger with\ @@ -929,20 +974,22 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "TriggerTypes" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/functions: get: tags: @@ -959,19 +1006,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/history: get: tags: @@ -995,20 +1043,22 @@ paths: default: 20 format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/loadBalancers: get: tags: @@ -1024,6 +1074,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "application" in: "path" description: "application" @@ -1031,19 +1082,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/pipelineConfigs: get: tags: @@ -1060,19 +1112,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/pipelineConfigs/{pipelineName}: get: tags: @@ -1095,19 +1148,20 @@ paths: type: "string" x-exportParamName: "PipelineName" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "application-controller" @@ -1143,18 +1197,19 @@ paths: required: false type: "string" x-exportParamName: "User" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/HttpEntity" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /applications/{application}/pipelines: @@ -1178,6 +1233,7 @@ paths: required: false type: "boolean" x-exportParamName: "Expand" + x-optionalDataType: "Bool" - name: "limit" in: "query" description: "limit" @@ -1185,26 +1241,29 @@ paths: type: "integer" format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" - name: "statuses" in: "query" description: "statuses" required: false type: "string" x-exportParamName: "Statuses" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/pipelines/{id}/cancel: put: tags: @@ -1228,21 +1287,22 @@ paths: required: false type: "string" x-exportParamName: "Reason" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /applications/{application}/serverGroupManagers: @@ -1261,19 +1321,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/serverGroups/{account}/{serverGroupName}/events: get: tags: @@ -1314,19 +1375,20 @@ paths: type: "string" x-exportParamName: "ServerGroupName" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/snapshots/{account}: get: tags: @@ -1349,19 +1411,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/snapshots/{account}/history: get: tags: @@ -1391,20 +1454,22 @@ paths: default: 20 format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/strategyConfigs: get: tags: @@ -1421,19 +1486,20 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/strategyConfigs/{strategyName}: get: tags: @@ -1456,19 +1522,20 @@ paths: type: "string" x-exportParamName: "StrategyName" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /applications/{application}/tasks: get: tags: @@ -1491,6 +1558,7 @@ paths: type: "integer" format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" - name: "page" in: "query" description: "page" @@ -1498,26 +1566,29 @@ paths: type: "integer" format: "int32" x-exportParamName: "Page" + x-optionalDataType: "Int32" - name: "statuses" in: "query" description: "statuses" required: false type: "string" x-exportParamName: "Statuses" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "application-controller" @@ -1542,20 +1613,20 @@ paths: type: "object" x-exportParamName: "Map_" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /applications/{application}/tasks/{id}: @@ -1574,18 +1645,18 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /applications/{application}/tasks/{id}/cancel: @@ -1606,20 +1677,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /applications/{application}/tasks/{id}/details/{taskDetailsId}: @@ -1637,6 +1708,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -1650,18 +1722,18 @@ paths: type: "string" x-exportParamName: "TaskDetailsId" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /artifacts/account/{accountName}/versions: @@ -1679,6 +1751,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "accountName" in: "path" description: "accountName" @@ -1698,18 +1771,19 @@ paths: type: "string" x-exportParamName: "Type_" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "string" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /artifacts/credentials: get: tags: @@ -1725,20 +1799,22 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /artifacts/{provider}/{packageName}/{version}: get: tags: @@ -1768,17 +1844,17 @@ paths: type: "string" x-exportParamName: "Version" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /auth/loggedOut: get: tags: @@ -1789,16 +1865,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "string" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /auth/redirect: get: tags: @@ -1815,14 +1892,15 @@ paths: type: "string" x-exportParamName: "To" responses: - 200: + "200": description: "OK" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /auth/roles/sync: post: tags: @@ -1835,16 +1913,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /auth/user: get: tags: @@ -1855,16 +1934,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/User" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /auth/user/serviceAccounts: get: tags: @@ -1880,20 +1960,22 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /bakery/logs/{region}/{statusId}: get: tags: @@ -1916,17 +1998,17 @@ paths: type: "string" x-exportParamName: "StatusId" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /bakery/options: get: tags: @@ -1938,17 +2020,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /bakery/options/{cloudProvider}: get: tags: @@ -1966,17 +2048,17 @@ paths: type: "string" x-exportParamName: "CloudProvider" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /ci/builds: get: tags: @@ -1992,6 +2074,7 @@ paths: required: false type: "string" x-exportParamName: "CompletionStatus" + x-optionalDataType: "String" - name: "projectKey" in: "query" description: "projectKey" @@ -2005,19 +2088,20 @@ paths: type: "string" x-exportParamName: "RepoSlug" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /concourse/{buildMaster}/teams/{team}/pipelines: get: tags: @@ -2041,19 +2125,20 @@ paths: type: "string" x-exportParamName: "Team" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/jobs: get: tags: @@ -2082,19 +2167,20 @@ paths: type: "string" x-exportParamName: "Team" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/resources: get: tags: @@ -2124,19 +2210,20 @@ paths: type: "string" x-exportParamName: "Team" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /credentials: get: tags: @@ -2151,11 +2238,13 @@ paths: required: false type: "boolean" x-exportParamName: "AccountNonExpired" + x-optionalDataType: "Bool" - name: "accountNonLocked" in: "query" required: false type: "boolean" x-exportParamName: "AccountNonLocked" + x-optionalDataType: "Bool" - name: "allowedAccounts" in: "query" required: false @@ -2169,42 +2258,50 @@ paths: required: false type: "string" x-exportParamName: "Authorities0Authority" + x-optionalDataType: "String" - name: "credentialsNonExpired" in: "query" required: false type: "boolean" x-exportParamName: "CredentialsNonExpired" + x-optionalDataType: "Bool" - name: "email" in: "query" required: false type: "string" x-exportParamName: "Email" + x-optionalDataType: "String" - name: "enabled" in: "query" required: false type: "boolean" x-exportParamName: "Enabled" + x-optionalDataType: "Bool" - name: "expand" in: "query" description: "expand" required: false type: "boolean" x-exportParamName: "Expand" + x-optionalDataType: "Bool" - name: "firstName" in: "query" required: false type: "string" x-exportParamName: "FirstName" + x-optionalDataType: "String" - name: "lastName" in: "query" required: false type: "string" x-exportParamName: "LastName" + x-optionalDataType: "String" - name: "password" in: "query" required: false type: "string" x-exportParamName: "Password" + x-optionalDataType: "String" - name: "roles" in: "query" required: false @@ -2218,19 +2315,21 @@ paths: required: false type: "string" x-exportParamName: "Username" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: $ref: "#/definitions/Account" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /credentials/{account}: get: tags: @@ -2246,6 +2345,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2257,11 +2357,13 @@ paths: required: false type: "boolean" x-exportParamName: "AccountNonExpired" + x-optionalDataType: "Bool" - name: "accountNonLocked" in: "query" required: false type: "boolean" x-exportParamName: "AccountNonLocked" + x-optionalDataType: "Bool" - name: "allowedAccounts" in: "query" required: false @@ -2275,36 +2377,43 @@ paths: required: false type: "string" x-exportParamName: "Authorities0Authority" + x-optionalDataType: "String" - name: "credentialsNonExpired" in: "query" required: false type: "boolean" x-exportParamName: "CredentialsNonExpired" + x-optionalDataType: "Bool" - name: "email" in: "query" required: false type: "string" x-exportParamName: "Email" + x-optionalDataType: "String" - name: "enabled" in: "query" required: false type: "boolean" x-exportParamName: "Enabled" + x-optionalDataType: "Bool" - name: "firstName" in: "query" required: false type: "string" x-exportParamName: "FirstName" + x-optionalDataType: "String" - name: "lastName" in: "query" required: false type: "string" x-exportParamName: "LastName" + x-optionalDataType: "String" - name: "password" in: "query" required: false type: "string" x-exportParamName: "Password" + x-optionalDataType: "String" - name: "roles" in: "query" required: false @@ -2318,17 +2427,19 @@ paths: required: false type: "string" x-exportParamName: "Username" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/AccountDetails" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /executions: get: tags: @@ -2349,6 +2460,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "ExecutionIds" + x-optionalDataType: "String" - name: "expand" in: "query" description: "Expands each execution object in the resulting list. If this\ @@ -2358,6 +2470,7 @@ paths: default: true allowEmptyValue: false x-exportParamName: "Expand" + x-optionalDataType: "Bool" - name: "limit" in: "query" description: "The number of executions to return per pipeline configuration.\ @@ -2365,9 +2478,10 @@ paths: \ it is defaulted to 1." required: false type: "integer" - allowEmptyValue: false format: "int32" + allowEmptyValue: false x-exportParamName: "Limit" + x-optionalDataType: "Int32" - name: "pipelineConfigIds" in: "query" description: "A comma-separated list of pipeline configuration IDs to retrieve\ @@ -2377,6 +2491,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "PipelineConfigIds" + x-optionalDataType: "String" - name: "statuses" in: "query" description: "A comma-separated list of execution statuses to filter by. Ignored\ @@ -2386,20 +2501,22 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Statuses" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /firewalls: get: tags: @@ -2416,24 +2533,26 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "id" in: "query" description: "id" required: false type: "string" x-exportParamName: "Id" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /firewalls/{account}: get: tags: @@ -2449,6 +2568,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2462,18 +2582,19 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /firewalls/{account}/{region}: get: tags: @@ -2489,6 +2610,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2502,6 +2624,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -2509,19 +2632,20 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /firewalls/{account}/{region}/{name}: get: tags: @@ -2537,6 +2661,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2556,6 +2681,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -2568,18 +2694,19 @@ paths: required: false type: "string" x-exportParamName: "VpcId" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /functions: get: tags: @@ -2595,32 +2722,36 @@ paths: required: false type: "string" x-exportParamName: "Account" + x-optionalDataType: "String" - name: "functionName" in: "query" description: "functionName" required: false type: "string" x-exportParamName: "FunctionName" + x-optionalDataType: "String" - name: "region" in: "query" description: "region" required: false type: "string" x-exportParamName: "Region" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /images/find: get: tags: @@ -2638,6 +2769,7 @@ paths: required: false type: "string" x-exportParamName: "Account" + x-optionalDataType: "String" - name: "count" in: "query" description: "count" @@ -2645,6 +2777,7 @@ paths: type: "integer" format: "int32" x-exportParamName: "Count" + x-optionalDataType: "Int32" - name: "provider" in: "query" description: "provider" @@ -2652,32 +2785,36 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "q" in: "query" description: "q" required: false type: "string" x-exportParamName: "Q" + x-optionalDataType: "String" - name: "region" in: "query" description: "region" required: false type: "string" x-exportParamName: "Region" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /images/tags: get: tags: @@ -2693,6 +2830,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "query" description: "account" @@ -2706,6 +2844,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "repository" in: "query" description: "repository" @@ -2713,19 +2852,20 @@ paths: type: "string" x-exportParamName: "Repository" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /images/{account}/{region}/{imageId}: get: tags: @@ -2741,6 +2881,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2760,6 +2901,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -2767,19 +2909,20 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /instanceTypes: get: tags: @@ -2790,19 +2933,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /instances/{account}/{region}/{instanceId}: get: tags: @@ -2818,6 +2962,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2837,17 +2982,17 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /instances/{account}/{region}/{instanceId}/console: get: tags: @@ -2863,6 +3008,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2882,6 +3028,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -2889,17 +3036,17 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /loadBalancers: get: tags: @@ -2915,6 +3062,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "provider" in: "query" description: "provider" @@ -2922,20 +3070,22 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /loadBalancers/{account}/{region}/{name}: get: tags: @@ -2952,6 +3102,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -2971,6 +3122,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -2978,19 +3130,20 @@ paths: type: "string" x-exportParamName: "Region" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /loadBalancers/{name}: get: tags: @@ -3006,6 +3159,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "name" in: "path" description: "name" @@ -3019,20 +3173,22 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/api-docs: get: tags: @@ -3043,17 +3199,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}: get: tags: @@ -3077,7 +3233,6 @@ paths: items: type: "string" collectionFormat: "multi" - default: "resources" x-exportParamName: "Entities" - name: "includeDetails" in: "query" @@ -3086,18 +3241,19 @@ paths: type: "boolean" default: false x-exportParamName: "IncludeDetails" + x-optionalDataType: "Bool" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}/config: get: tags: @@ -3114,16 +3270,17 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/DeliveryConfig" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "managed-controller" @@ -3139,16 +3296,17 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/DeliveryConfig" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/application/{application}/environment/{environment}/constraint: post: tags: @@ -3180,16 +3338,17 @@ paths: $ref: "#/definitions/ConstraintStatus" x-exportParamName: "Status" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}/environment/{environment}/constraints: get: tags: @@ -3218,17 +3377,19 @@ paths: type: "string" default: "10" x-exportParamName: "Limit" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/ConstraintState" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}/pause: post: tags: @@ -3247,16 +3408,17 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "managed-controller" @@ -3272,14 +3434,15 @@ paths: type: "string" x-exportParamName: "Application" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/application/{application}/pin: post: tags: @@ -3305,16 +3468,17 @@ paths: $ref: "#/definitions/EnvironmentArtifactPin" x-exportParamName: "Pin" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}/pin/{targetEnvironment}: delete: tags: @@ -3338,6 +3502,7 @@ paths: required: false type: "string" x-exportParamName: "Reference" + x-optionalDataType: "String" - name: "targetEnvironment" in: "path" description: "targetEnvironment" @@ -3345,14 +3510,15 @@ paths: type: "string" x-exportParamName: "TargetEnvironment" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/application/{application}/veto: post: tags: @@ -3378,16 +3544,17 @@ paths: $ref: "#/definitions/EnvironmentArtifactVeto" x-exportParamName: "Veto" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/application/{application}/veto/{targetEnvironment}/{reference}/{version}: delete: tags: @@ -3422,14 +3589,15 @@ paths: type: "string" x-exportParamName: "Version" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/delivery-configs: post: tags: @@ -3450,18 +3618,19 @@ paths: $ref: "#/definitions/DeliveryConfig" x-exportParamName: "Manifest" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/DeliveryConfig" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/delivery-configs/diff: post: tags: @@ -3482,19 +3651,19 @@ paths: $ref: "#/definitions/DeliveryConfig" x-exportParamName: "Manifest" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/delivery-configs/validate: post: tags: @@ -3516,19 +3685,19 @@ paths: $ref: "#/definitions/DeliveryConfig" x-exportParamName: "Manifest" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/delivery-configs/{name}: get: tags: @@ -3545,16 +3714,17 @@ paths: type: "string" x-exportParamName: "Name" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/DeliveryConfig" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "managed-controller" @@ -3570,16 +3740,17 @@ paths: type: "string" x-exportParamName: "Name" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/DeliveryConfig" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/delivery-configs/{name}/artifacts: get: tags: @@ -3596,19 +3767,20 @@ paths: type: "string" x-exportParamName: "Name" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/resources/diff: post: tags: @@ -3629,19 +3801,19 @@ paths: $ref: "#/definitions/Resource" x-exportParamName: "Resource" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/resources/export/artifact/{cloudProvider}/{account}/{clusterName}: get: tags: @@ -3671,17 +3843,17 @@ paths: type: "string" x-exportParamName: "ClusterName" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/resources/export/{cloudProvider}/{account}/{type}/{name}: get: tags: @@ -3722,16 +3894,17 @@ paths: type: "string" x-exportParamName: "Type_" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/Resource" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/resources/{resourceId}: get: tags: @@ -3748,16 +3921,17 @@ paths: type: "string" x-exportParamName: "ResourceId" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/Resource" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /managed/resources/{resourceId}/pause: post: tags: @@ -3776,16 +3950,17 @@ paths: type: "string" x-exportParamName: "ResourceId" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "managed-controller" @@ -3801,14 +3976,15 @@ paths: type: "string" x-exportParamName: "ResourceId" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /managed/resources/{resourceId}/status: get: tags: @@ -3825,17 +4001,17 @@ paths: type: "string" x-exportParamName: "ResourceId" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /networks: get: tags: @@ -3851,20 +4027,22 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /networks/{cloudProvider}: get: tags: @@ -3880,6 +4058,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "cloudProvider" in: "path" description: "cloudProvider" @@ -3887,19 +4066,20 @@ paths: type: "string" x-exportParamName: "CloudProvider" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineConfigs: get: tags: @@ -3910,19 +4090,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineConfigs/{pipelineConfigId}/convertToTemplate: get: tags: @@ -3939,16 +4120,17 @@ paths: type: "string" x-exportParamName: "PipelineConfigId" responses: - 200: + "200": description: "OK" schema: type: "string" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineConfigs/{pipelineConfigId}/history: get: tags: @@ -3966,6 +4148,7 @@ paths: default: 20 format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" - name: "pipelineConfigId" in: "path" description: "pipelineConfigId" @@ -3973,19 +4156,20 @@ paths: type: "string" x-exportParamName: "PipelineConfigId" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineTemplates: get: tags: @@ -4005,19 +4189,20 @@ paths: collectionFormat: "multi" x-exportParamName: "Scopes" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "pipeline-templates-controller" @@ -4036,21 +4221,22 @@ paths: type: "object" x-exportParamName: "PipelineTemplate" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineTemplates/resolve: get: tags: @@ -4066,12 +4252,14 @@ paths: required: false type: "string" x-exportParamName: "ExecutionId" + x-optionalDataType: "String" - name: "pipelineConfigId" in: "query" description: "pipelineConfigId" required: false type: "string" x-exportParamName: "PipelineConfigId" + x-optionalDataType: "String" - name: "source" in: "query" description: "source" @@ -4079,19 +4267,20 @@ paths: type: "string" x-exportParamName: "Source" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelineTemplates/{id}: get: tags: @@ -4108,19 +4297,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "pipeline-templates-controller" @@ -4151,22 +4341,24 @@ paths: type: "boolean" default: false x-exportParamName: "SkipPlanDependents" + x-optionalDataType: "Bool" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "pipeline-templates-controller" @@ -4181,6 +4373,7 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -4188,19 +4381,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /pipelineTemplates/{id}/dependents: get: tags: @@ -4222,20 +4416,22 @@ paths: required: false type: "boolean" x-exportParamName: "Recursive" + x-optionalDataType: "Bool" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines: post: tags: @@ -4255,16 +4451,17 @@ paths: type: "object" x-exportParamName: "Pipeline" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/move: post: tags: @@ -4284,16 +4481,17 @@ paths: type: "object" x-exportParamName: "RenameCommand" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/start: post: tags: @@ -4313,18 +4511,19 @@ paths: type: "object" x-exportParamName: "Map_" responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/ResponseEntity" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/v2/{application}/{pipelineNameOrId}: post: tags: @@ -4356,19 +4555,19 @@ paths: type: "object" x-exportParamName: "Trigger" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{application}/{pipelineNameOrId}: post: tags: @@ -4400,19 +4599,19 @@ paths: type: "object" x-exportParamName: "Trigger" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{application}/{pipelineName}: delete: tags: @@ -4435,14 +4634,15 @@ paths: type: "string" x-exportParamName: "PipelineName" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /pipelines/{id}: get: tags: @@ -4459,17 +4659,17 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false put: tags: - "pipeline-controller" @@ -4494,21 +4694,22 @@ paths: type: "object" x-exportParamName: "Pipeline" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "pipeline-controller" @@ -4524,19 +4725,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /pipelines/{id}/cancel: put: tags: @@ -4555,6 +4757,7 @@ paths: type: "boolean" default: false x-exportParamName: "Force" + x-optionalDataType: "Bool" - name: "id" in: "path" description: "id" @@ -4567,17 +4770,19 @@ paths: required: false type: "string" x-exportParamName: "Reason" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/evaluateExpression: get: tags: @@ -4600,19 +4805,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "pipeline-controller" @@ -4637,21 +4843,22 @@ paths: type: "object" x-exportParamName: "PipelineExpression" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/evaluateVariables: post: tags: @@ -4691,6 +4898,7 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "RequisiteStageRefIds" + x-optionalDataType: "String" - name: "spelVersion" in: "query" description: "Version of SpEL evaluation logic to use (v3 or v4)" @@ -4698,22 +4906,24 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "SpelVersion" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/pause: put: tags: @@ -4732,16 +4942,17 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/resume: put: tags: @@ -4760,21 +4971,22 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/stages/{stageId}: patch: tags: @@ -4806,19 +5018,20 @@ paths: type: "string" x-exportParamName: "StageId" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /pipelines/{id}/stages/{stageId}/restart: put: tags: @@ -4850,21 +5063,22 @@ paths: type: "string" x-exportParamName: "StageId" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pipelines/{id}/{stageId}/evaluateExpression: get: tags: @@ -4894,19 +5108,20 @@ paths: type: "string" x-exportParamName: "StageId" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /plugins/deck/plugin-manifest.json: get: tags: @@ -4917,18 +5132,19 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: $ref: "#/definitions/DeckPluginVersion" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /plugins/deck/{pluginId}/{pluginVersion}/{asset}: get: tags: @@ -4957,16 +5173,17 @@ paths: type: "string" x-exportParamName: "PluginVersion" responses: - 200: + "200": description: "OK" schema: type: "string" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /plugins/info: get: tags: @@ -4982,19 +5199,21 @@ paths: required: false type: "string" x-exportParamName: "Service" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: $ref: "#/definitions/Map«string,object»" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "plugin-info-controller" @@ -5013,19 +5232,19 @@ paths: $ref: "#/definitions/SpinnakerPluginInfo" x-exportParamName: "PluginInfo" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false put: tags: - "plugin-info-controller" @@ -5044,19 +5263,19 @@ paths: $ref: "#/definitions/SpinnakerPluginInfo" x-exportParamName: "PluginInfo" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /plugins/info/{id}: delete: tags: @@ -5073,17 +5292,17 @@ paths: type: "string" x-exportParamName: "Id" responses: - 202: + "202": description: "Accepted" schema: type: "object" - properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /plugins/installed: get: tags: @@ -5099,8 +5318,9 @@ paths: required: false type: "string" x-exportParamName: "Service" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" @@ -5108,12 +5328,13 @@ paths: type: "array" items: $ref: "#/definitions/SpinnakerPluginDescriptor" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /plugins/publish/{pluginId}/{pluginVersion}: post: tags: @@ -5149,16 +5370,17 @@ paths: type: "string" x-exportParamName: "PluginVersion" responses: - 200: + "200": description: "OK" - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /projects: get: tags: @@ -5169,19 +5391,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /projects/{id}: get: tags: @@ -5198,19 +5421,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /projects/{id}/clusters: get: tags: @@ -5226,6 +5450,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -5233,19 +5458,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /projects/{id}/pipelines: get: tags: @@ -5269,26 +5495,29 @@ paths: default: 5 format: "int32" x-exportParamName: "Limit" + x-optionalDataType: "Int32" - name: "statuses" in: "query" description: "statuses" required: false type: "string" x-exportParamName: "Statuses" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /pubsub/subscriptions: get: tags: @@ -5299,18 +5528,19 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: $ref: "#/definitions/Map«string,string»" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /search: get: tags: @@ -5326,6 +5556,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "allowShortQuery" in: "query" description: "allowShortQuery" @@ -5333,6 +5564,7 @@ paths: type: "boolean" default: false x-exportParamName: "AllowShortQuery" + x-optionalDataType: "Bool" - name: "page" in: "query" description: "page" @@ -5341,6 +5573,7 @@ paths: default: 1 format: "int32" x-exportParamName: "Page" + x-optionalDataType: "Int32" - name: "pageSize" in: "query" description: "pageSize" @@ -5349,18 +5582,21 @@ paths: default: 10000 format: "int32" x-exportParamName: "PageSize" + x-optionalDataType: "Int32" - name: "platform" in: "query" description: "platform" required: false type: "string" x-exportParamName: "Platform" + x-optionalDataType: "String" - name: "q" in: "query" description: "q" required: false type: "string" x-exportParamName: "Q" + x-optionalDataType: "String" - name: "type" in: "query" description: "type" @@ -5368,19 +5604,20 @@ paths: type: "string" x-exportParamName: "Type_" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /securityGroups: get: tags: @@ -5397,24 +5634,26 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "id" in: "query" description: "id" required: false type: "string" x-exportParamName: "Id" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /securityGroups/{account}: get: tags: @@ -5431,6 +5670,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -5444,18 +5684,19 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /securityGroups/{account}/{region}/{name}: get: tags: @@ -5471,6 +5712,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "account" in: "path" description: "account" @@ -5490,6 +5732,7 @@ paths: type: "string" default: "aws" x-exportParamName: "Provider" + x-optionalDataType: "String" - name: "region" in: "path" description: "region" @@ -5502,18 +5745,19 @@ paths: required: false type: "string" x-exportParamName: "VpcId" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /subnets: get: tags: @@ -5524,19 +5768,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /subnets/{cloudProvider}: get: tags: @@ -5553,19 +5798,20 @@ paths: type: "string" x-exportParamName: "CloudProvider" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /tasks: post: tags: @@ -5585,21 +5831,22 @@ paths: type: "object" x-exportParamName: "Map_" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /tasks/cancel: put: tags: @@ -5621,21 +5868,22 @@ paths: collectionFormat: "multi" x-exportParamName: "Ids" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /tasks/{id}: get: tags: @@ -5652,19 +5900,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "task-controller" @@ -5680,19 +5929,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /tasks/{id}/cancel: put: tags: @@ -5711,21 +5961,22 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /tasks/{id}/details/{taskDetailsId}: get: tags: @@ -5741,6 +5992,7 @@ paths: required: false type: "string" x-exportParamName: "XRateLimitApp" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -5754,19 +6006,20 @@ paths: type: "string" x-exportParamName: "TaskDetailsId" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/builds: get: tags: @@ -5783,20 +6036,22 @@ paths: required: false type: "string" x-exportParamName: "Type_" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/builds/{buildMaster}/build/{number}/**: get: tags: @@ -5820,19 +6075,20 @@ paths: type: "string" x-exportParamName: "Number" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/builds/{buildMaster}/builds/**: get: tags: @@ -5850,19 +6106,20 @@ paths: type: "string" x-exportParamName: "BuildMaster" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/builds/{buildMaster}/jobs: get: tags: @@ -5880,19 +6137,20 @@ paths: type: "string" x-exportParamName: "BuildMaster" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/builds/{buildMaster}/jobs/**: get: tags: @@ -5910,19 +6168,20 @@ paths: type: "string" x-exportParamName: "BuildMaster" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/canary: post: tags: @@ -5947,38 +6206,42 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" - name: "metricsAccountName" in: "query" description: "metricsAccountName" required: false type: "string" x-exportParamName: "MetricsAccountName" + x-optionalDataType: "String" - name: "parentPipelineExecutionId" in: "query" description: "parentPipelineExecutionId" required: false type: "string" x-exportParamName: "ParentPipelineExecutionId" + x-optionalDataType: "String" - name: "storageAccountName" in: "query" description: "storageAccountName" required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/canary/{canaryConfigId}: post: tags: @@ -5996,6 +6259,7 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" - name: "canaryConfigId" in: "path" description: "canaryConfigId" @@ -6008,6 +6272,7 @@ paths: required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" - in: "body" name: "executionRequest" description: "executionRequest" @@ -6021,32 +6286,35 @@ paths: required: false type: "string" x-exportParamName: "MetricsAccountName" + x-optionalDataType: "String" - name: "parentPipelineExecutionId" in: "query" description: "parentPipelineExecutionId" required: false type: "string" x-exportParamName: "ParentPipelineExecutionId" + x-optionalDataType: "String" - name: "storageAccountName" in: "query" description: "storageAccountName" required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/canary/{canaryConfigId}/{canaryExecutionId}: get: tags: @@ -6074,17 +6342,17 @@ paths: required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /v2/canaries/canary/{canaryExecutionId}: @@ -6108,18 +6376,19 @@ paths: required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/credentials: get: tags: @@ -6130,19 +6399,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/judges: get: tags: @@ -6153,19 +6423,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/metadata/metricsService: get: tags: @@ -6182,26 +6453,29 @@ paths: required: false type: "string" x-exportParamName: "Filter" + x-optionalDataType: "String" - name: "metricsAccountName" in: "query" description: "metricsAccountName" required: false type: "string" x-exportParamName: "MetricsAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/metricSetPairList/{metricSetPairListId}: get: tags: @@ -6223,20 +6497,22 @@ paths: required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaries/{application}/executions: get: tags: @@ -6267,26 +6543,29 @@ paths: type: "string" allowEmptyValue: false x-exportParamName: "Statuses" + x-optionalDataType: "String" - name: "storageAccountName" in: "query" description: "storageAccountName" required: false type: "string" x-exportParamName: "StorageAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaryConfig: get: tags: @@ -6302,26 +6581,29 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" - name: "configurationAccountName" in: "query" description: "configurationAccountName" required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false post: tags: - "v-2-canary-config-controller" @@ -6345,20 +6627,21 @@ paths: required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/canaryConfig/{id}: get: tags: @@ -6374,6 +6657,7 @@ paths: required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -6381,17 +6665,17 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false put: tags: - "v-2-canary-config-controller" @@ -6415,6 +6699,7 @@ paths: required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -6422,19 +6707,19 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "v-2-canary-config-controller" @@ -6449,6 +6734,7 @@ paths: required: false type: "string" x-exportParamName: "ConfigurationAccountName" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -6456,14 +6742,15 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /v2/pipelineTemplates: get: tags: @@ -6483,19 +6770,20 @@ paths: collectionFormat: "multi" x-exportParamName: "Scopes" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/pipelineTemplates/create: post: tags: @@ -6520,22 +6808,24 @@ paths: required: false type: "string" x-exportParamName: "Tag" + x-optionalDataType: "String" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/pipelineTemplates/plan: post: tags: @@ -6555,21 +6845,22 @@ paths: type: "object" x-exportParamName: "Pipeline" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/pipelineTemplates/update/{id}: post: tags: @@ -6601,28 +6892,31 @@ paths: type: "boolean" default: false x-exportParamName: "SkipPlanDependents" + x-optionalDataType: "Bool" - name: "tag" in: "query" description: "tag" required: false type: "string" x-exportParamName: "Tag" + x-optionalDataType: "String" responses: - 201: + "201": description: "Created" - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/pipelineTemplates/versions: get: tags: @@ -6642,17 +6936,17 @@ paths: collectionFormat: "multi" x-exportParamName: "Scopes" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v2/pipelineTemplates/{id}: get: tags: @@ -6668,6 +6962,7 @@ paths: required: false type: "string" x-exportParamName: "Digest" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -6680,20 +6975,22 @@ paths: required: false type: "string" x-exportParamName: "Tag" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false delete: tags: - "v-2-pipeline-templates-controller" @@ -6708,12 +7005,14 @@ paths: required: false type: "string" x-exportParamName: "Application" + x-optionalDataType: "String" - name: "digest" in: "query" description: "digest" required: false type: "string" x-exportParamName: "Digest" + x-optionalDataType: "String" - name: "id" in: "path" description: "id" @@ -6726,20 +7025,22 @@ paths: required: false type: "string" x-exportParamName: "Tag" + x-optionalDataType: "String" responses: - 202: + "202": description: "Accepted" schema: type: "object" additionalProperties: type: "object" properties: {} - 204: + "204": description: "No Content" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" + deprecated: false /v2/pipelineTemplates/{id}/dependents: get: tags: @@ -6756,19 +7057,20 @@ paths: type: "string" x-exportParamName: "Id" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v3/builds: get: tags: @@ -6784,20 +7086,22 @@ paths: required: false type: "string" x-exportParamName: "Type_" + x-optionalDataType: "String" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v3/builds/{buildMaster}/build/{number}: get: tags: @@ -6826,19 +7130,20 @@ paths: type: "string" x-exportParamName: "Number" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v3/builds/{buildMaster}/builds: get: tags: @@ -6861,19 +7166,20 @@ paths: type: "string" x-exportParamName: "Job" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v3/builds/{buildMaster}/job: get: tags: @@ -6896,19 +7202,20 @@ paths: type: "string" x-exportParamName: "Job" responses: - 200: + "200": description: "OK" schema: type: "object" additionalProperties: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /v3/builds/{buildMaster}/jobs: get: tags: @@ -6925,19 +7232,20 @@ paths: type: "string" x-exportParamName: "BuildMaster" responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /version: get: tags: @@ -6948,16 +7256,17 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: $ref: "#/definitions/Version" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /vpcs: get: tags: @@ -6968,18 +7277,18 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" deprecated: true /webhooks/preconfigured: @@ -6992,19 +7301,20 @@ paths: - "*/*" parameters: [] responses: - 200: + "200": description: "OK" schema: type: "array" items: type: "object" properties: {} - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false /webhooks/{type}/{source}: post: tags: @@ -7022,12 +7332,14 @@ paths: required: false type: "string" x-exportParamName: "XEventKey" + x-optionalDataType: "String" - name: "X-Hub-Signature" in: "header" description: "X-Hub-Signature" required: false type: "string" x-exportParamName: "XHubSignature" + x-optionalDataType: "String" - in: "body" name: "event" description: "event" @@ -7048,19 +7360,19 @@ paths: type: "string" x-exportParamName: "Type_" responses: - 200: + "200": description: "OK" schema: type: "object" - properties: {} - 201: + "201": description: "Created" - 401: + "401": description: "Unauthorized" - 403: + "403": description: "Forbidden" - 404: + "404": description: "Not Found" + deprecated: false definitions: Account: type: "object" @@ -7195,17 +7507,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7252,17 +7561,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7322,17 +7628,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7379,17 +7682,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7476,17 +7776,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7533,17 +7830,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7683,17 +7977,14 @@ definitions: example: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" @@ -7807,17 +8098,14 @@ definitions: file: readable: true parent: "parent" - parentFile: null hidden: true freeSpace: 0 totalSpace: 1 usableSpace: 5 - canonicalFile: null directory: true executable: true writable: true path: "path" - absoluteFile: null file: true absolute: true canonicalPath: "canonicalPath" diff --git a/gateapi/api_amazon_infrastructure_controller.go b/gateapi/api_amazon_infrastructure_controller.go new file mode 100644 index 00000000..552bbbae --- /dev/null +++ b/gateapi/api_amazon_infrastructure_controller.go @@ -0,0 +1,480 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type AmazonInfrastructureControllerApiService service + +/* +AmazonInfrastructureControllerApiService Get application functions + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + +@return []interface{} +*/ +func (a *AmazonInfrastructureControllerApiService) ApplicationFunctionsUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/functions" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AmazonInfrastructureControllerApiService Get functions + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AmazonInfrastructureControllerApiFunctionsUsingGETOpts - Optional Parameters: + * @param "Account" (optional.String) - account + * @param "FunctionName" (optional.String) - functionName + * @param "Region" (optional.String) - region + +@return []interface{} +*/ + +type AmazonInfrastructureControllerApiFunctionsUsingGETOpts struct { + Account optional.String + FunctionName optional.String + Region optional.String +} + +func (a *AmazonInfrastructureControllerApiService) FunctionsUsingGET(ctx context.Context, localVarOptionals *AmazonInfrastructureControllerApiFunctionsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/functions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Account.IsSet() { + localVarQueryParams.Add("account", parameterToString(localVarOptionals.Account.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FunctionName.IsSet() { + localVarQueryParams.Add("functionName", parameterToString(localVarOptionals.FunctionName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Region.IsSet() { + localVarQueryParams.Add("region", parameterToString(localVarOptionals.Region.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AmazonInfrastructureControllerApiService Get instance types + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *AmazonInfrastructureControllerApiService) InstanceTypesUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/instanceTypes" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AmazonInfrastructureControllerApiService Get subnets + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *AmazonInfrastructureControllerApiService) SubnetsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/subnets" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AmazonInfrastructureControllerApiService Get VPCs + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *AmazonInfrastructureControllerApiService) VpcsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/vpcs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_application_controller.go b/gateapi/api_application_controller.go new file mode 100644 index 00000000..569c8754 --- /dev/null +++ b/gateapi/api_application_controller.go @@ -0,0 +1,1473 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationControllerApiService service + +/* +ApplicationControllerApiService Cancel pipeline + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *ApplicationControllerApiCancelPipelineUsingPUTOpts - Optional Parameters: + * @param "Reason" (optional.String) - reason + +@return map[string]interface{} +*/ + +type ApplicationControllerApiCancelPipelineUsingPUTOpts struct { + Reason optional.String +} + +func (a *ApplicationControllerApiService) CancelPipelineUsingPUT(ctx context.Context, id string, localVarOptionals *ApplicationControllerApiCancelPipelineUsingPUTOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelines/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Reason.IsSet() { + localVarQueryParams.Add("reason", parameterToString(localVarOptionals.Reason.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Cancel task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *ApplicationControllerApiService) CancelTaskUsingPUT(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of applications + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ApplicationControllerApiGetAllApplicationsUsingGETOpts - Optional Parameters: + * @param "Account" (optional.String) - filters results to only include applications deployed in the specified account + * @param "Owner" (optional.String) - filters results to only include applications owned by the specified email + +@return []interface{} +*/ + +type ApplicationControllerApiGetAllApplicationsUsingGETOpts struct { + Account optional.String + Owner optional.String +} + +func (a *ApplicationControllerApiService) GetAllApplicationsUsingGET(ctx context.Context, localVarOptionals *ApplicationControllerApiGetAllApplicationsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Account.IsSet() { + localVarQueryParams.Add("account", parameterToString(localVarOptionals.Account.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Owner.IsSet() { + localVarQueryParams.Add("owner", parameterToString(localVarOptionals.Owner.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of an application's configuration revision history + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ApplicationControllerApiGetApplicationHistoryUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - limit + +@return []interface{} +*/ + +type ApplicationControllerApiGetApplicationHistoryUsingGETOpts struct { + Limit optional.Int32 +} + +func (a *ApplicationControllerApiService) GetApplicationHistoryUsingGET(ctx context.Context, application string, localVarOptionals *ApplicationControllerApiGetApplicationHistoryUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/history" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve an application's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ApplicationControllerApiGetApplicationUsingGETOpts - Optional Parameters: + * @param "Expand" (optional.Bool) - expand + +@return map[string]interface{} +*/ + +type ApplicationControllerApiGetApplicationUsingGETOpts struct { + Expand optional.Bool +} + +func (a *ApplicationControllerApiService) GetApplicationUsingGET(ctx context.Context, application string, localVarOptionals *ApplicationControllerApiGetApplicationUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a pipeline configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pipelineName pipelineName + +@return map[string]interface{} +*/ +func (a *ApplicationControllerApiService) GetPipelineConfigUsingGET(ctx context.Context, application string, pipelineName string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs/{pipelineName}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of an application's pipeline configurations + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + +@return []interface{} +*/ +func (a *ApplicationControllerApiService) GetPipelineConfigsForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of an application's pipeline executions + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ApplicationControllerApiGetPipelinesUsingGETOpts - Optional Parameters: + * @param "Expand" (optional.Bool) - expand + * @param "Limit" (optional.Int32) - limit + * @param "Statuses" (optional.String) - statuses + +@return []interface{} +*/ + +type ApplicationControllerApiGetPipelinesUsingGETOpts struct { + Expand optional.Bool + Limit optional.Int32 + Statuses optional.String +} + +func (a *ApplicationControllerApiService) GetPipelinesUsingGET(ctx context.Context, application string, localVarOptionals *ApplicationControllerApiGetPipelinesUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelines" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a pipeline strategy configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param strategyName strategyName + +@return map[string]interface{} +*/ +func (a *ApplicationControllerApiService) GetStrategyConfigUsingGET(ctx context.Context, application string, strategyName string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/strategyConfigs/{strategyName}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"strategyName"+"}", fmt.Sprintf("%v", strategyName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of an application's pipeline strategy configurations + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + +@return []interface{} +*/ +func (a *ApplicationControllerApiService) GetStrategyConfigsForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/strategyConfigs" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Get task details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param taskDetailsId taskDetailsId + * @param optional nil or *ApplicationControllerApiGetTaskDetailsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return map[string]interface{} +*/ + +type ApplicationControllerApiGetTaskDetailsUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ApplicationControllerApiService) GetTaskDetailsUsingGET(ctx context.Context, id string, taskDetailsId string, localVarOptionals *ApplicationControllerApiGetTaskDetailsUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}/details/{taskDetailsId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"taskDetailsId"+"}", fmt.Sprintf("%v", taskDetailsId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Get task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *ApplicationControllerApiService) GetTaskUsingGET(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Retrieve a list of an application's tasks + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ApplicationControllerApiGetTasksUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - limit + * @param "Page" (optional.Int32) - page + * @param "Statuses" (optional.String) - statuses + +@return []interface{} +*/ + +type ApplicationControllerApiGetTasksUsingGETOpts struct { + Limit optional.Int32 + Page optional.Int32 + Statuses optional.String +} + +func (a *ApplicationControllerApiService) GetTasksUsingGET(ctx context.Context, application string, localVarOptionals *ApplicationControllerApiGetTasksUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Invoke pipeline config + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pipelineName pipelineName + * @param optional nil or *ApplicationControllerApiInvokePipelineConfigUsingPOSTOpts - Optional Parameters: + * @param "Trigger" (optional.Interface of interface{}) - trigger + * @param "User" (optional.String) - user + +@return HttpEntity +*/ + +type ApplicationControllerApiInvokePipelineConfigUsingPOSTOpts struct { + Trigger optional.Interface + User optional.String +} + +func (a *ApplicationControllerApiService) InvokePipelineConfigUsingPOST(ctx context.Context, application string, pipelineName string, localVarOptionals *ApplicationControllerApiInvokePipelineConfigUsingPOSTOpts) (HttpEntity, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HttpEntity + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs/{pipelineName}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.User.IsSet() { + localVarQueryParams.Add("user", parameterToString(localVarOptionals.User.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Trigger.IsSet() { + + localVarOptionalTrigger, localVarOptionalTriggerok := localVarOptionals.Trigger.Value().(interface{}) + if !localVarOptionalTriggerok { + return localVarReturnValue, nil, reportError("trigger should be interface{}") + } + localVarPostBody = &localVarOptionalTrigger + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v HttpEntity + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ApplicationControllerApiService Create task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param map_ map + +@return map[string]interface{} +*/ +func (a *ApplicationControllerApiService) TaskUsingPOST(ctx context.Context, application string, map_ interface{}) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &map_ + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_artifact_controller.go b/gateapi/api_artifact_controller.go new file mode 100644 index 00000000..b744cbcf --- /dev/null +++ b/gateapi/api_artifact_controller.go @@ -0,0 +1,318 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ArtifactControllerApiService service + +/* +ArtifactControllerApiService Retrieve the list of artifact accounts configured in Clouddriver. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ArtifactControllerApiAllUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ArtifactControllerApiAllUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ArtifactControllerApiService) AllUsingGET(ctx context.Context, localVarOptionals *ArtifactControllerApiAllUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/artifacts/credentials" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ArtifactControllerApiService Retrieve the list of artifact versions by account and artifact names + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountName accountName + * @param artifactName artifactName + * @param type_ type + * @param optional nil or *ArtifactControllerApiArtifactVersionsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []string +*/ + +type ArtifactControllerApiArtifactVersionsUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ArtifactControllerApiService) ArtifactVersionsUsingGET(ctx context.Context, accountName string, artifactName string, type_ string, localVarOptionals *ArtifactControllerApiArtifactVersionsUsingGETOpts) ([]string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/artifacts/account/{accountName}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"accountName"+"}", fmt.Sprintf("%v", accountName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("artifactName", parameterToString(artifactName, "")) + localVarQueryParams.Add("type", parameterToString(type_, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []string + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ArtifactControllerApiService Retrieve the specified artifact version for an artifact provider and package name + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param packageName packageName + * @param provider provider + * @param version version + +@return interface{} +*/ +func (a *ArtifactControllerApiService) GetArtifactUsingGET(ctx context.Context, packageName string, provider string, version string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/artifacts/{provider}/{packageName}/{version}" + localVarPath = strings.Replace(localVarPath, "{"+"packageName"+"}", fmt.Sprintf("%v", packageName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", fmt.Sprintf("%v", provider), -1) + localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", fmt.Sprintf("%v", version), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_auth_controller.go b/gateapi/api_auth_controller.go new file mode 100644 index 00000000..725841ff --- /dev/null +++ b/gateapi/api_auth_controller.go @@ -0,0 +1,433 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type AuthControllerApiService service + +/* +AuthControllerApiService Get service accounts + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AuthControllerApiGetServiceAccountsUsingGETOpts - Optional Parameters: + * @param "Application" (optional.String) - application + +@return []interface{} +*/ + +type AuthControllerApiGetServiceAccountsUsingGETOpts struct { + Application optional.String +} + +func (a *AuthControllerApiService) GetServiceAccountsUsingGET(ctx context.Context, localVarOptionals *AuthControllerApiGetServiceAccountsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/auth/user/serviceAccounts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AuthControllerApiService Get logged out message + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return string +*/ +func (a *AuthControllerApiService) LoggedOutUsingGET(ctx context.Context) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/auth/loggedOut" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v string + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +AuthControllerApiService Redirect to Deck + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param to to + + +*/ +func (a *AuthControllerApiService) RedirectUsingGET(ctx context.Context, to string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/auth/redirect" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("to", parameterToString(to, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +AuthControllerApiService Sync user roles + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + + +*/ +func (a *AuthControllerApiService) SyncUsingPOST(ctx context.Context) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/auth/roles/sync" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +AuthControllerApiService Get user + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return User +*/ +func (a *AuthControllerApiService) UserUsingGET(ctx context.Context) (User, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/auth/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v User + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_bake_controller.go b/gateapi/api_bake_controller.go new file mode 100644 index 00000000..f5f1dde7 --- /dev/null +++ b/gateapi/api_bake_controller.go @@ -0,0 +1,291 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type BakeControllerApiService service + +/* +BakeControllerApiService Retrieve a list of available bakery base images for a given cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param cloudProvider cloudProvider + +@return interface{} +*/ +func (a *BakeControllerApiService) BakeOptionsUsingGET(ctx context.Context, cloudProvider string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bakery/options/{cloudProvider}" + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BakeControllerApiService Retrieve a list of available bakery base images, grouped by cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return interface{} +*/ +func (a *BakeControllerApiService) BakeOptionsUsingGET1(ctx context.Context) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bakery/options" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BakeControllerApiService Retrieve the logs for a given bake + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param region region + * @param statusId statusId + +@return interface{} +*/ +func (a *BakeControllerApiService) LookupLogsUsingGET(ctx context.Context, region string, statusId string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bakery/logs/{region}/{statusId}" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + localVarPath = strings.Replace(localVarPath, "{"+"statusId"+"}", fmt.Sprintf("%v", statusId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_build_controller.go b/gateapi/api_build_controller.go new file mode 100644 index 00000000..ef7a3f49 --- /dev/null +++ b/gateapi/api_build_controller.go @@ -0,0 +1,939 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type BuildControllerApiService service + +/* +BuildControllerApiService Get build masters +Deprecated, use the v3 endpoint instead + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BuildControllerApiGetBuildMastersUsingGETOpts - Optional Parameters: + * @param "Type_" (optional.String) - type + +@return []interface{} +*/ + +type BuildControllerApiGetBuildMastersUsingGETOpts struct { + Type_ optional.String +} + +func (a *BuildControllerApiService) GetBuildMastersUsingGET(ctx context.Context, localVarOptionals *BuildControllerApiGetBuildMastersUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/builds" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get build for build master +Deprecated, use the v3 endpoint instead + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param number number + +@return map[string]interface{} +*/ +func (a *BuildControllerApiService) GetBuildUsingGET(ctx context.Context, buildMaster string, number string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/build/{number}/**" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get builds for build master +Deprecated, use the v3 endpoint instead + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + +@return []interface{} +*/ +func (a *BuildControllerApiService) GetBuildsUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/builds/**" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get job config +Deprecated, use the v3 endpoint instead + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + +@return map[string]interface{} +*/ +func (a *BuildControllerApiService) GetJobConfigUsingGET(ctx context.Context, buildMaster string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/jobs/**" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get jobs for build master +Deprecated, use the v3 endpoint instead + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + +@return []interface{} +*/ +func (a *BuildControllerApiService) GetJobsForBuildMasterUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/jobs" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get build masters + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BuildControllerApiV3GetBuildMastersUsingGETOpts - Optional Parameters: + * @param "Type_" (optional.String) - type + +@return []interface{} +*/ + +type BuildControllerApiV3GetBuildMastersUsingGETOpts struct { + Type_ optional.String +} + +func (a *BuildControllerApiService) V3GetBuildMastersUsingGET(ctx context.Context, localVarOptionals *BuildControllerApiV3GetBuildMastersUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v3/builds" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get build for build master + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param job job + * @param number number + +@return map[string]interface{} +*/ +func (a *BuildControllerApiService) V3GetBuildUsingGET(ctx context.Context, buildMaster string, job string, number string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/build/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("job", parameterToString(job, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get builds for build master + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param job job + +@return []interface{} +*/ +func (a *BuildControllerApiService) V3GetBuildsUsingGET(ctx context.Context, buildMaster string, job string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/builds" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("job", parameterToString(job, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get job config + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param job job + +@return map[string]interface{} +*/ +func (a *BuildControllerApiService) V3GetJobConfigUsingGET(ctx context.Context, buildMaster string, job string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/job" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("job", parameterToString(job, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +BuildControllerApiService Get jobs for build master + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + +@return []interface{} +*/ +func (a *BuildControllerApiService) V3GetJobsForBuildMasterUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/jobs" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_ci_controller.go b/gateapi/api_ci_controller.go new file mode 100644 index 00000000..4bac0acc --- /dev/null +++ b/gateapi/api_ci_controller.go @@ -0,0 +1,127 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CiControllerApiService service + +/* +CiControllerApiService getBuilds + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectKey projectKey + * @param repoSlug repoSlug + * @param optional nil or *CiControllerApiGetBuildsUsingGET1Opts - Optional Parameters: + * @param "CompletionStatus" (optional.String) - completionStatus + +@return []interface{} +*/ + +type CiControllerApiGetBuildsUsingGET1Opts struct { + CompletionStatus optional.String +} + +func (a *CiControllerApiService) GetBuildsUsingGET1(ctx context.Context, projectKey string, repoSlug string, localVarOptionals *CiControllerApiGetBuildsUsingGET1Opts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ci/builds" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.CompletionStatus.IsSet() { + localVarQueryParams.Add("completionStatus", parameterToString(localVarOptionals.CompletionStatus.Value(), "")) + } + localVarQueryParams.Add("projectKey", parameterToString(projectKey, "")) + localVarQueryParams.Add("repoSlug", parameterToString(repoSlug, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_cluster_controller.go b/gateapi/api_cluster_controller.go new file mode 100644 index 00000000..914a4e59 --- /dev/null +++ b/gateapi/api_cluster_controller.go @@ -0,0 +1,871 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ClusterControllerApiService service + +/* +ClusterControllerApiService Retrieve a cluster's loadbalancers + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param applicationName applicationName + * @param clusterName clusterName + * @param type_ type + * @param optional nil or *ClusterControllerApiGetClusterLoadBalancersUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ClusterControllerApiGetClusterLoadBalancersUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetClusterLoadBalancersUsingGET(ctx context.Context, account string, applicationName string, clusterName string, type_ string, localVarOptionals *ClusterControllerApiGetClusterLoadBalancersUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/{type}/loadBalancers" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a cluster's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param clusterName clusterName + * @param optional nil or *ClusterControllerApiGetClustersUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return map[string]interface{} +*/ + +type ClusterControllerApiGetClustersUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetClustersUsingGET(ctx context.Context, account string, application string, clusterName string, localVarOptionals *ClusterControllerApiGetClustersUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a list of clusters for an account + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param optional nil or *ClusterControllerApiGetClustersUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ClusterControllerApiGetClustersUsingGET1Opts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetClustersUsingGET1(ctx context.Context, account string, application string, localVarOptionals *ClusterControllerApiGetClustersUsingGET1Opts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a list of cluster names for an application, grouped by account + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ClusterControllerApiGetClustersUsingGET2Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return map[string]interface{} +*/ + +type ClusterControllerApiGetClustersUsingGET2Opts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetClustersUsingGET2(ctx context.Context, application string, localVarOptionals *ClusterControllerApiGetClustersUsingGET2Opts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a list of scaling activities for a server group + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param clusterName clusterName + * @param serverGroupName serverGroupName + * @param optional nil or *ClusterControllerApiGetScalingActivitiesUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + * @param "Region" (optional.String) - region + +@return []interface{} +*/ + +type ClusterControllerApiGetScalingActivitiesUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String + Region optional.String +} + +func (a *ClusterControllerApiService) GetScalingActivitiesUsingGET(ctx context.Context, account string, application string, clusterName string, serverGroupName string, localVarOptionals *ClusterControllerApiGetScalingActivitiesUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}/scalingActivities" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Region.IsSet() { + localVarQueryParams.Add("region", parameterToString(localVarOptionals.Region.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a server group's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param clusterName clusterName + * @param serverGroupName serverGroupName + * @param optional nil or *ClusterControllerApiGetServerGroupsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ClusterControllerApiGetServerGroupsUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetServerGroupsUsingGET(ctx context.Context, account string, application string, clusterName string, serverGroupName string, localVarOptionals *ClusterControllerApiGetServerGroupsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a list of server groups for a cluster + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param clusterName clusterName + * @param optional nil or *ClusterControllerApiGetServerGroupsUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ClusterControllerApiGetServerGroupsUsingGET1Opts struct { + XRateLimitApp optional.String +} + +func (a *ClusterControllerApiService) GetServerGroupsUsingGET1(ctx context.Context, account string, application string, clusterName string, localVarOptionals *ClusterControllerApiGetServerGroupsUsingGET1Opts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ClusterControllerApiService Retrieve a server group that matches a target coordinate (e.g., newest, ancestor) relative to a cluster +`scope` is either a zone or a region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param cloudProvider cloudProvider + * @param clusterName clusterName + * @param scope scope + * @param target target + * @param optional nil or *ClusterControllerApiGetTargetServerGroupUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "OnlyEnabled" (optional.Bool) - onlyEnabled + * @param "ValidateOldest" (optional.Bool) - validateOldest + +@return map[string]interface{} +*/ + +type ClusterControllerApiGetTargetServerGroupUsingGETOpts struct { + XRateLimitApp optional.String + OnlyEnabled optional.Bool + ValidateOldest optional.Bool +} + +func (a *ClusterControllerApiService) GetTargetServerGroupUsingGET(ctx context.Context, account string, application string, cloudProvider string, clusterName string, scope string, target string, localVarOptionals *ClusterControllerApiGetTargetServerGroupUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/{cloudProvider}/{scope}/serverGroups/target/{target}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scope"+"}", fmt.Sprintf("%v", scope), -1) + localVarPath = strings.Replace(localVarPath, "{"+"target"+"}", fmt.Sprintf("%v", target), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.OnlyEnabled.IsSet() { + localVarQueryParams.Add("onlyEnabled", parameterToString(localVarOptionals.OnlyEnabled.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ValidateOldest.IsSet() { + localVarQueryParams.Add("validateOldest", parameterToString(localVarOptionals.ValidateOldest.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_concourse_controller.go b/gateapi/api_concourse_controller.go new file mode 100644 index 00000000..188d88c9 --- /dev/null +++ b/gateapi/api_concourse_controller.go @@ -0,0 +1,301 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type ConcourseControllerApiService service + +/* +ConcourseControllerApiService Retrieve the list of job names for a given pipeline available to triggers + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param pipeline pipeline + * @param team team + +@return []interface{} +*/ +func (a *ConcourseControllerApiService) JobsUsingGET(ctx context.Context, buildMaster string, pipeline string, team string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/jobs" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipeline"+"}", fmt.Sprintf("%v", pipeline), -1) + localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ConcourseControllerApiService Retrieve the list of pipeline names for a given team available to triggers + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param team team + +@return []interface{} +*/ +func (a *ConcourseControllerApiService) PipelinesUsingGET(ctx context.Context, buildMaster string, team string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ConcourseControllerApiService Retrieve the list of resource names for a given pipeline available to the Concourse stage + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param buildMaster buildMaster + * @param pipeline pipeline + * @param team team + +@return []interface{} +*/ +func (a *ConcourseControllerApiService) ResourcesUsingGET(ctx context.Context, buildMaster string, pipeline string, team string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/resources" + localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipeline"+"}", fmt.Sprintf("%v", pipeline), -1) + localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_credentials_controller.go b/gateapi/api_credentials_controller.go new file mode 100644 index 00000000..f8fde0f5 --- /dev/null +++ b/gateapi/api_credentials_controller.go @@ -0,0 +1,342 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CredentialsControllerApiService service + +/* +CredentialsControllerApiService Retrieve an account's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param optional nil or *CredentialsControllerApiGetAccountUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "AccountNonExpired" (optional.Bool) - + * @param "AccountNonLocked" (optional.Bool) - + * @param "AllowedAccounts" (optional.Interface of []string) - + * @param "Authorities0Authority" (optional.String) - + * @param "CredentialsNonExpired" (optional.Bool) - + * @param "Email" (optional.String) - + * @param "Enabled" (optional.Bool) - + * @param "FirstName" (optional.String) - + * @param "LastName" (optional.String) - + * @param "Password" (optional.String) - + * @param "Roles" (optional.Interface of []string) - + * @param "Username" (optional.String) - + +@return AccountDetails +*/ + +type CredentialsControllerApiGetAccountUsingGETOpts struct { + XRateLimitApp optional.String + AccountNonExpired optional.Bool + AccountNonLocked optional.Bool + AllowedAccounts optional.Interface + Authorities0Authority optional.String + CredentialsNonExpired optional.Bool + Email optional.String + Enabled optional.Bool + FirstName optional.String + LastName optional.String + Password optional.String + Roles optional.Interface + Username optional.String +} + +func (a *CredentialsControllerApiService) GetAccountUsingGET(ctx context.Context, account string, localVarOptionals *CredentialsControllerApiGetAccountUsingGETOpts) (AccountDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AccountDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/credentials/{account}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccountNonExpired.IsSet() { + localVarQueryParams.Add("accountNonExpired", parameterToString(localVarOptionals.AccountNonExpired.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AccountNonLocked.IsSet() { + localVarQueryParams.Add("accountNonLocked", parameterToString(localVarOptionals.AccountNonLocked.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AllowedAccounts.IsSet() { + localVarQueryParams.Add("allowedAccounts", parameterToString(localVarOptionals.AllowedAccounts.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.Authorities0Authority.IsSet() { + localVarQueryParams.Add("authorities[0].authority", parameterToString(localVarOptionals.Authorities0Authority.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CredentialsNonExpired.IsSet() { + localVarQueryParams.Add("credentialsNonExpired", parameterToString(localVarOptionals.CredentialsNonExpired.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Email.IsSet() { + localVarQueryParams.Add("email", parameterToString(localVarOptionals.Email.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Enabled.IsSet() { + localVarQueryParams.Add("enabled", parameterToString(localVarOptionals.Enabled.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FirstName.IsSet() { + localVarQueryParams.Add("firstName", parameterToString(localVarOptionals.FirstName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.LastName.IsSet() { + localVarQueryParams.Add("lastName", parameterToString(localVarOptionals.LastName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarQueryParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Roles.IsSet() { + localVarQueryParams.Add("roles", parameterToString(localVarOptionals.Roles.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.Username.IsSet() { + localVarQueryParams.Add("username", parameterToString(localVarOptionals.Username.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v AccountDetails + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +CredentialsControllerApiService Retrieve a list of accounts + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CredentialsControllerApiGetAccountsUsingGETOpts - Optional Parameters: + * @param "AccountNonExpired" (optional.Bool) - + * @param "AccountNonLocked" (optional.Bool) - + * @param "AllowedAccounts" (optional.Interface of []string) - + * @param "Authorities0Authority" (optional.String) - + * @param "CredentialsNonExpired" (optional.Bool) - + * @param "Email" (optional.String) - + * @param "Enabled" (optional.Bool) - + * @param "Expand" (optional.Bool) - expand + * @param "FirstName" (optional.String) - + * @param "LastName" (optional.String) - + * @param "Password" (optional.String) - + * @param "Roles" (optional.Interface of []string) - + * @param "Username" (optional.String) - + +@return []Account +*/ + +type CredentialsControllerApiGetAccountsUsingGETOpts struct { + AccountNonExpired optional.Bool + AccountNonLocked optional.Bool + AllowedAccounts optional.Interface + Authorities0Authority optional.String + CredentialsNonExpired optional.Bool + Email optional.String + Enabled optional.Bool + Expand optional.Bool + FirstName optional.String + LastName optional.String + Password optional.String + Roles optional.Interface + Username optional.String +} + +func (a *CredentialsControllerApiService) GetAccountsUsingGET(ctx context.Context, localVarOptionals *CredentialsControllerApiGetAccountsUsingGETOpts) ([]Account, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Account + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/credentials" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccountNonExpired.IsSet() { + localVarQueryParams.Add("accountNonExpired", parameterToString(localVarOptionals.AccountNonExpired.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AccountNonLocked.IsSet() { + localVarQueryParams.Add("accountNonLocked", parameterToString(localVarOptionals.AccountNonLocked.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AllowedAccounts.IsSet() { + localVarQueryParams.Add("allowedAccounts", parameterToString(localVarOptionals.AllowedAccounts.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.Authorities0Authority.IsSet() { + localVarQueryParams.Add("authorities[0].authority", parameterToString(localVarOptionals.Authorities0Authority.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CredentialsNonExpired.IsSet() { + localVarQueryParams.Add("credentialsNonExpired", parameterToString(localVarOptionals.CredentialsNonExpired.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Email.IsSet() { + localVarQueryParams.Add("email", parameterToString(localVarOptionals.Email.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Enabled.IsSet() { + localVarQueryParams.Add("enabled", parameterToString(localVarOptionals.Enabled.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FirstName.IsSet() { + localVarQueryParams.Add("firstName", parameterToString(localVarOptionals.FirstName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.LastName.IsSet() { + localVarQueryParams.Add("lastName", parameterToString(localVarOptionals.LastName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarQueryParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Roles.IsSet() { + localVarQueryParams.Add("roles", parameterToString(localVarOptionals.Roles.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.Username.IsSet() { + localVarQueryParams.Add("username", parameterToString(localVarOptionals.Username.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Account + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_deck_plugins_controller.go b/gateapi/api_deck_plugins_controller.go new file mode 100644 index 00000000..c76fcee3 --- /dev/null +++ b/gateapi/api_deck_plugins_controller.go @@ -0,0 +1,205 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type DeckPluginsControllerApiService service + +/* +DeckPluginsControllerApiService Retrieve a single plugin asset by version + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param asset asset + * @param pluginId pluginId + * @param pluginVersion pluginVersion + +@return string +*/ +func (a *DeckPluginsControllerApiService) GetPluginAssetUsingGET(ctx context.Context, asset string, pluginId string, pluginVersion string) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/deck/{pluginId}/{pluginVersion}/{asset}" + localVarPath = strings.Replace(localVarPath, "{"+"asset"+"}", fmt.Sprintf("%v", asset), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pluginId"+"}", fmt.Sprintf("%v", pluginId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pluginVersion"+"}", fmt.Sprintf("%v", pluginVersion), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v string + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +DeckPluginsControllerApiService Retrieve a plugin manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []DeckPluginVersion +*/ +func (a *DeckPluginsControllerApiService) GetPluginManifestUsingGET(ctx context.Context) ([]DeckPluginVersion, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []DeckPluginVersion + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/deck/plugin-manifest.json" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []DeckPluginVersion + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/ecs_server_group_events_controller_api.go b/gateapi/api_ecs_server_group_events_controller.go similarity index 55% rename from gateapi/ecs_server_group_events_controller_api.go rename to gateapi/api_ecs_server_group_events_controller.go index 0ccb0571..fb49a0e0 100644 --- a/gateapi/ecs_server_group_events_controller_api.go +++ b/gateapi/api_ecs_server_group_events_controller.go @@ -1,3 +1,4 @@ + /* * Spinnaker API * @@ -10,12 +11,11 @@ package swagger import ( + "context" "io/ioutil" - "net/url" "net/http" + "net/url" "strings" - "golang.org/x/net/context" - "encoding/json" "fmt" ) @@ -26,22 +26,24 @@ var ( type EcsServerGroupEventsControllerApiService service - -/* EcsServerGroupEventsControllerApiService Retrieves a list of events for a server group - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param provider provider - @param region region - @param serverGroupName serverGroupName - @return []interface{}*/ -func (a *EcsServerGroupEventsControllerApiService) GetEventsUsingGET(ctx context.Context, account string, application string, provider string, region string, serverGroupName string) ([]interface{}, *http.Response, error) { +/* +EcsServerGroupEventsControllerApiService Retrieves a list of events for a server group + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param provider provider + * @param region region + * @param serverGroupName serverGroupName + +@return []interface{} +*/ +func (a *EcsServerGroupEventsControllerApiService) GetEventsUsingGET(ctx context.Context, account string, application string, provider string, region string, serverGroupName string) ([]interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} ) // create path and map variables @@ -54,11 +56,10 @@ func (a *EcsServerGroupEventsControllerApiService) GetEventsUsingGET(ctx context localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - localVarQueryParams.Add("provider", parameterToString(provider, "")) localVarQueryParams.Add("region", parameterToString(region, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -67,9 +68,7 @@ func (a *EcsServerGroupEventsControllerApiService) GetEventsUsingGET(ctx context } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } + localVarHttpHeaderAccepts := []string{"*/*"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -78,24 +77,47 @@ func (a *EcsServerGroupEventsControllerApiService) GetEventsUsingGET(ctx context } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { - return successPayload, nil, err + return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, err } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err } - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } } + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, nil } - diff --git a/gateapi/api_executions_controller.go b/gateapi/api_executions_controller.go new file mode 100644 index 00000000..12f459c0 --- /dev/null +++ b/gateapi/api_executions_controller.go @@ -0,0 +1,292 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ExecutionsControllerApiService service + +/* +ExecutionsControllerApiService Retrieves an ad-hoc collection of executions based on a number of user-supplied parameters. Either executionIds or pipelineConfigIds must be supplied in order to return any results. If both are supplied, an exception will be thrown. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts - Optional Parameters: + * @param "ExecutionIds" (optional.String) - A comma-separated list of executions to retrieve. Either this OR pipelineConfigIds must be supplied, but not both. + * @param "Expand" (optional.Bool) - Expands each execution object in the resulting list. If this value is missing, it is defaulted to true. + * @param "Limit" (optional.Int32) - The number of executions to return per pipeline configuration. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to 1. + * @param "PipelineConfigIds" (optional.String) - A comma-separated list of pipeline configuration IDs to retrieve recent executions for. Either this OR pipelineConfigIds must be supplied, but not both. + * @param "Statuses" (optional.String) - A comma-separated list of execution statuses to filter by. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to all statuses. + +@return []interface{} +*/ + +type ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts struct { + ExecutionIds optional.String + Expand optional.Bool + Limit optional.Int32 + PipelineConfigIds optional.String + Statuses optional.String +} + +func (a *ExecutionsControllerApiService) GetLatestExecutionsByConfigIdsUsingGET(ctx context.Context, localVarOptionals *ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/executions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ExecutionIds.IsSet() { + localVarQueryParams.Add("executionIds", parameterToString(localVarOptionals.ExecutionIds.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PipelineConfigIds.IsSet() { + localVarQueryParams.Add("pipelineConfigIds", parameterToString(localVarOptionals.PipelineConfigIds.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ExecutionsControllerApiService Search for pipeline executions using a combination of criteria. The returned list is sorted by buildTime (trigger time) in reverse order so that newer executions are first in the list. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application Only includes executions that are part of this application. If this value is \"*\", results will include executions of all applications. + * @param optional nil or *ExecutionsControllerApiSearchForPipelineExecutionsByTriggerUsingGETOpts - Optional Parameters: + * @param "EventId" (optional.String) - Only includes executions that were triggered by a trigger with this eventId. + * @param "Expand" (optional.Bool) - Expands each execution object in the resulting list. If this value is missing, it is defaulted to false. + * @param "PipelineName" (optional.String) - Only includes executions that with this pipeline name. + * @param "Reverse" (optional.Bool) - Reverses the resulting list before it is paginated. If this value is missing, it is defaulted to false. + * @param "Size" (optional.Int32) - Sets the size of the resulting list for pagination. This value must be > 0. If this value is missing, it is defaulted to 10. + * @param "StartIndex" (optional.Int32) - Sets the first item of the resulting list for pagination. The list is 0-indexed. This value must be >= 0. If this value is missing, it is defaulted to 0. + * @param "Statuses" (optional.String) - Only includes executions with a status that is equal to a status provided in this field. The list of statuses should be given as a comma-delimited string. If this value is missing, includes executions of all statuses. Allowed statuses are: NOT_STARTED, RUNNING, PAUSED, SUSPENDED, SUCCEEDED, FAILED_CONTINUE, TERMINAL, CANCELED, REDIRECT, STOPPED, SKIPPED, BUFFERED. + * @param "Trigger" (optional.String) - Only includes executions that were triggered by a trigger that matches the subset of fields provided by this value. This value should be a base64-encoded string of a JSON representation of a trigger object. The comparison succeeds if the execution trigger contains all the fields of the input trigger, the fields are of the same type, and each value of the field \"matches\". The term \"matches\" is specific for each field's type: - For Strings: A String value in the execution's trigger matches the input trigger's String value if the former equals the latter (case-insensitive) OR if the former matches the latter as a regular expression. - For Maps: A Map value in the execution's trigger matches the input trigger's Map value if the former contains all keys of the latter and their values match. - For Collections: A Collection value in the execution's trigger matches the input trigger's Collection value if the former has a unique element that matches each element of the latter. - Every other value is compared using the Java \"equals\" method (Groovy \"==\" operator) + * @param "TriggerTimeEndBoundary" (optional.Int64) - Only includes executions that were built at or before the given time, represented as a Unix timestamp in ms (UTC). This value must be <= 9223372036854775807 (Long.MAX_VALUE) and >= the value of [triggerTimeStartBoundary], if provided. If this value is missing, it is defaulted to 9223372036854775807. + * @param "TriggerTimeStartBoundary" (optional.Int64) - Only includes executions that were built at or after the given time, represented as a Unix timestamp in ms (UTC). This value must be >= 0 and <= the value of [triggerTimeEndBoundary], if provided. If this value is missing, it is defaulted to 0. + * @param "TriggerTypes" (optional.String) - Only includes executions that were triggered by a trigger with a type that is equal to a type provided in this field. The list of trigger types should be a comma-delimited string. If this value is missing, results will includes executions of all trigger types. + +@return []interface{} +*/ + +type ExecutionsControllerApiSearchForPipelineExecutionsByTriggerUsingGETOpts struct { + EventId optional.String + Expand optional.Bool + PipelineName optional.String + Reverse optional.Bool + Size optional.Int32 + StartIndex optional.Int32 + Statuses optional.String + Trigger optional.String + TriggerTimeEndBoundary optional.Int64 + TriggerTimeStartBoundary optional.Int64 + TriggerTypes optional.String +} + +func (a *ExecutionsControllerApiService) SearchForPipelineExecutionsByTriggerUsingGET(ctx context.Context, application string, localVarOptionals *ExecutionsControllerApiSearchForPipelineExecutionsByTriggerUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/executions/search" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.EventId.IsSet() { + localVarQueryParams.Add("eventId", parameterToString(localVarOptionals.EventId.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PipelineName.IsSet() { + localVarQueryParams.Add("pipelineName", parameterToString(localVarOptionals.PipelineName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Reverse.IsSet() { + localVarQueryParams.Add("reverse", parameterToString(localVarOptionals.Reverse.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Size.IsSet() { + localVarQueryParams.Add("size", parameterToString(localVarOptionals.Size.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StartIndex.IsSet() { + localVarQueryParams.Add("startIndex", parameterToString(localVarOptionals.StartIndex.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Trigger.IsSet() { + localVarQueryParams.Add("trigger", parameterToString(localVarOptionals.Trigger.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TriggerTimeEndBoundary.IsSet() { + localVarQueryParams.Add("triggerTimeEndBoundary", parameterToString(localVarOptionals.TriggerTimeEndBoundary.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TriggerTimeStartBoundary.IsSet() { + localVarQueryParams.Add("triggerTimeStartBoundary", parameterToString(localVarOptionals.TriggerTimeStartBoundary.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TriggerTypes.IsSet() { + localVarQueryParams.Add("triggerTypes", parameterToString(localVarOptionals.TriggerTypes.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_firewall_controller.go b/gateapi/api_firewall_controller.go new file mode 100644 index 00000000..c0803098 --- /dev/null +++ b/gateapi/api_firewall_controller.go @@ -0,0 +1,449 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type FirewallControllerApiService service + +/* +FirewallControllerApiService Retrieve a list of firewalls for a given account and region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param region region + * @param optional nil or *FirewallControllerApiAllByAccountAndRegionUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return []interface{} +*/ + +type FirewallControllerApiAllByAccountAndRegionUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *FirewallControllerApiService) AllByAccountAndRegionUsingGET(ctx context.Context, account string, region string, localVarOptionals *FirewallControllerApiAllByAccountAndRegionUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/firewalls/{account}/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FirewallControllerApiService Retrieve a list of firewalls for a given account, grouped by region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param optional nil or *FirewallControllerApiAllByAccountUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return interface{} +*/ + +type FirewallControllerApiAllByAccountUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *FirewallControllerApiService) AllByAccountUsingGET(ctx context.Context, account string, localVarOptionals *FirewallControllerApiAllByAccountUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/firewalls/{account}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FirewallControllerApiService Retrieve a list of firewalls, grouped by account, cloud provider, and region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FirewallControllerApiAllUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Id" (optional.String) - id + +@return interface{} +*/ + +type FirewallControllerApiAllUsingGET1Opts struct { + XRateLimitApp optional.String + Id optional.String +} + +func (a *FirewallControllerApiService) AllUsingGET1(ctx context.Context, localVarOptionals *FirewallControllerApiAllUsingGET1Opts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/firewalls" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Id.IsSet() { + localVarQueryParams.Add("id", parameterToString(localVarOptionals.Id.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FirewallControllerApiService Retrieve a firewall's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param name name + * @param region region + * @param optional nil or *FirewallControllerApiGetSecurityGroupUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + * @param "VpcId" (optional.String) - vpcId + +@return interface{} +*/ + +type FirewallControllerApiGetSecurityGroupUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String + VpcId optional.String +} + +func (a *FirewallControllerApiService) GetSecurityGroupUsingGET(ctx context.Context, account string, name string, region string, localVarOptionals *FirewallControllerApiGetSecurityGroupUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/firewalls/{account}/{region}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.VpcId.IsSet() { + localVarQueryParams.Add("vpcId", parameterToString(localVarOptionals.VpcId.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_image_controller.go b/gateapi/api_image_controller.go new file mode 100644 index 00000000..8fc4b66e --- /dev/null +++ b/gateapi/api_image_controller.go @@ -0,0 +1,357 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ImageControllerApiService service + +/* +ImageControllerApiService Retrieve a list of images, filtered by cloud provider, region, and account +The query parameter `q` filters the list of images by image name + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ImageControllerApiFindImagesUsingGETOpts - Optional Parameters: + * @param "Account" (optional.String) - account + * @param "Count" (optional.Int32) - count + * @param "Provider" (optional.String) - provider + * @param "Q" (optional.String) - q + * @param "Region" (optional.String) - region + +@return []interface{} +*/ + +type ImageControllerApiFindImagesUsingGETOpts struct { + Account optional.String + Count optional.Int32 + Provider optional.String + Q optional.String + Region optional.String +} + +func (a *ImageControllerApiService) FindImagesUsingGET(ctx context.Context, localVarOptionals *ImageControllerApiFindImagesUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/images/find" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Account.IsSet() { + localVarQueryParams.Add("account", parameterToString(localVarOptionals.Account.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Count.IsSet() { + localVarQueryParams.Add("count", parameterToString(localVarOptionals.Count.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Q.IsSet() { + localVarQueryParams.Add("q", parameterToString(localVarOptionals.Q.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Region.IsSet() { + localVarQueryParams.Add("region", parameterToString(localVarOptionals.Region.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ImageControllerApiService Find tags + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param repository repository + * @param optional nil or *ImageControllerApiFindTagsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return []interface{} +*/ + +type ImageControllerApiFindTagsUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *ImageControllerApiService) FindTagsUsingGET(ctx context.Context, account string, repository string, localVarOptionals *ImageControllerApiFindTagsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/images/tags" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("account", parameterToString(account, "")) + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + localVarQueryParams.Add("repository", parameterToString(repository, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ImageControllerApiService Get image details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param imageId imageId + * @param region region + * @param optional nil or *ImageControllerApiGetImageDetailsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return []interface{} +*/ + +type ImageControllerApiGetImageDetailsUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *ImageControllerApiService) GetImageDetailsUsingGET(ctx context.Context, account string, imageId string, region string, localVarOptionals *ImageControllerApiGetImageDetailsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/images/{account}/{region}/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", fmt.Sprintf("%v", imageId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_instance_controller.go b/gateapi/api_instance_controller.go new file mode 100644 index 00000000..c648f6f7 --- /dev/null +++ b/gateapi/api_instance_controller.go @@ -0,0 +1,237 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type InstanceControllerApiService service + +/* +InstanceControllerApiService Retrieve an instance's console output + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param instanceId instanceId + * @param region region + * @param optional nil or *InstanceControllerApiGetConsoleOutputUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return interface{} +*/ + +type InstanceControllerApiGetConsoleOutputUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *InstanceControllerApiService) GetConsoleOutputUsingGET(ctx context.Context, account string, instanceId string, region string, localVarOptionals *InstanceControllerApiGetConsoleOutputUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/instances/{account}/{region}/{instanceId}/console" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", fmt.Sprintf("%v", instanceId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +InstanceControllerApiService Retrieve an instance's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param instanceId instanceId + * @param region region + * @param optional nil or *InstanceControllerApiGetInstanceDetailsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return interface{} +*/ + +type InstanceControllerApiGetInstanceDetailsUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *InstanceControllerApiService) GetInstanceDetailsUsingGET(ctx context.Context, account string, instanceId string, region string, localVarOptionals *InstanceControllerApiGetInstanceDetailsUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/instances/{account}/{region}/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", fmt.Sprintf("%v", instanceId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_job_controller.go b/gateapi/api_job_controller.go new file mode 100644 index 00000000..7f6b52a0 --- /dev/null +++ b/gateapi/api_job_controller.go @@ -0,0 +1,137 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type JobControllerApiService service + +/* +JobControllerApiService Get job + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param applicationName applicationName + * @param name name + * @param region region + * @param optional nil or *JobControllerApiGetJobUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Expand" (optional.String) - expand + +@return map[string]interface{} +*/ + +type JobControllerApiGetJobUsingGETOpts struct { + XRateLimitApp optional.String + Expand optional.String +} + +func (a *JobControllerApiService) GetJobUsingGET(ctx context.Context, account string, applicationName string, name string, region string, localVarOptionals *JobControllerApiGetJobUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/jobs/{account}/{region}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_load_balancer_controller.go b/gateapi/api_load_balancer_controller.go new file mode 100644 index 00000000..10fce5fa --- /dev/null +++ b/gateapi/api_load_balancer_controller.go @@ -0,0 +1,437 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type LoadBalancerControllerApiService service + +/* +LoadBalancerControllerApiService Retrieve a list of load balancers for a given cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *LoadBalancerControllerApiGetAllUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return []interface{} +*/ + +type LoadBalancerControllerApiGetAllUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *LoadBalancerControllerApiService) GetAllUsingGET(ctx context.Context, localVarOptionals *LoadBalancerControllerApiGetAllUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/loadBalancers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LoadBalancerControllerApiService Retrieve a list of load balancers for a given application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *LoadBalancerControllerApiGetApplicationLoadBalancersUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type LoadBalancerControllerApiGetApplicationLoadBalancersUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *LoadBalancerControllerApiService) GetApplicationLoadBalancersUsingGET(ctx context.Context, application string, localVarOptionals *LoadBalancerControllerApiGetApplicationLoadBalancersUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/loadBalancers" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LoadBalancerControllerApiService Retrieve a load balancer's details as a single element list for a given account, region, cloud provider and load balancer name + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param name name + * @param region region + * @param optional nil or *LoadBalancerControllerApiGetLoadBalancerDetailsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return []interface{} +*/ + +type LoadBalancerControllerApiGetLoadBalancerDetailsUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *LoadBalancerControllerApiService) GetLoadBalancerDetailsUsingGET(ctx context.Context, account string, name string, region string, localVarOptionals *LoadBalancerControllerApiGetLoadBalancerDetailsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/loadBalancers/{account}/{region}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LoadBalancerControllerApiService Retrieve a load balancer for a given cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name name + * @param optional nil or *LoadBalancerControllerApiGetLoadBalancerUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return map[string]interface{} +*/ + +type LoadBalancerControllerApiGetLoadBalancerUsingGETOpts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *LoadBalancerControllerApiService) GetLoadBalancerUsingGET(ctx context.Context, name string, localVarOptionals *LoadBalancerControllerApiGetLoadBalancerUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/loadBalancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_managed_controller.go b/gateapi/api_managed_controller.go new file mode 100644 index 00000000..e4ed0d03 --- /dev/null +++ b/gateapi/api_managed_controller.go @@ -0,0 +1,2136 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ManagedControllerApiService service + +/* +ManagedControllerApiService Create a pin for an artifact in an environment + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pin pin + + +*/ +func (a *ManagedControllerApiService) CreatePinUsingPOST(ctx context.Context, application string, pin EnvironmentArtifactPin) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pin" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pin + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Delete a delivery config manifest for an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + +@return DeliveryConfig +*/ +func (a *ManagedControllerApiService) DeleteManifestByAppUsingDELETE(ctx context.Context, application string) (DeliveryConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeliveryConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/config" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v DeliveryConfig + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Delete a delivery config manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name name + +@return DeliveryConfig +*/ +func (a *ManagedControllerApiService) DeleteManifestUsingDELETE(ctx context.Context, name string) (DeliveryConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeliveryConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v DeliveryConfig + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Unpin one or more artifact(s) in an environment. If the `reference` parameter is specified, only the corresponding artifact will be unpinned. If it's omitted, all pinned artifacts in the environment will be unpinned. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param targetEnvironment targetEnvironment + * @param optional nil or *ManagedControllerApiDeletePinUsingDELETEOpts - Optional Parameters: + * @param "Reference" (optional.String) - reference + + +*/ + +type ManagedControllerApiDeletePinUsingDELETEOpts struct { + Reference optional.String +} + +func (a *ManagedControllerApiService) DeletePinUsingDELETE(ctx context.Context, application string, targetEnvironment string, localVarOptionals *ManagedControllerApiDeletePinUsingDELETEOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pin/{targetEnvironment}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"targetEnvironment"+"}", fmt.Sprintf("%v", targetEnvironment), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Reference.IsSet() { + localVarQueryParams.Add("reference", parameterToString(localVarOptionals.Reference.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Veto an artifact version in an environment + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param reference reference + * @param targetEnvironment targetEnvironment + * @param version version + + +*/ +func (a *ManagedControllerApiService) DeleteVetoUsingDELETE(ctx context.Context, application string, reference string, targetEnvironment string, version string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/veto/{targetEnvironment}/{reference}/{version}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"reference"+"}", fmt.Sprintf("%v", reference), -1) + localVarPath = strings.Replace(localVarPath, "{"+"targetEnvironment"+"}", fmt.Sprintf("%v", targetEnvironment), -1) + localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", fmt.Sprintf("%v", version), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Ad-hoc validate and diff a config manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param manifest manifest + +@return interface{} +*/ +func (a *ManagedControllerApiService) DiffManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/diff" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/x-yaml"} + + // 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 = &manifest + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Ad-hoc validate and diff a resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param resource resource + +@return interface{} +*/ +func (a *ManagedControllerApiService) DiffResourceUsingPOST(ctx context.Context, resource Resource) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/diff" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/x-yaml"} + + // 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 = &resource + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Generates an artifact definition based on the artifact used in a running cluster + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param cloudProvider cloudProvider + * @param clusterName clusterName + +@return interface{} +*/ +func (a *ManagedControllerApiService) ExportResourceUsingGET(ctx context.Context, account string, cloudProvider string, clusterName string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/export/artifact/{cloudProvider}/{account}/{clusterName}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Generate a keel resource definition for a deployed cloud resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param cloudProvider cloudProvider + * @param name name + * @param serviceAccount serviceAccount + * @param type_ type + +@return Resource +*/ +func (a *ManagedControllerApiService) ExportResourceUsingGET1(ctx context.Context, account string, cloudProvider string, name string, serviceAccount string, type_ string) (Resource, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Resource + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/export/{cloudProvider}/{account}/{type}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("serviceAccount", parameterToString(serviceAccount, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Resource + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService getApiDocs + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return interface{} +*/ +func (a *ManagedControllerApiService) GetApiDocsUsingGET(ctx context.Context) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/api-docs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get managed details about an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param optional nil or *ManagedControllerApiGetApplicationDetailsUsingGETOpts - Optional Parameters: + * @param "Entities" (optional.Interface of []string) - entities + * @param "IncludeDetails" (optional.Bool) - includeDetails + +@return interface{} +*/ + +type ManagedControllerApiGetApplicationDetailsUsingGETOpts struct { + Entities optional.Interface + IncludeDetails optional.Bool +} + +func (a *ManagedControllerApiService) GetApplicationDetailsUsingGET(ctx context.Context, application string, localVarOptionals *ManagedControllerApiGetApplicationDetailsUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Entities.IsSet() { + localVarQueryParams.Add("entities", parameterToString(localVarOptionals.Entities.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.IncludeDetails.IsSet() { + localVarQueryParams.Add("includeDetails", parameterToString(localVarOptionals.IncludeDetails.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get the delivery config associated with an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + +@return DeliveryConfig +*/ +func (a *ManagedControllerApiService) GetConfigByUsingGET(ctx context.Context, application string) (DeliveryConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeliveryConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/config" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v DeliveryConfig + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService List up-to {limit} current constraint states for an environment + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param environment environment + * @param optional nil or *ManagedControllerApiGetConstraintStateUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.String) - limit + +@return ConstraintState +*/ + +type ManagedControllerApiGetConstraintStateUsingGETOpts struct { + Limit optional.String +} + +func (a *ManagedControllerApiService) GetConstraintStateUsingGET(ctx context.Context, application string, environment string, localVarOptionals *ManagedControllerApiGetConstraintStateUsingGETOpts) (ConstraintState, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConstraintState + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/environment/{environment}/constraints" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environment"+"}", fmt.Sprintf("%v", environment), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v ConstraintState + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get the status of each version of each artifact in each environment + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name name + +@return []interface{} +*/ +func (a *ManagedControllerApiService) GetManifestArtifactsUsingGET(ctx context.Context, name string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}/artifacts" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get a delivery config manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name name + +@return DeliveryConfig +*/ +func (a *ManagedControllerApiService) GetManifestUsingGET(ctx context.Context, name string) (DeliveryConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeliveryConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v DeliveryConfig + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get status of a resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param resourceId resourceId + +@return interface{} +*/ +func (a *ManagedControllerApiService) GetResourceStatusUsingGET(ctx context.Context, resourceId string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/status" + localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Get a resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param resourceId resourceId + +@return Resource +*/ +func (a *ManagedControllerApiService) GetResourceUsingGET(ctx context.Context, resourceId string) (Resource, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Resource + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}" + localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Resource + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Pause management of an entire application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + + +*/ +func (a *ManagedControllerApiService) PauseApplicationUsingPOST(ctx context.Context, application string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pause" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Pause management of a resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param resourceId resourceId + + +*/ +func (a *ManagedControllerApiService) PauseResourceUsingPOST(ctx context.Context, resourceId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/pause" + localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Resume management of an entire application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + + +*/ +func (a *ManagedControllerApiService) ResumeApplicationUsingDELETE(ctx context.Context, application string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pause" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Resume management of a resource + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param resourceId resourceId + + +*/ +func (a *ManagedControllerApiService) ResumeResourceUsingDELETE(ctx context.Context, resourceId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/pause" + localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Update the status of an environment constraint + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param environment environment + * @param status status + + +*/ +func (a *ManagedControllerApiService) UpdateConstraintStatusUsingPOST(ctx context.Context, application string, environment string, status ConstraintStatus) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/environment/{environment}/constraint" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environment"+"}", fmt.Sprintf("%v", environment), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &status + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Create or update a delivery config manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param manifest manifest + +@return DeliveryConfig +*/ +func (a *ManagedControllerApiService) UpsertManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (DeliveryConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeliveryConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/x-yaml"} + + // 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 = &manifest + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v DeliveryConfig + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Validate a delivery config manifest + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param manifest manifest + +@return interface{} +*/ +func (a *ManagedControllerApiService) ValidateManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/validate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/x-yaml"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/x-yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &manifest + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ManagedControllerApiService Veto an artifact version in an environment + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param veto veto + + +*/ +func (a *ManagedControllerApiService) VetoUsingPOST(ctx context.Context, application string, veto EnvironmentArtifactVeto) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/veto" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &veto + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/gateapi/api_network_controller.go b/gateapi/api_network_controller.go new file mode 100644 index 00000000..b014496c --- /dev/null +++ b/gateapi/api_network_controller.go @@ -0,0 +1,222 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type NetworkControllerApiService service + +/* +NetworkControllerApiService Retrieve a list of networks for a given cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param cloudProvider cloudProvider + * @param optional nil or *NetworkControllerApiAllByCloudProviderUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type NetworkControllerApiAllByCloudProviderUsingGETOpts struct { + XRateLimitApp optional.String +} + +func (a *NetworkControllerApiService) AllByCloudProviderUsingGET(ctx context.Context, cloudProvider string, localVarOptionals *NetworkControllerApiAllByCloudProviderUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/networks/{cloudProvider}" + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +NetworkControllerApiService Retrieve a list of networks, grouped by cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *NetworkControllerApiAllUsingGET2Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return map[string]interface{} +*/ + +type NetworkControllerApiAllUsingGET2Opts struct { + XRateLimitApp optional.String +} + +func (a *NetworkControllerApiService) AllUsingGET2(ctx context.Context, localVarOptionals *NetworkControllerApiAllUsingGET2Opts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/networks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_pipeline_config_controller.go b/gateapi/api_pipeline_config_controller.go new file mode 100644 index 00000000..19bd3fbe --- /dev/null +++ b/gateapi/api_pipeline_config_controller.go @@ -0,0 +1,300 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PipelineConfigControllerApiService service + +/* +PipelineConfigControllerApiService Convert a pipeline config to a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipelineConfigId pipelineConfigId + +@return string +*/ +func (a *PipelineConfigControllerApiService) ConvertPipelineConfigToPipelineTemplateUsingGET(ctx context.Context, pipelineConfigId string) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineConfigs/{pipelineConfigId}/convertToTemplate" + localVarPath = strings.Replace(localVarPath, "{"+"pipelineConfigId"+"}", fmt.Sprintf("%v", pipelineConfigId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v string + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineConfigControllerApiService Get all pipeline configs. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *PipelineConfigControllerApiService) GetAllPipelineConfigsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineConfigs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineConfigControllerApiService Get pipeline config history. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipelineConfigId pipelineConfigId + * @param optional nil or *PipelineConfigControllerApiGetPipelineConfigHistoryUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - limit + +@return []interface{} +*/ + +type PipelineConfigControllerApiGetPipelineConfigHistoryUsingGETOpts struct { + Limit optional.Int32 +} + +func (a *PipelineConfigControllerApiService) GetPipelineConfigHistoryUsingGET(ctx context.Context, pipelineConfigId string, localVarOptionals *PipelineConfigControllerApiGetPipelineConfigHistoryUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineConfigs/{pipelineConfigId}/history" + localVarPath = strings.Replace(localVarPath, "{"+"pipelineConfigId"+"}", fmt.Sprintf("%v", pipelineConfigId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_pipeline_controller.go b/gateapi/api_pipeline_controller.go new file mode 100644 index 00000000..cb208f39 --- /dev/null +++ b/gateapi/api_pipeline_controller.go @@ -0,0 +1,1611 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PipelineControllerApiService service + +/* +PipelineControllerApiService Cancel a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *PipelineControllerApiCancelPipelineUsingPUT1Opts - Optional Parameters: + * @param "Force" (optional.Bool) - force + * @param "Reason" (optional.String) - reason + + +*/ + +type PipelineControllerApiCancelPipelineUsingPUT1Opts struct { + Force optional.Bool + Reason optional.String +} + +func (a *PipelineControllerApiService) CancelPipelineUsingPUT1(ctx context.Context, id string, localVarOptionals *PipelineControllerApiCancelPipelineUsingPUT1Opts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Force.IsSet() { + localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Reason.IsSet() { + localVarQueryParams.Add("reason", parameterToString(localVarOptionals.Reason.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Delete a pipeline definition + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pipelineName pipelineName + + +*/ +func (a *PipelineControllerApiService) DeletePipelineUsingDELETE(ctx context.Context, application string, pipelineName string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{application}/{pipelineName}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Delete a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) DeletePipelineUsingDELETE1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Evaluate a pipeline expression at a specific stage using the provided execution as context + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param expression expression + * @param id id + * @param stageId stageId + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) EvaluateExpressionForExecutionAtStageUsingGET(ctx context.Context, expression string, id string, stageId string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/{stageId}/evaluateExpression" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("expression", parameterToString(expression, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Evaluate a pipeline expression using the provided execution as context + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param expression expression + * @param id id + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) EvaluateExpressionForExecutionUsingGET(ctx context.Context, expression string, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateExpression" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("expression", parameterToString(expression, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Evaluate a pipeline expression using the provided execution as context + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param pipelineExpression pipelineExpression + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) EvaluateExpressionForExecutionViaPOSTUsingPOST1(ctx context.Context, id string, pipelineExpression interface{}) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateExpression" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipelineExpression + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Evaluate variables same as Evaluate Variables stage using the provided execution as context + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param executionId Execution id to run against + * @param expressions List of variables/expressions to evaluate + * @param optional nil or *PipelineControllerApiEvaluateVariablesUsingPOSTOpts - Optional Parameters: + * @param "RequisiteStageRefIds" (optional.String) - Comma separated list of requisite stage IDs for the evaluation stage + * @param "SpelVersion" (optional.String) - Version of SpEL evaluation logic to use (v3 or v4) + +@return map[string]interface{} +*/ + +type PipelineControllerApiEvaluateVariablesUsingPOSTOpts struct { + RequisiteStageRefIds optional.String + SpelVersion optional.String +} + +func (a *PipelineControllerApiService) EvaluateVariablesUsingPOST(ctx context.Context, executionId string, expressions []Mapstringstring, localVarOptionals *PipelineControllerApiEvaluateVariablesUsingPOSTOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateVariables" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("executionId", parameterToString(executionId, "")) + if localVarOptionals != nil && localVarOptionals.RequisiteStageRefIds.IsSet() { + localVarQueryParams.Add("requisiteStageRefIds", parameterToString(localVarOptionals.RequisiteStageRefIds.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SpelVersion.IsSet() { + localVarQueryParams.Add("spelVersion", parameterToString(localVarOptionals.SpelVersion.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &expressions + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Retrieve a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return interface{} +*/ +func (a *PipelineControllerApiService) GetPipelineUsingGET(ctx context.Context, id string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Trigger a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pipelineNameOrId pipelineNameOrId + * @param optional nil or *PipelineControllerApiInvokePipelineConfigUsingPOST1Opts - Optional Parameters: + * @param "Trigger" (optional.Interface of interface{}) - trigger + + +*/ + +type PipelineControllerApiInvokePipelineConfigUsingPOST1Opts struct { + Trigger optional.Interface +} + +func (a *PipelineControllerApiService) InvokePipelineConfigUsingPOST1(ctx context.Context, application string, pipelineNameOrId string, localVarOptionals *PipelineControllerApiInvokePipelineConfigUsingPOST1Opts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{application}/{pipelineNameOrId}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipelineNameOrId"+"}", fmt.Sprintf("%v", pipelineNameOrId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Trigger.IsSet() { + + localVarOptionalTrigger, localVarOptionalTriggerok := localVarOptionals.Trigger.Value().(interface{}) + if !localVarOptionalTriggerok { + return nil, reportError("trigger should be interface{}") + } + localVarPostBody = &localVarOptionalTrigger + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Trigger a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param pipelineNameOrId pipelineNameOrId + * @param optional nil or *PipelineControllerApiInvokePipelineConfigViaEchoUsingPOSTOpts - Optional Parameters: + * @param "Trigger" (optional.Interface of interface{}) - trigger + +@return interface{} +*/ + +type PipelineControllerApiInvokePipelineConfigViaEchoUsingPOSTOpts struct { + Trigger optional.Interface +} + +func (a *PipelineControllerApiService) InvokePipelineConfigViaEchoUsingPOST(ctx context.Context, application string, pipelineNameOrId string, localVarOptionals *PipelineControllerApiInvokePipelineConfigViaEchoUsingPOSTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/v2/{application}/{pipelineNameOrId}" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pipelineNameOrId"+"}", fmt.Sprintf("%v", pipelineNameOrId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Trigger.IsSet() { + + localVarOptionalTrigger, localVarOptionalTriggerok := localVarOptionals.Trigger.Value().(interface{}) + if !localVarOptionalTriggerok { + return localVarReturnValue, nil, reportError("trigger should be interface{}") + } + localVarPostBody = &localVarOptionalTrigger + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Pause a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + + +*/ +func (a *PipelineControllerApiService) PausePipelineUsingPUT(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/pause" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Rename a pipeline definition + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param renameCommand renameCommand + + +*/ +func (a *PipelineControllerApiService) RenamePipelineUsingPOST(ctx context.Context, renameCommand interface{}) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/move" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &renameCommand + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Restart a stage execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param context context + * @param id id + * @param stageId stageId + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) RestartStageUsingPUT(ctx context.Context, context interface{}, id string, stageId string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/stages/{stageId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &context + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Resume a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) ResumePipelineUsingPUT(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/resume" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Save a pipeline definition + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipeline pipeline + + +*/ +func (a *PipelineControllerApiService) SavePipelineUsingPOST(ctx context.Context, pipeline interface{}) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipeline + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Initiate a pipeline execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param map_ map + +@return ResponseEntity +*/ +func (a *PipelineControllerApiService) StartUsingPOST(ctx context.Context, map_ interface{}) (ResponseEntity, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseEntity + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/start" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &map_ + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v ResponseEntity + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Update a pipeline definition + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param pipeline pipeline + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) UpdatePipelineUsingPUT(ctx context.Context, id string, pipeline interface{}) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipeline + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineControllerApiService Update a stage execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param context context + * @param id id + * @param stageId stageId + +@return map[string]interface{} +*/ +func (a *PipelineControllerApiService) UpdateStageUsingPATCH(ctx context.Context, context interface{}, id string, stageId string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/stages/{stageId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &context + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_pipeline_templates_controller.go b/gateapi/api_pipeline_templates_controller.go new file mode 100644 index 00000000..12d87d40 --- /dev/null +++ b/gateapi/api_pipeline_templates_controller.go @@ -0,0 +1,687 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PipelineTemplatesControllerApiService service + +/* +PipelineTemplatesControllerApiService Create a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipelineTemplate pipelineTemplate + + +*/ +func (a *PipelineTemplatesControllerApiService) CreateUsingPOST(ctx context.Context, pipelineTemplate interface{}) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipelineTemplate + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService Delete a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *PipelineTemplatesControllerApiDeleteUsingDELETEOpts - Optional Parameters: + * @param "Application" (optional.String) - application + +@return map[string]interface{} +*/ + +type PipelineTemplatesControllerApiDeleteUsingDELETEOpts struct { + Application optional.String +} + +func (a *PipelineTemplatesControllerApiService) DeleteUsingDELETE(ctx context.Context, id string, localVarOptionals *PipelineTemplatesControllerApiDeleteUsingDELETEOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService Get a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *PipelineTemplatesControllerApiService) GetUsingGET(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService List all pipelines that implement a pipeline template + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *PipelineTemplatesControllerApiListPipelineTemplateDependentsUsingGETOpts - Optional Parameters: + * @param "Recursive" (optional.Bool) - recursive + +@return []interface{} +*/ + +type PipelineTemplatesControllerApiListPipelineTemplateDependentsUsingGETOpts struct { + Recursive optional.Bool +} + +func (a *PipelineTemplatesControllerApiService) ListPipelineTemplateDependentsUsingGET(ctx context.Context, id string, localVarOptionals *PipelineTemplatesControllerApiListPipelineTemplateDependentsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}/dependents" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Recursive.IsSet() { + localVarQueryParams.Add("recursive", parameterToString(localVarOptionals.Recursive.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService List pipeline templates. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PipelineTemplatesControllerApiListUsingGETOpts - Optional Parameters: + * @param "Scopes" (optional.Interface of []string) - scopes + +@return []interface{} +*/ + +type PipelineTemplatesControllerApiListUsingGETOpts struct { + Scopes optional.Interface +} + +func (a *PipelineTemplatesControllerApiService) ListUsingGET(ctx context.Context, localVarOptionals *PipelineTemplatesControllerApiListUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Scopes.IsSet() { + localVarQueryParams.Add("scopes", parameterToString(localVarOptionals.Scopes.Value(), "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService Resolve a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param source source + * @param optional nil or *PipelineTemplatesControllerApiResolveTemplatesUsingGETOpts - Optional Parameters: + * @param "ExecutionId" (optional.String) - executionId + * @param "PipelineConfigId" (optional.String) - pipelineConfigId + +@return map[string]interface{} +*/ + +type PipelineTemplatesControllerApiResolveTemplatesUsingGETOpts struct { + ExecutionId optional.String + PipelineConfigId optional.String +} + +func (a *PipelineTemplatesControllerApiService) ResolveTemplatesUsingGET(ctx context.Context, source string, localVarOptionals *PipelineTemplatesControllerApiResolveTemplatesUsingGETOpts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/resolve" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ExecutionId.IsSet() { + localVarQueryParams.Add("executionId", parameterToString(localVarOptionals.ExecutionId.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PipelineConfigId.IsSet() { + localVarQueryParams.Add("pipelineConfigId", parameterToString(localVarOptionals.PipelineConfigId.Value(), "")) + } + localVarQueryParams.Add("source", parameterToString(source, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PipelineTemplatesControllerApiService Update a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param pipelineTemplate pipelineTemplate + * @param optional nil or *PipelineTemplatesControllerApiUpdateUsingPOSTOpts - Optional Parameters: + * @param "SkipPlanDependents" (optional.Bool) - skipPlanDependents + + +*/ + +type PipelineTemplatesControllerApiUpdateUsingPOSTOpts struct { + SkipPlanDependents optional.Bool +} + +func (a *PipelineTemplatesControllerApiService) UpdateUsingPOST(ctx context.Context, id string, pipelineTemplate interface{}, localVarOptionals *PipelineTemplatesControllerApiUpdateUsingPOSTOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.SkipPlanDependents.IsSet() { + localVarQueryParams.Add("skipPlanDependents", parameterToString(localVarOptionals.SkipPlanDependents.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipelineTemplate + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/gateapi/api_plugin_info_controller.go b/gateapi/api_plugin_info_controller.go new file mode 100644 index 00000000..d103a489 --- /dev/null +++ b/gateapi/api_plugin_info_controller.go @@ -0,0 +1,376 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PluginInfoControllerApiService service + +/* +PluginInfoControllerApiService Delete plugin info with the provided Id + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return interface{} +*/ +func (a *PluginInfoControllerApiService) DeletePluginInfoUsingDELETE(ctx context.Context, id string) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/info/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PluginInfoControllerApiService Get all plugin info objects + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PluginInfoControllerApiGetAllPluginInfoUsingGETOpts - Optional Parameters: + * @param "Service" (optional.String) - service + +@return []Mapstringobject +*/ + +type PluginInfoControllerApiGetAllPluginInfoUsingGETOpts struct { + Service optional.String +} + +func (a *PluginInfoControllerApiService) GetAllPluginInfoUsingGET(ctx context.Context, localVarOptionals *PluginInfoControllerApiGetAllPluginInfoUsingGETOpts) ([]Mapstringobject, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Mapstringobject + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Service.IsSet() { + localVarQueryParams.Add("service", parameterToString(localVarOptionals.Service.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Mapstringobject + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PluginInfoControllerApiService Persist plugin metadata information + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pluginInfo pluginInfo + + +*/ +func (a *PluginInfoControllerApiService) PersistPluginInfoUsingPOST(ctx context.Context, pluginInfo SpinnakerPluginInfo) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pluginInfo + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PluginInfoControllerApiService Persist plugin metadata information + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pluginInfo pluginInfo + + +*/ +func (a *PluginInfoControllerApiService) PersistPluginInfoUsingPUT(ctx context.Context, pluginInfo SpinnakerPluginInfo) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pluginInfo + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/gateapi/plugin_publish_controller_api.go b/gateapi/api_plugin_publish_controller.go similarity index 64% rename from gateapi/plugin_publish_controller_api.go rename to gateapi/api_plugin_publish_controller.go index f83b71a8..3f0975ac 100644 --- a/gateapi/plugin_publish_controller_api.go +++ b/gateapi/api_plugin_publish_controller.go @@ -1,3 +1,4 @@ + /* * Spinnaker API * @@ -10,13 +11,13 @@ package swagger import ( + "context" "io/ioutil" - "net/url" "net/http" + "net/url" "strings" - "golang.org/x/net/context" - "os" "fmt" + "os" ) // Linger please @@ -26,20 +27,23 @@ var ( type PluginPublishControllerApiService service +/* +PluginPublishControllerApiService Publish a plugin binary and the plugin info metadata. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param plugin plugin + * @param pluginId pluginId + * @param pluginInfo pluginInfo + * @param pluginVersion pluginVersion + -/* PluginPublishControllerApiService Publish a plugin binary and the plugin info metadata. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param plugin plugin - @param pluginId pluginId - @param pluginInfo pluginInfo - @param pluginVersion pluginVersion - @return */ -func (a *PluginPublishControllerApiService) PublishPluginUsingPOST(ctx context.Context, plugin *os.File, pluginId string, pluginInfo string, pluginVersion string) ( *http.Response, error) { +*/ +func (a *PluginPublishControllerApiService) PublishPluginUsingPOST(ctx context.Context, plugin *os.File, pluginId string, pluginInfo interface{}, pluginVersion string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) // create path and map variables @@ -51,9 +55,8 @@ func (a *PluginPublishControllerApiService) PublishPluginUsingPOST(ctx context.C localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "multipart/form-data", } + localVarHttpContentTypes := []string{"multipart/form-data"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -62,20 +65,19 @@ func (a *PluginPublishControllerApiService) PublishPluginUsingPOST(ctx context.C } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } + localVarHttpHeaderAccepts := []string{"*/*"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - if plugin != nil { - fbs, _ := ioutil.ReadAll(plugin) + localVarFile := plugin + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) localVarFileBytes = fbs - localVarFileName = plugin.Name() - plugin.Close() + localVarFileName = localVarFile.Name() + localVarFile.Close() } localVarFormParams.Add("pluginInfo", parameterToString(pluginInfo, "")) r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) @@ -87,12 +89,22 @@ func (a *PluginPublishControllerApiService) PublishPluginUsingPOST(ctx context.C if err != nil || localVarHttpResponse == nil { return localVarHttpResponse, err } - defer localVarHttpResponse.Body.Close() + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr } - return localVarHttpResponse, err + return localVarHttpResponse, nil } - diff --git a/gateapi/api_plugins_installed_controller.go b/gateapi/api_plugins_installed_controller.go new file mode 100644 index 00000000..cab4cbdf --- /dev/null +++ b/gateapi/api_plugins_installed_controller.go @@ -0,0 +1,123 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PluginsInstalledControllerApiService service + +/* +PluginsInstalledControllerApiService Get all installed Spinnaker plugins + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PluginsInstalledControllerApiGetInstalledPluginsUsingGETOpts - Optional Parameters: + * @param "Service" (optional.String) - service + +@return map[string][]SpinnakerPluginDescriptor +*/ + +type PluginsInstalledControllerApiGetInstalledPluginsUsingGETOpts struct { + Service optional.String +} + +func (a *PluginsInstalledControllerApiService) GetInstalledPluginsUsingGET(ctx context.Context, localVarOptionals *PluginsInstalledControllerApiGetInstalledPluginsUsingGETOpts) (map[string][]SpinnakerPluginDescriptor, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string][]SpinnakerPluginDescriptor + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/plugins/installed" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Service.IsSet() { + localVarQueryParams.Add("service", parameterToString(localVarOptionals.Service.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string][]SpinnakerPluginDescriptor + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_project_controller.go b/gateapi/api_project_controller.go new file mode 100644 index 00000000..75712edb --- /dev/null +++ b/gateapi/api_project_controller.go @@ -0,0 +1,403 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ProjectControllerApiService service + +/* +ProjectControllerApiService Get all pipelines for project + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *ProjectControllerApiAllPipelinesForProjectUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - limit + * @param "Statuses" (optional.String) - statuses + +@return []interface{} +*/ + +type ProjectControllerApiAllPipelinesForProjectUsingGETOpts struct { + Limit optional.Int32 + Statuses optional.String +} + +func (a *ProjectControllerApiService) AllPipelinesForProjectUsingGET(ctx context.Context, id string, localVarOptionals *ProjectControllerApiAllPipelinesForProjectUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/projects/{id}/pipelines" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ProjectControllerApiService Get all projects + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *ProjectControllerApiService) AllUsingGET3(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ProjectControllerApiService Get a project's clusters + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *ProjectControllerApiGetClustersUsingGET3Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return []interface{} +*/ + +type ProjectControllerApiGetClustersUsingGET3Opts struct { + XRateLimitApp optional.String +} + +func (a *ProjectControllerApiService) GetClustersUsingGET3(ctx context.Context, id string, localVarOptionals *ProjectControllerApiGetClustersUsingGET3Opts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/projects/{id}/clusters" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ProjectControllerApiService Get a project + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *ProjectControllerApiService) GetUsingGET1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/projects/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_pubsub_subscription_controller.go b/gateapi/api_pubsub_subscription_controller.go new file mode 100644 index 00000000..2900fbba --- /dev/null +++ b/gateapi/api_pubsub_subscription_controller.go @@ -0,0 +1,112 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type PubsubSubscriptionControllerApiService service + +/* +PubsubSubscriptionControllerApiService Retrieve the list of pub/sub subscriptions configured in Echo. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []Mapstringstring +*/ +func (a *PubsubSubscriptionControllerApiService) AllUsingGET4(ctx context.Context) ([]Mapstringstring, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Mapstringstring + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pubsub/subscriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Mapstringstring + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/reorder_pipelines_controller_api.go b/gateapi/api_reorder_pipelines_controller.go similarity index 50% rename from gateapi/reorder_pipelines_controller_api.go rename to gateapi/api_reorder_pipelines_controller.go index a8e4cbd9..4da9038d 100644 --- a/gateapi/reorder_pipelines_controller_api.go +++ b/gateapi/api_reorder_pipelines_controller.go @@ -1,3 +1,4 @@ + /* * Spinnaker API * @@ -10,12 +11,11 @@ package swagger import ( + "context" "io/ioutil" - "net/url" "net/http" + "net/url" "strings" - "golang.org/x/net/context" - "encoding/json" ) // Linger please @@ -25,18 +25,20 @@ var ( type ReorderPipelinesControllerApiService service +/* +ReorderPipelinesControllerApiService Re-order pipelines + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param reorderPipelinesCommand reorderPipelinesCommand -/* ReorderPipelinesControllerApiService Re-order pipelines - * @param ctx context.Context for authentication, logging, tracing, etc. - @param reorderPipelinesCommand reorderPipelinesCommand - @return interface{}*/ -func (a *ReorderPipelinesControllerApiService) ReorderPipelinesUsingPOST(ctx context.Context, reorderPipelinesCommand ReorderPipelinesCommand) (interface{}, *http.Response, error) { +@return interface{} +*/ +func (a *ReorderPipelinesControllerApiService) ReorderPipelinesUsingPOST(ctx context.Context, reorderPipelinesCommand ReorderPipelinesCommand) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} ) // create path and map variables @@ -46,9 +48,8 @@ func (a *ReorderPipelinesControllerApiService) ReorderPipelinesUsingPOST(ctx con localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -57,9 +58,7 @@ func (a *ReorderPipelinesControllerApiService) ReorderPipelinesUsingPOST(ctx con } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } + localVarHttpHeaderAccepts := []string{"*/*"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -70,24 +69,47 @@ func (a *ReorderPipelinesControllerApiService) ReorderPipelinesUsingPOST(ctx con localVarPostBody = &reorderPipelinesCommand r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { - return successPayload, nil, err + return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, err } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err } - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } } + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, nil } - diff --git a/gateapi/api_search_controller.go b/gateapi/api_search_controller.go new file mode 100644 index 00000000..d1ab87a0 --- /dev/null +++ b/gateapi/api_search_controller.go @@ -0,0 +1,150 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SearchControllerApiService service + +/* +SearchControllerApiService Search infrastructure + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param type_ type + * @param optional nil or *SearchControllerApiSearchUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "AllowShortQuery" (optional.Bool) - allowShortQuery + * @param "Page" (optional.Int32) - page + * @param "PageSize" (optional.Int32) - pageSize + * @param "Platform" (optional.String) - platform + * @param "Q" (optional.String) - q + +@return []interface{} +*/ + +type SearchControllerApiSearchUsingGETOpts struct { + XRateLimitApp optional.String + AllowShortQuery optional.Bool + Page optional.Int32 + PageSize optional.Int32 + Platform optional.String + Q optional.String +} + +func (a *SearchControllerApiService) SearchUsingGET(ctx context.Context, type_ string, localVarOptionals *SearchControllerApiSearchUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AllowShortQuery.IsSet() { + localVarQueryParams.Add("allowShortQuery", parameterToString(localVarOptionals.AllowShortQuery.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PageSize.IsSet() { + localVarQueryParams.Add("pageSize", parameterToString(localVarOptionals.PageSize.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Platform.IsSet() { + localVarQueryParams.Add("platform", parameterToString(localVarOptionals.Platform.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Q.IsSet() { + localVarQueryParams.Add("q", parameterToString(localVarOptionals.Q.Value(), "")) + } + localVarQueryParams.Add("type", parameterToString(type_, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_security_group_controller.go b/gateapi/api_security_group_controller.go new file mode 100644 index 00000000..16b36d48 --- /dev/null +++ b/gateapi/api_security_group_controller.go @@ -0,0 +1,344 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SecurityGroupControllerApiService service + +/* +SecurityGroupControllerApiService Retrieve a list of security groups for a given account, grouped by region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param optional nil or *SecurityGroupControllerApiAllByAccountUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + +@return interface{} +*/ + +type SecurityGroupControllerApiAllByAccountUsingGET1Opts struct { + XRateLimitApp optional.String + Provider optional.String +} + +func (a *SecurityGroupControllerApiService) AllByAccountUsingGET1(ctx context.Context, account string, localVarOptionals *SecurityGroupControllerApiAllByAccountUsingGET1Opts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/securityGroups/{account}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SecurityGroupControllerApiService Retrieve a list of security groups, grouped by account, cloud provider, and region + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SecurityGroupControllerApiAllUsingGET5Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Id" (optional.String) - id + +@return interface{} +*/ + +type SecurityGroupControllerApiAllUsingGET5Opts struct { + XRateLimitApp optional.String + Id optional.String +} + +func (a *SecurityGroupControllerApiService) AllUsingGET5(ctx context.Context, localVarOptionals *SecurityGroupControllerApiAllUsingGET5Opts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/securityGroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Id.IsSet() { + localVarQueryParams.Add("id", parameterToString(localVarOptionals.Id.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SecurityGroupControllerApiService Retrieve a security group's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param name name + * @param region region + * @param optional nil or *SecurityGroupControllerApiGetSecurityGroupUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "Provider" (optional.String) - provider + * @param "VpcId" (optional.String) - vpcId + +@return interface{} +*/ + +type SecurityGroupControllerApiGetSecurityGroupUsingGET1Opts struct { + XRateLimitApp optional.String + Provider optional.String + VpcId optional.String +} + +func (a *SecurityGroupControllerApiService) GetSecurityGroupUsingGET1(ctx context.Context, account string, name string, region string, localVarOptionals *SecurityGroupControllerApiGetSecurityGroupUsingGET1Opts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/securityGroups/{account}/{region}/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Provider.IsSet() { + localVarQueryParams.Add("provider", parameterToString(localVarOptionals.Provider.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.VpcId.IsSet() { + localVarQueryParams.Add("vpcId", parameterToString(localVarOptionals.VpcId.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_server_group_controller.go b/gateapi/api_server_group_controller.go new file mode 100644 index 00000000..437c077e --- /dev/null +++ b/gateapi/api_server_group_controller.go @@ -0,0 +1,250 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ServerGroupControllerApiService service + +/* +ServerGroupControllerApiService Retrieve a server group's details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param applicationName applicationName + * @param region region + * @param serverGroupName serverGroupName + * @param optional nil or *ServerGroupControllerApiGetServerGroupDetailsUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "IncludeDetails" (optional.String) - includeDetails + +@return interface{} +*/ + +type ServerGroupControllerApiGetServerGroupDetailsUsingGETOpts struct { + XRateLimitApp optional.String + IncludeDetails optional.String +} + +func (a *ServerGroupControllerApiService) GetServerGroupDetailsUsingGET(ctx context.Context, account string, applicationName string, region string, serverGroupName string, localVarOptionals *ServerGroupControllerApiGetServerGroupDetailsUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/serverGroups/{account}/{region}/{serverGroupName}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.IncludeDetails.IsSet() { + localVarQueryParams.Add("includeDetails", parameterToString(localVarOptionals.IncludeDetails.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ServerGroupControllerApiService Retrieve a list of server groups for a given application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationName applicationName + * @param optional nil or *ServerGroupControllerApiGetServerGroupsForApplicationUsingGETOpts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + * @param "CloudProvider" (optional.String) - cloudProvider + * @param "Clusters" (optional.String) - clusters + * @param "Expand" (optional.String) - expand + +@return []interface{} +*/ + +type ServerGroupControllerApiGetServerGroupsForApplicationUsingGETOpts struct { + XRateLimitApp optional.String + CloudProvider optional.String + Clusters optional.String + Expand optional.String +} + +func (a *ServerGroupControllerApiService) GetServerGroupsForApplicationUsingGET(ctx context.Context, applicationName string, localVarOptionals *ServerGroupControllerApiGetServerGroupsForApplicationUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/serverGroups" + localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.CloudProvider.IsSet() { + localVarQueryParams.Add("cloudProvider", parameterToString(localVarOptionals.CloudProvider.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Clusters.IsSet() { + localVarQueryParams.Add("clusters", parameterToString(localVarOptionals.Clusters.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/server_group_manager_controller_api.go b/gateapi/api_server_group_manager_controller.go similarity index 51% rename from gateapi/server_group_manager_controller_api.go rename to gateapi/api_server_group_manager_controller.go index d4c45374..32319078 100644 --- a/gateapi/server_group_manager_controller_api.go +++ b/gateapi/api_server_group_manager_controller.go @@ -1,3 +1,4 @@ + /* * Spinnaker API * @@ -10,12 +11,11 @@ package swagger import ( + "context" "io/ioutil" - "net/url" "net/http" + "net/url" "strings" - "golang.org/x/net/context" - "encoding/json" "fmt" ) @@ -26,18 +26,20 @@ var ( type ServerGroupManagerControllerApiService service +/* +ServerGroupManagerControllerApiService Retrieve a list of server group managers for an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application -/* ServerGroupManagerControllerApiService Retrieve a list of server group managers for an application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return []interface{}*/ -func (a *ServerGroupManagerControllerApiService) GetServerGroupManagersForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { +@return []interface{} +*/ +func (a *ServerGroupManagerControllerApiService) GetServerGroupManagersForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} ) // create path and map variables @@ -48,9 +50,8 @@ func (a *ServerGroupManagerControllerApiService) GetServerGroupManagersForApplic localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -59,9 +60,7 @@ func (a *ServerGroupManagerControllerApiService) GetServerGroupManagersForApplic } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } + localVarHttpHeaderAccepts := []string{"*/*"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -70,24 +69,47 @@ func (a *ServerGroupManagerControllerApiService) GetServerGroupManagersForApplic } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { - return successPayload, nil, err + return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, err } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err } - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } } + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } - return successPayload, localVarHttpResponse, err + return localVarReturnValue, localVarHttpResponse, nil } - diff --git a/gateapi/api_snapshot_controller.go b/gateapi/api_snapshot_controller.go new file mode 100644 index 00000000..621ffd3e --- /dev/null +++ b/gateapi/api_snapshot_controller.go @@ -0,0 +1,218 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SnapshotControllerApiService service + +/* +SnapshotControllerApiService Get current snapshot + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + +@return map[string]interface{} +*/ +func (a *SnapshotControllerApiService) GetCurrentSnapshotUsingGET(ctx context.Context, account string, application string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/snapshots/{account}" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SnapshotControllerApiService Get snapshot history + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param account account + * @param application application + * @param optional nil or *SnapshotControllerApiGetSnapshotHistoryUsingGETOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - limit + +@return []interface{} +*/ + +type SnapshotControllerApiGetSnapshotHistoryUsingGETOpts struct { + Limit optional.Int32 +} + +func (a *SnapshotControllerApiService) GetSnapshotHistoryUsingGET(ctx context.Context, account string, application string, localVarOptionals *SnapshotControllerApiGetSnapshotHistoryUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application}/snapshots/{account}/history" + localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_subnet_controller.go b/gateapi/api_subnet_controller.go new file mode 100644 index 00000000..3a4dc464 --- /dev/null +++ b/gateapi/api_subnet_controller.go @@ -0,0 +1,115 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type SubnetControllerApiService service + +/* +SubnetControllerApiService Retrieve a list of subnets for a given cloud provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param cloudProvider cloudProvider + +@return []interface{} +*/ +func (a *SubnetControllerApiService) AllByCloudProviderUsingGET1(ctx context.Context, cloudProvider string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/subnets/{cloudProvider}" + localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_task_controller.go b/gateapi/api_task_controller.go new file mode 100644 index 00000000..0aeb6a5b --- /dev/null +++ b/gateapi/api_task_controller.go @@ -0,0 +1,569 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type TaskControllerApiService service + +/* +TaskControllerApiService Cancel task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *TaskControllerApiService) CancelTaskUsingPUT1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +TaskControllerApiService Cancel tasks + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ids ids + +@return map[string]interface{} +*/ +func (a *TaskControllerApiService) CancelTasksUsingPUT(ctx context.Context, ids []string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks/cancel" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("ids", parameterToString(ids, "multi")) + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +TaskControllerApiService Delete task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *TaskControllerApiService) DeleteTaskUsingDELETE(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +TaskControllerApiService Get task details + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param taskDetailsId taskDetailsId + * @param optional nil or *TaskControllerApiGetTaskDetailsUsingGET1Opts - Optional Parameters: + * @param "XRateLimitApp" (optional.String) - X-RateLimit-App + +@return map[string]interface{} +*/ + +type TaskControllerApiGetTaskDetailsUsingGET1Opts struct { + XRateLimitApp optional.String +} + +func (a *TaskControllerApiService) GetTaskDetailsUsingGET1(ctx context.Context, id string, taskDetailsId string, localVarOptionals *TaskControllerApiGetTaskDetailsUsingGET1Opts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks/{id}/details/{taskDetailsId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"taskDetailsId"+"}", fmt.Sprintf("%v", taskDetailsId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XRateLimitApp.IsSet() { + localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarOptionals.XRateLimitApp.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +TaskControllerApiService Get task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return map[string]interface{} +*/ +func (a *TaskControllerApiService) GetTaskUsingGET1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +TaskControllerApiService Create task + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param map_ map + +@return map[string]interface{} +*/ +func (a *TaskControllerApiService) TaskUsingPOST1(ctx context.Context, map_ interface{}) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/tasks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &map_ + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_v2_canary_config_controller.go b/gateapi/api_v2_canary_config_controller.go new file mode 100644 index 00000000..abebae89 --- /dev/null +++ b/gateapi/api_v2_canary_config_controller.go @@ -0,0 +1,507 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type V2CanaryConfigControllerApiService service + +/* +V2CanaryConfigControllerApiService Create a canary configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param config config + * @param optional nil or *V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts - Optional Parameters: + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + +@return interface{} +*/ + +type V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts struct { + ConfigurationAccountName optional.String +} + +func (a *V2CanaryConfigControllerApiService) CreateCanaryConfigUsingPOST(ctx context.Context, config interface{}, localVarOptionals *V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &config + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryConfigControllerApiService Delete a canary configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts - Optional Parameters: + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + + +*/ + +type V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts struct { + ConfigurationAccountName optional.String +} + +func (a *V2CanaryConfigControllerApiService) DeleteCanaryConfigUsingDELETE(ctx context.Context, id string, localVarOptionals *V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +V2CanaryConfigControllerApiService Retrieve a canary configuration by id + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts - Optional Parameters: + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + +@return interface{} +*/ + +type V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts struct { + ConfigurationAccountName optional.String +} + +func (a *V2CanaryConfigControllerApiService) GetCanaryConfigUsingGET(ctx context.Context, id string, localVarOptionals *V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryConfigControllerApiService Retrieve a list of canary configurations + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts - Optional Parameters: + * @param "Application" (optional.String) - application + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + +@return []interface{} +*/ + +type V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts struct { + Application optional.String + ConfigurationAccountName optional.String +} + +func (a *V2CanaryConfigControllerApiService) GetCanaryConfigsUsingGET(ctx context.Context, localVarOptionals *V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryConfigControllerApiService Update a canary configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param config config + * @param id id + * @param optional nil or *V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts - Optional Parameters: + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + +@return interface{} +*/ + +type V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts struct { + ConfigurationAccountName optional.String +} + +func (a *V2CanaryConfigControllerApiService) UpdateCanaryConfigUsingPUT(ctx context.Context, config interface{}, id string, localVarOptionals *V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &config + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_v2_canary_controller.go b/gateapi/api_v2_canary_controller.go new file mode 100644 index 00000000..01ff29bb --- /dev/null +++ b/gateapi/api_v2_canary_controller.go @@ -0,0 +1,937 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type V2CanaryControllerApiService service + +/* +V2CanaryControllerApiService (DEPRECATED) Retrieve a canary result + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param canaryConfigId canaryConfigId + * @param canaryExecutionId canaryExecutionId + * @param optional nil or *V2CanaryControllerApiGetCanaryResultUsingGETOpts - Optional Parameters: + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return interface{} +*/ + +type V2CanaryControllerApiGetCanaryResultUsingGETOpts struct { + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) GetCanaryResultUsingGET(ctx context.Context, canaryConfigId string, canaryExecutionId string, localVarOptionals *V2CanaryControllerApiGetCanaryResultUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryConfigId}/{canaryExecutionId}" + localVarPath = strings.Replace(localVarPath, "{"+"canaryConfigId"+"}", fmt.Sprintf("%v", canaryConfigId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"canaryExecutionId"+"}", fmt.Sprintf("%v", canaryExecutionId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a canary result + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param canaryExecutionId canaryExecutionId + * @param optional nil or *V2CanaryControllerApiGetCanaryResultUsingGET1Opts - Optional Parameters: + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return interface{} +*/ + +type V2CanaryControllerApiGetCanaryResultUsingGET1Opts struct { + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) GetCanaryResultUsingGET1(ctx context.Context, canaryExecutionId string, localVarOptionals *V2CanaryControllerApiGetCanaryResultUsingGET1Opts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryExecutionId}" + localVarPath = strings.Replace(localVarPath, "{"+"canaryExecutionId"+"}", fmt.Sprintf("%v", canaryExecutionId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a list of an application's canary results + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param application application + * @param limit limit + * @param optional nil or *V2CanaryControllerApiGetCanaryResultsByApplicationUsingGETOpts - Optional Parameters: + * @param "Statuses" (optional.String) - Comma-separated list of statuses, e.g.: RUNNING, SUCCEEDED, TERMINAL + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return []interface{} +*/ + +type V2CanaryControllerApiGetCanaryResultsByApplicationUsingGETOpts struct { + Statuses optional.String + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) GetCanaryResultsByApplicationUsingGET(ctx context.Context, application string, limit int32, localVarOptionals *V2CanaryControllerApiGetCanaryResultsByApplicationUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/{application}/executions" + localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("limit", parameterToString(limit, "")) + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a metric set pair list + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param metricSetPairListId metricSetPairListId + * @param optional nil or *V2CanaryControllerApiGetMetricSetPairListUsingGETOpts - Optional Parameters: + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return []interface{} +*/ + +type V2CanaryControllerApiGetMetricSetPairListUsingGETOpts struct { + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) GetMetricSetPairListUsingGET(ctx context.Context, metricSetPairListId string, localVarOptionals *V2CanaryControllerApiGetMetricSetPairListUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/metricSetPairList/{metricSetPairListId}" + localVarPath = strings.Replace(localVarPath, "{"+"metricSetPairListId"+"}", fmt.Sprintf("%v", metricSetPairListId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Start a canary execution + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param canaryConfigId canaryConfigId + * @param executionRequest executionRequest + * @param optional nil or *V2CanaryControllerApiInitiateCanaryUsingPOSTOpts - Optional Parameters: + * @param "Application" (optional.String) - application + * @param "ConfigurationAccountName" (optional.String) - configurationAccountName + * @param "MetricsAccountName" (optional.String) - metricsAccountName + * @param "ParentPipelineExecutionId" (optional.String) - parentPipelineExecutionId + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return interface{} +*/ + +type V2CanaryControllerApiInitiateCanaryUsingPOSTOpts struct { + Application optional.String + ConfigurationAccountName optional.String + MetricsAccountName optional.String + ParentPipelineExecutionId optional.String + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) InitiateCanaryUsingPOST(ctx context.Context, canaryConfigId string, executionRequest interface{}, localVarOptionals *V2CanaryControllerApiInitiateCanaryUsingPOSTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryConfigId}" + localVarPath = strings.Replace(localVarPath, "{"+"canaryConfigId"+"}", fmt.Sprintf("%v", canaryConfigId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ConfigurationAccountName.IsSet() { + localVarQueryParams.Add("configurationAccountName", parameterToString(localVarOptionals.ConfigurationAccountName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MetricsAccountName.IsSet() { + localVarQueryParams.Add("metricsAccountName", parameterToString(localVarOptionals.MetricsAccountName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ParentPipelineExecutionId.IsSet() { + localVarQueryParams.Add("parentPipelineExecutionId", parameterToString(localVarOptionals.ParentPipelineExecutionId.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &executionRequest + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Start a canary execution with the supplied canary config + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param adhocExecutionRequest adhocExecutionRequest + * @param optional nil or *V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts - Optional Parameters: + * @param "Application" (optional.String) - application + * @param "MetricsAccountName" (optional.String) - metricsAccountName + * @param "ParentPipelineExecutionId" (optional.String) - parentPipelineExecutionId + * @param "StorageAccountName" (optional.String) - storageAccountName + +@return interface{} +*/ + +type V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts struct { + Application optional.String + MetricsAccountName optional.String + ParentPipelineExecutionId optional.String + StorageAccountName optional.String +} + +func (a *V2CanaryControllerApiService) InitiateCanaryWithConfigUsingPOST(ctx context.Context, adhocExecutionRequest interface{}, localVarOptionals *V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MetricsAccountName.IsSet() { + localVarQueryParams.Add("metricsAccountName", parameterToString(localVarOptionals.MetricsAccountName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ParentPipelineExecutionId.IsSet() { + localVarQueryParams.Add("parentPipelineExecutionId", parameterToString(localVarOptionals.ParentPipelineExecutionId.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StorageAccountName.IsSet() { + localVarQueryParams.Add("storageAccountName", parameterToString(localVarOptionals.StorageAccountName.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &adhocExecutionRequest + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a list of configured Kayenta accounts + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *V2CanaryControllerApiService) ListCredentialsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/credentials" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a list of all configured canary judges + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *V2CanaryControllerApiService) ListJudgesUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/judges" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2CanaryControllerApiService Retrieve a list of descriptors for use in populating the canary config ui + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *V2CanaryControllerApiListMetricsServiceMetadataUsingGETOpts - Optional Parameters: + * @param "Filter" (optional.String) - filter + * @param "MetricsAccountName" (optional.String) - metricsAccountName + +@return []interface{} +*/ + +type V2CanaryControllerApiListMetricsServiceMetadataUsingGETOpts struct { + Filter optional.String + MetricsAccountName optional.String +} + +func (a *V2CanaryControllerApiService) ListMetricsServiceMetadataUsingGET(ctx context.Context, localVarOptionals *V2CanaryControllerApiListMetricsServiceMetadataUsingGETOpts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/canaries/metadata/metricsService" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MetricsAccountName.IsSet() { + localVarQueryParams.Add("metricsAccountName", parameterToString(localVarOptionals.MetricsAccountName.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_v2_pipeline_templates_controller.go b/gateapi/api_v2_pipeline_templates_controller.go new file mode 100644 index 00000000..eb50fe5a --- /dev/null +++ b/gateapi/api_v2_pipeline_templates_controller.go @@ -0,0 +1,799 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type V2PipelineTemplatesControllerApiService service + +/* +V2PipelineTemplatesControllerApiService (ALPHA) Create a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipelineTemplate pipelineTemplate + * @param optional nil or *V2PipelineTemplatesControllerApiCreateUsingPOST1Opts - Optional Parameters: + * @param "Tag" (optional.String) - tag + + +*/ + +type V2PipelineTemplatesControllerApiCreateUsingPOST1Opts struct { + Tag optional.String +} + +func (a *V2PipelineTemplatesControllerApiService) CreateUsingPOST1(ctx context.Context, pipelineTemplate interface{}, localVarOptionals *V2PipelineTemplatesControllerApiCreateUsingPOST1Opts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/create" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Tag.IsSet() { + localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipelineTemplate + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService Delete a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts - Optional Parameters: + * @param "Application" (optional.String) - application + * @param "Digest" (optional.String) - digest + * @param "Tag" (optional.String) - tag + +@return map[string]interface{} +*/ + +type V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts struct { + Application optional.String + Digest optional.String + Tag optional.String +} + +func (a *V2PipelineTemplatesControllerApiService) DeleteUsingDELETE1(ctx context.Context, id string, localVarOptionals *V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Application.IsSet() { + localVarQueryParams.Add("application", parameterToString(localVarOptionals.Application.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Digest.IsSet() { + localVarQueryParams.Add("digest", parameterToString(localVarOptionals.Digest.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Tag.IsSet() { + localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService (ALPHA) Get a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param optional nil or *V2PipelineTemplatesControllerApiGetUsingGET2Opts - Optional Parameters: + * @param "Digest" (optional.String) - digest + * @param "Tag" (optional.String) - tag + +@return map[string]interface{} +*/ + +type V2PipelineTemplatesControllerApiGetUsingGET2Opts struct { + Digest optional.String + Tag optional.String +} + +func (a *V2PipelineTemplatesControllerApiService) GetUsingGET2(ctx context.Context, id string, localVarOptionals *V2PipelineTemplatesControllerApiGetUsingGET2Opts) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Digest.IsSet() { + localVarQueryParams.Add("digest", parameterToString(localVarOptionals.Digest.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Tag.IsSet() { + localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService (ALPHA) List all pipelines that implement a pipeline template + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + +@return []interface{} +*/ +func (a *V2PipelineTemplatesControllerApiService) ListPipelineTemplateDependentsUsingGET1(ctx context.Context, id string) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}/dependents" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService (ALPHA) List pipeline templates. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *V2PipelineTemplatesControllerApiListUsingGET1Opts - Optional Parameters: + * @param "Scopes" (optional.Interface of []string) - scopes + +@return []interface{} +*/ + +type V2PipelineTemplatesControllerApiListUsingGET1Opts struct { + Scopes optional.Interface +} + +func (a *V2PipelineTemplatesControllerApiService) ListUsingGET1(ctx context.Context, localVarOptionals *V2PipelineTemplatesControllerApiListUsingGET1Opts) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Scopes.IsSet() { + localVarQueryParams.Add("scopes", parameterToString(localVarOptionals.Scopes.Value(), "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService List pipeline templates with versions + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *V2PipelineTemplatesControllerApiListVersionsUsingGETOpts - Optional Parameters: + * @param "Scopes" (optional.Interface of []string) - scopes + +@return interface{} +*/ + +type V2PipelineTemplatesControllerApiListVersionsUsingGETOpts struct { + Scopes optional.Interface +} + +func (a *V2PipelineTemplatesControllerApiService) ListVersionsUsingGET(ctx context.Context, localVarOptionals *V2PipelineTemplatesControllerApiListVersionsUsingGETOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/versions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Scopes.IsSet() { + localVarQueryParams.Add("scopes", parameterToString(localVarOptionals.Scopes.Value(), "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService (ALPHA) Plan a pipeline template configuration. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipeline pipeline + +@return map[string]interface{} +*/ +func (a *V2PipelineTemplatesControllerApiService) PlanUsingPOST(ctx context.Context, pipeline interface{}) (map[string]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/plan" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipeline + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v map[string]interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +V2PipelineTemplatesControllerApiService (ALPHA) Update a pipeline template. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id id + * @param pipelineTemplate pipelineTemplate + * @param optional nil or *V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts - Optional Parameters: + * @param "SkipPlanDependents" (optional.Bool) - skipPlanDependents + * @param "Tag" (optional.String) - tag + + +*/ + +type V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts struct { + SkipPlanDependents optional.Bool + Tag optional.String +} + +func (a *V2PipelineTemplatesControllerApiService) UpdateUsingPOST1(ctx context.Context, id string, pipelineTemplate interface{}, localVarOptionals *V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/update/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.SkipPlanDependents.IsSet() { + localVarQueryParams.Add("skipPlanDependents", parameterToString(localVarOptionals.SkipPlanDependents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Tag.IsSet() { + localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), "")) + } + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pipelineTemplate + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 202 { + var v map[string]interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/gateapi/api_version_controller.go b/gateapi/api_version_controller.go new file mode 100644 index 00000000..ff6424f6 --- /dev/null +++ b/gateapi/api_version_controller.go @@ -0,0 +1,112 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type VersionControllerApiService service + +/* +VersionControllerApiService Fetch Gate's current version + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return Version +*/ +func (a *VersionControllerApiService) GetVersionUsingGET(ctx context.Context) (Version, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Version + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Version + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/api_webhook_controller.go b/gateapi/api_webhook_controller.go new file mode 100644 index 00000000..43dd9c2f --- /dev/null +++ b/gateapi/api_webhook_controller.go @@ -0,0 +1,230 @@ + +/* + * Spinnaker API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type WebhookControllerApiService service + +/* +WebhookControllerApiService Retrieve a list of preconfigured webhooks in Orca + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return []interface{} +*/ +func (a *WebhookControllerApiService) PreconfiguredWebhooksUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/webhooks/preconfigured" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +WebhookControllerApiService Endpoint for posting webhooks to Spinnaker's webhook service + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param source source + * @param type_ type + * @param optional nil or *WebhookControllerApiWebhooksUsingPOSTOpts - Optional Parameters: + * @param "XEventKey" (optional.String) - X-Event-Key + * @param "XHubSignature" (optional.String) - X-Hub-Signature + * @param "Event" (optional.Interface of interface{}) - event + +@return interface{} +*/ + +type WebhookControllerApiWebhooksUsingPOSTOpts struct { + XEventKey optional.String + XHubSignature optional.String + Event optional.Interface +} + +func (a *WebhookControllerApiService) WebhooksUsingPOST(ctx context.Context, source string, type_ string, localVarOptionals *WebhookControllerApiWebhooksUsingPOSTOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/webhooks/{type}/{source}" + localVarPath = strings.Replace(localVarPath, "{"+"source"+"}", fmt.Sprintf("%v", source), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XEventKey.IsSet() { + localVarHeaderParams["X-Event-Key"] = parameterToString(localVarOptionals.XEventKey.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XHubSignature.IsSet() { + localVarHeaderParams["X-Hub-Signature"] = parameterToString(localVarOptionals.XHubSignature.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Event.IsSet() { + + localVarOptionalEvent, localVarOptionalEventok := localVarOptionals.Event.Value().(interface{}) + if !localVarOptionalEventok { + return localVarReturnValue, nil, reportError("event should be interface{}") + } + localVarPostBody = &localVarOptionalEvent + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + 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 + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/gateapi/application_controller_api.go b/gateapi/application_controller_api.go deleted file mode 100644 index 5b02188e..00000000 --- a/gateapi/application_controller_api.go +++ /dev/null @@ -1,1102 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ApplicationControllerApiService service - - -/* ApplicationControllerApiService Cancel pipeline - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "reason" (string) reason - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) CancelPipelineUsingPUT(ctx context.Context, id string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelines/{id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["reason"], "string", "reason"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["reason"].(string); localVarOk { - localVarQueryParams.Add("reason", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Cancel task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) CancelTaskUsingPUT(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of applications - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "account" (string) filters results to only include applications deployed in the specified account - @param "owner" (string) filters results to only include applications owned by the specified email - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetAllApplicationsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["account"], "string", "account"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["owner"], "string", "owner"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["account"].(string); localVarOk { - localVarQueryParams.Add("account", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["owner"].(string); localVarOk { - localVarQueryParams.Add("owner", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of an application's configuration revision history - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) limit - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetApplicationHistoryUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/history" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve an application's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "expand" (bool) expand - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) GetApplicationUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["expand"], "bool", "expand"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["expand"].(bool); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a pipeline configuration - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pipelineName pipelineName - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) GetPipelineConfigUsingGET(ctx context.Context, application string, pipelineName string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs/{pipelineName}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of an application's pipeline configurations - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetPipelineConfigsForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of an application's pipeline executions - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "expand" (bool) expand - @param "limit" (int32) limit - @param "statuses" (string) statuses - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetPipelinesUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelines" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["expand"], "bool", "expand"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["expand"].(bool); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a pipeline strategy configuration - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param strategyName strategyName - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) GetStrategyConfigUsingGET(ctx context.Context, application string, strategyName string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/strategyConfigs/{strategyName}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"strategyName"+"}", fmt.Sprintf("%v", strategyName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of an application's pipeline strategy configurations - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetStrategyConfigsForApplicationUsingGET(ctx context.Context, application string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/strategyConfigs" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Get task details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param taskDetailsId taskDetailsId - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) GetTaskDetailsUsingGET(ctx context.Context, id string, taskDetailsId string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}/details/{taskDetailsId}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"taskDetailsId"+"}", fmt.Sprintf("%v", taskDetailsId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Get task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) GetTaskUsingGET(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Retrieve a list of an application's tasks - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) limit - @param "page" (int32) page - @param "statuses" (string) statuses - @return []interface{}*/ -func (a *ApplicationControllerApiService) GetTasksUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["page"], "int32", "page"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["page"].(int32); localVarOk { - localVarQueryParams.Add("page", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Invoke pipeline config - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pipelineName pipelineName - @param optional (nil or map[string]interface{}) with one or more of: - @param "trigger" (interface{}) trigger - @param "user" (string) user - @return HttpEntity*/ -func (a *ApplicationControllerApiService) InvokePipelineConfigUsingPOST(ctx context.Context, application string, pipelineName string, localVarOptionals map[string]interface{}) (HttpEntity, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload HttpEntity - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/pipelineConfigs/{pipelineName}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["user"], "string", "user"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["user"].(string); localVarOk { - localVarQueryParams.Add("user", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["trigger"].(interface{}); localVarOk { - localVarPostBody = &localVarTempParam - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationControllerApiService Create task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param map_ map - @return map[string]interface{}*/ -func (a *ApplicationControllerApiService) TaskUsingPOST(ctx context.Context, application string, map_ interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/tasks" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &map_ - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/artifact_controller_api.go b/gateapi/artifact_controller_api.go deleted file mode 100644 index be170e35..00000000 --- a/gateapi/artifact_controller_api.go +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ArtifactControllerApiService service - - -/* ArtifactControllerApiService Retrieve the list of artifact accounts configured in Clouddriver. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ArtifactControllerApiService) AllUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/artifacts/credentials" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ArtifactControllerApiService Retrieve the list of artifact versions by account and artifact names - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountName accountName - @param artifactName artifactName - @param type_ type - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []string*/ -func (a *ArtifactControllerApiService) ArtifactVersionsUsingGET(ctx context.Context, accountName string, artifactName string, type_ string, localVarOptionals map[string]interface{}) ([]string, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/artifacts/account/{accountName}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"accountName"+"}", fmt.Sprintf("%v", accountName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("artifactName", parameterToString(artifactName, "")) - localVarQueryParams.Add("type", parameterToString(type_, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ArtifactControllerApiService Retrieve the specified artifact version for an artifact provider and package name - * @param ctx context.Context for authentication, logging, tracing, etc. - @param packageName packageName - @param provider provider - @param version version - @return interface{}*/ -func (a *ArtifactControllerApiService) GetArtifactUsingGET(ctx context.Context, packageName string, provider string, version string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/artifacts/{provider}/{packageName}/{version}" - localVarPath = strings.Replace(localVarPath, "{"+"packageName"+"}", fmt.Sprintf("%v", packageName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", fmt.Sprintf("%v", provider), -1) - localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", fmt.Sprintf("%v", version), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/auth_controller_api.go b/gateapi/auth_controller_api.go deleted file mode 100644 index 47425977..00000000 --- a/gateapi/auth_controller_api.go +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type AuthControllerApiService service - - -/* AuthControllerApiService Get service accounts - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @return []interface{}*/ -func (a *AuthControllerApiService) GetServiceAccountsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/auth/user/serviceAccounts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AuthControllerApiService Get logged out message - * @param ctx context.Context for authentication, logging, tracing, etc. - @return string*/ -func (a *AuthControllerApiService) LoggedOutUsingGET(ctx context.Context) (string, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/auth/loggedOut" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AuthControllerApiService Redirect to Deck - * @param ctx context.Context for authentication, logging, tracing, etc. - @param to to - @return */ -func (a *AuthControllerApiService) RedirectUsingGET(ctx context.Context, to string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/auth/redirect" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("to", parameterToString(to, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* AuthControllerApiService Sync user roles - * @param ctx context.Context for authentication, logging, tracing, etc. - @return */ -func (a *AuthControllerApiService) SyncUsingPOST(ctx context.Context) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/auth/roles/sync" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* AuthControllerApiService Get user - * @param ctx context.Context for authentication, logging, tracing, etc. - @return User*/ -func (a *AuthControllerApiService) UserUsingGET(ctx context.Context) (User, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload User - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/auth/user" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/bake_controller_api.go b/gateapi/bake_controller_api.go deleted file mode 100644 index 905239ab..00000000 --- a/gateapi/bake_controller_api.go +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type BakeControllerApiService service - - -/* BakeControllerApiService Retrieve a list of available bakery base images for a given cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param cloudProvider cloudProvider - @return interface{}*/ -func (a *BakeControllerApiService) BakeOptionsUsingGET(ctx context.Context, cloudProvider string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bakery/options/{cloudProvider}" - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BakeControllerApiService Retrieve a list of available bakery base images, grouped by cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @return interface{}*/ -func (a *BakeControllerApiService) BakeOptionsUsingGET1(ctx context.Context) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bakery/options" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BakeControllerApiService Retrieve the logs for a given bake - * @param ctx context.Context for authentication, logging, tracing, etc. - @param region region - @param statusId statusId - @return interface{}*/ -func (a *BakeControllerApiService) LookupLogsUsingGET(ctx context.Context, region string, statusId string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bakery/logs/{region}/{statusId}" - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - localVarPath = strings.Replace(localVarPath, "{"+"statusId"+"}", fmt.Sprintf("%v", statusId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/build_controller_api.go b/gateapi/build_controller_api.go deleted file mode 100644 index 71115881..00000000 --- a/gateapi/build_controller_api.go +++ /dev/null @@ -1,696 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type BuildControllerApiService service - - -/* BuildControllerApiService Get build masters - Deprecated, use the v3 endpoint instead - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "type_" (string) type - @return []interface{}*/ -func (a *BuildControllerApiService) GetBuildMastersUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/builds" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["type_"], "string", "type_"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["type_"].(string); localVarOk { - localVarQueryParams.Add("type", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get build for build master - Deprecated, use the v3 endpoint instead - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param number number - @return map[string]interface{}*/ -func (a *BuildControllerApiService) GetBuildUsingGET(ctx context.Context, buildMaster string, number string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/build/{number}/**" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get builds for build master - Deprecated, use the v3 endpoint instead - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @return []interface{}*/ -func (a *BuildControllerApiService) GetBuildsUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/builds/**" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get job config - Deprecated, use the v3 endpoint instead - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @return map[string]interface{}*/ -func (a *BuildControllerApiService) GetJobConfigUsingGET(ctx context.Context, buildMaster string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/jobs/**" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get jobs for build master - Deprecated, use the v3 endpoint instead - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @return []interface{}*/ -func (a *BuildControllerApiService) GetJobsForBuildMasterUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/builds/{buildMaster}/jobs" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get build masters - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "type_" (string) type - @return []interface{}*/ -func (a *BuildControllerApiService) V3GetBuildMastersUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v3/builds" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["type_"], "string", "type_"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["type_"].(string); localVarOk { - localVarQueryParams.Add("type", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get build for build master - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param job job - @param number number - @return map[string]interface{}*/ -func (a *BuildControllerApiService) V3GetBuildUsingGET(ctx context.Context, buildMaster string, job string, number string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/build/{number}" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("job", parameterToString(job, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get builds for build master - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param job job - @return []interface{}*/ -func (a *BuildControllerApiService) V3GetBuildsUsingGET(ctx context.Context, buildMaster string, job string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/builds" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("job", parameterToString(job, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get job config - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param job job - @return map[string]interface{}*/ -func (a *BuildControllerApiService) V3GetJobConfigUsingGET(ctx context.Context, buildMaster string, job string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/job" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("job", parameterToString(job, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BuildControllerApiService Get jobs for build master - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @return []interface{}*/ -func (a *BuildControllerApiService) V3GetJobsForBuildMasterUsingGET(ctx context.Context, buildMaster string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v3/builds/{buildMaster}/jobs" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/ci_controller_api.go b/gateapi/ci_controller_api.go deleted file mode 100644 index 305eef93..00000000 --- a/gateapi/ci_controller_api.go +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type CiControllerApiService service - - -/* CiControllerApiService getBuilds - * @param ctx context.Context for authentication, logging, tracing, etc. - @param projectKey projectKey - @param repoSlug repoSlug - @param optional (nil or map[string]interface{}) with one or more of: - @param "completionStatus" (string) completionStatus - @return []interface{}*/ -func (a *CiControllerApiService) GetBuildsUsingGET1(ctx context.Context, projectKey string, repoSlug string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ci/builds" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["completionStatus"], "string", "completionStatus"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["completionStatus"].(string); localVarOk { - localVarQueryParams.Add("completionStatus", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("projectKey", parameterToString(projectKey, "")) - localVarQueryParams.Add("repoSlug", parameterToString(repoSlug, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/api_client.go b/gateapi/client.go similarity index 73% rename from gateapi/api_client.go rename to gateapi/client.go index 4942f5f5..e83296c2 100644 --- a/gateapi/api_client.go +++ b/gateapi/client.go @@ -11,79 +11,121 @@ package swagger import ( "bytes" + "context" "encoding/json" "encoding/xml" - "fmt" "errors" + "fmt" "io" "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" "net/http" "net/url" - "time" "os" "path/filepath" "reflect" "regexp" + "strconv" "strings" + "time" "unicode/utf8" - "strconv" + + "golang.org/x/oauth2" ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the Spinnaker API API v1.0.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - AmazonInfrastructureControllerApi *AmazonInfrastructureControllerApiService - ApplicationControllerApi *ApplicationControllerApiService - ArtifactControllerApi *ArtifactControllerApiService - AuthControllerApi *AuthControllerApiService - BakeControllerApi *BakeControllerApiService - BuildControllerApi *BuildControllerApiService - CiControllerApi *CiControllerApiService - ClusterControllerApi *ClusterControllerApiService - ConcourseControllerApi *ConcourseControllerApiService - CredentialsControllerApi *CredentialsControllerApiService - DeckPluginsControllerApi *DeckPluginsControllerApiService - EcsServerGroupEventsControllerApi *EcsServerGroupEventsControllerApiService - ExecutionsControllerApi *ExecutionsControllerApiService - FirewallControllerApi *FirewallControllerApiService - ImageControllerApi *ImageControllerApiService - InstanceControllerApi *InstanceControllerApiService - JobControllerApi *JobControllerApiService - LoadBalancerControllerApi *LoadBalancerControllerApiService - ManagedControllerApi *ManagedControllerApiService - NetworkControllerApi *NetworkControllerApiService - PipelineConfigControllerApi *PipelineConfigControllerApiService - PipelineControllerApi *PipelineControllerApiService - PipelineTemplatesControllerApi *PipelineTemplatesControllerApiService - PluginInfoControllerApi *PluginInfoControllerApiService - PluginPublishControllerApi *PluginPublishControllerApiService - PluginsInstalledControllerApi *PluginsInstalledControllerApiService - ProjectControllerApi *ProjectControllerApiService - PubsubSubscriptionControllerApi *PubsubSubscriptionControllerApiService - ReorderPipelinesControllerApi *ReorderPipelinesControllerApiService - SearchControllerApi *SearchControllerApiService - SecurityGroupControllerApi *SecurityGroupControllerApiService - ServerGroupControllerApi *ServerGroupControllerApiService - ServerGroupManagerControllerApi *ServerGroupManagerControllerApiService - SnapshotControllerApi *SnapshotControllerApiService - SubnetControllerApi *SubnetControllerApiService - TaskControllerApi *TaskControllerApiService - V2CanaryConfigControllerApi *V2CanaryConfigControllerApiService - V2CanaryControllerApi *V2CanaryControllerApiService - V2PipelineTemplatesControllerApi *V2PipelineTemplatesControllerApiService - VersionControllerApi *VersionControllerApiService - WebhookControllerApi *WebhookControllerApiService + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AmazonInfrastructureControllerApi *AmazonInfrastructureControllerApiService + + ApplicationControllerApi *ApplicationControllerApiService + + ArtifactControllerApi *ArtifactControllerApiService + + AuthControllerApi *AuthControllerApiService + + BakeControllerApi *BakeControllerApiService + + BuildControllerApi *BuildControllerApiService + + CiControllerApi *CiControllerApiService + + ClusterControllerApi *ClusterControllerApiService + + ConcourseControllerApi *ConcourseControllerApiService + + CredentialsControllerApi *CredentialsControllerApiService + + DeckPluginsControllerApi *DeckPluginsControllerApiService + + EcsServerGroupEventsControllerApi *EcsServerGroupEventsControllerApiService + + ExecutionsControllerApi *ExecutionsControllerApiService + + FirewallControllerApi *FirewallControllerApiService + + ImageControllerApi *ImageControllerApiService + + InstanceControllerApi *InstanceControllerApiService + + JobControllerApi *JobControllerApiService + + LoadBalancerControllerApi *LoadBalancerControllerApiService + + ManagedControllerApi *ManagedControllerApiService + + NetworkControllerApi *NetworkControllerApiService + + PipelineConfigControllerApi *PipelineConfigControllerApiService + + PipelineControllerApi *PipelineControllerApiService + + PipelineTemplatesControllerApi *PipelineTemplatesControllerApiService + + PluginInfoControllerApi *PluginInfoControllerApiService + + PluginPublishControllerApi *PluginPublishControllerApiService + + PluginsInstalledControllerApi *PluginsInstalledControllerApiService + + ProjectControllerApi *ProjectControllerApiService + + PubsubSubscriptionControllerApi *PubsubSubscriptionControllerApiService + + ReorderPipelinesControllerApi *ReorderPipelinesControllerApiService + + SearchControllerApi *SearchControllerApiService + + SecurityGroupControllerApi *SecurityGroupControllerApiService + + ServerGroupControllerApi *ServerGroupControllerApiService + + ServerGroupManagerControllerApi *ServerGroupManagerControllerApiService + + SnapshotControllerApi *SnapshotControllerApiService + + SubnetControllerApi *SubnetControllerApiService + + TaskControllerApi *TaskControllerApiService + + V2CanaryConfigControllerApi *V2CanaryConfigControllerApiService + + V2CanaryControllerApi *V2CanaryControllerApiService + + V2PipelineTemplatesControllerApi *V2PipelineTemplatesControllerApiService + + VersionControllerApi *VersionControllerApiService + + WebhookControllerApi *WebhookControllerApiService } type service struct { @@ -151,7 +193,6 @@ 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 { @@ -222,18 +263,18 @@ func parameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } -// callAPI do the request. +// callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) + return c.cfg.HTTPClient.Do(request) } // Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { +func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } // prepareRequest build the request -func (c *APIClient) prepareRequest ( +func (c *APIClient) prepareRequest( ctx context.Context, path string, method string, postBody interface{}, @@ -242,6 +283,7 @@ func (c *APIClient) prepareRequest ( formParams url.Values, fileName string, fileBytes []byte) (localVarRequest *http.Request, err error) { + var body *bytes.Buffer // Detect postBody type and post. @@ -259,7 +301,7 @@ func (c *APIClient) prepareRequest ( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + 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.") } @@ -292,12 +334,22 @@ func (c *APIClient) prepareRequest ( // 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 { @@ -338,10 +390,9 @@ func (c *APIClient) prepareRequest ( if c.cfg.Host != "" { localVarRequest.Host = c.cfg.Host } - + // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - if ctx != nil { // add context to the request @@ -367,17 +418,31 @@ func (c *APIClient) prepareRequest ( // AccessToken Authentication if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) + 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 strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + 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 { @@ -397,7 +462,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error { } // Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { +func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } @@ -413,6 +478,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e _, 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) { @@ -434,7 +501,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e 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" @@ -451,7 +518,6 @@ func detectContentType(body interface{}) string { return contentType } - // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string @@ -474,7 +540,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { +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")) @@ -482,7 +548,7 @@ func CacheExpires(r *http.Response) (time.Time) { return time.Now() } respCacheControl := parseCacheControl(r.Header) - + if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { @@ -501,7 +567,28 @@ func CacheExpires(r *http.Response) (time.Time) { return expires } -func strlen(s string) (int) { +func strlen(s string) int { return utf8.RuneCountInString(s) } +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/gateapi/cluster_controller_api.go b/gateapi/cluster_controller_api.go deleted file mode 100644 index 9f74ef55..00000000 --- a/gateapi/cluster_controller_api.go +++ /dev/null @@ -1,672 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ClusterControllerApiService service - - -/* ClusterControllerApiService Retrieve a cluster's loadbalancers - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param applicationName applicationName - @param clusterName clusterName - @param type_ type - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ClusterControllerApiService) GetClusterLoadBalancersUsingGET(ctx context.Context, account string, applicationName string, clusterName string, type_ string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/{type}/loadBalancers" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a cluster's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param clusterName clusterName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return map[string]interface{}*/ -func (a *ClusterControllerApiService) GetClustersUsingGET(ctx context.Context, account string, application string, clusterName string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a list of clusters for an account - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ClusterControllerApiService) GetClustersUsingGET1(ctx context.Context, account string, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a list of cluster names for an application, grouped by account - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return map[string]interface{}*/ -func (a *ClusterControllerApiService) GetClustersUsingGET2(ctx context.Context, application string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a list of scaling activities for a server group - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param clusterName clusterName - @param serverGroupName serverGroupName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @param "region" (string) region - @return []interface{}*/ -func (a *ClusterControllerApiService) GetScalingActivitiesUsingGET(ctx context.Context, account string, application string, clusterName string, serverGroupName string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}/scalingActivities" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["region"], "string", "region"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["region"].(string); localVarOk { - localVarQueryParams.Add("region", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a server group's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param clusterName clusterName - @param serverGroupName serverGroupName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ClusterControllerApiService) GetServerGroupsUsingGET(ctx context.Context, account string, application string, clusterName string, serverGroupName string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups/{serverGroupName}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a list of server groups for a cluster - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param clusterName clusterName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ClusterControllerApiService) GetServerGroupsUsingGET1(ctx context.Context, account string, application string, clusterName string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/serverGroups" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ClusterControllerApiService Retrieve a server group that matches a target coordinate (e.g., newest, ancestor) relative to a cluster - `scope` is either a zone or a region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param cloudProvider cloudProvider - @param clusterName clusterName - @param scope scope - @param target target - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "onlyEnabled" (bool) onlyEnabled - @param "validateOldest" (bool) validateOldest - @return map[string]interface{}*/ -func (a *ClusterControllerApiService) GetTargetServerGroupUsingGET(ctx context.Context, account string, application string, cloudProvider string, clusterName string, scope string, target string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/clusters/{account}/{clusterName}/{cloudProvider}/{scope}/serverGroups/target/{target}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"scope"+"}", fmt.Sprintf("%v", scope), -1) - localVarPath = strings.Replace(localVarPath, "{"+"target"+"}", fmt.Sprintf("%v", target), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["onlyEnabled"], "bool", "onlyEnabled"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["validateOldest"], "bool", "validateOldest"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["onlyEnabled"].(bool); localVarOk { - localVarQueryParams.Add("onlyEnabled", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["validateOldest"].(bool); localVarOk { - localVarQueryParams.Add("validateOldest", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/concourse_controller_api.go b/gateapi/concourse_controller_api.go deleted file mode 100644 index e9d6eacf..00000000 --- a/gateapi/concourse_controller_api.go +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ConcourseControllerApiService service - - -/* ConcourseControllerApiService Retrieve the list of job names for a given pipeline available to triggers - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param pipeline pipeline - @param team team - @return []interface{}*/ -func (a *ConcourseControllerApiService) JobsUsingGET(ctx context.Context, buildMaster string, pipeline string, team string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/jobs" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipeline"+"}", fmt.Sprintf("%v", pipeline), -1) - localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ConcourseControllerApiService Retrieve the list of pipeline names for a given team available to triggers - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param team team - @return []interface{}*/ -func (a *ConcourseControllerApiService) PipelinesUsingGET(ctx context.Context, buildMaster string, team string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ConcourseControllerApiService Retrieve the list of resource names for a given pipeline available to the Concourse stage - * @param ctx context.Context for authentication, logging, tracing, etc. - @param buildMaster buildMaster - @param pipeline pipeline - @param team team - @return []interface{}*/ -func (a *ConcourseControllerApiService) ResourcesUsingGET(ctx context.Context, buildMaster string, pipeline string, team string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/concourse/{buildMaster}/teams/{team}/pipelines/{pipeline}/resources" - localVarPath = strings.Replace(localVarPath, "{"+"buildMaster"+"}", fmt.Sprintf("%v", buildMaster), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipeline"+"}", fmt.Sprintf("%v", pipeline), -1) - localVarPath = strings.Replace(localVarPath, "{"+"team"+"}", fmt.Sprintf("%v", team), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/configuration.go b/gateapi/configuration.go index a1216387..e9cc0f75 100644 --- a/gateapi/configuration.go +++ b/gateapi/configuration.go @@ -25,37 +25,37 @@ func (c contextKey) String() string { var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") + ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") + ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") + ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + ContextAPIKey = contextKey("apikey") ) -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +// 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"` + 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 + Key string + Prefix string } type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client } func NewConfiguration() *Configuration { @@ -69,4 +69,4 @@ func NewConfiguration() *Configuration { func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value -} \ No newline at end of file +} diff --git a/gateapi/credentials_controller_api.go b/gateapi/credentials_controller_api.go deleted file mode 100644 index cba42df2..00000000 --- a/gateapi/credentials_controller_api.go +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type CredentialsControllerApiService service - - -/* CredentialsControllerApiService Retrieve an account's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "accountNonExpired" (bool) - @param "accountNonLocked" (bool) - @param "allowedAccounts" ([]string) - @param "authorities0Authority" (string) - @param "credentialsNonExpired" (bool) - @param "email" (string) - @param "enabled" (bool) - @param "firstName" (string) - @param "lastName" (string) - @param "password" (string) - @param "roles" ([]string) - @param "username" (string) - @return AccountDetails*/ -func (a *CredentialsControllerApiService) GetAccountUsingGET(ctx context.Context, account string, localVarOptionals map[string]interface{}) (AccountDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload AccountDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/credentials/{account}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accountNonExpired"], "bool", "accountNonExpired"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accountNonLocked"], "bool", "accountNonLocked"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorities0Authority"], "string", "authorities0Authority"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["credentialsNonExpired"], "bool", "credentialsNonExpired"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["email"], "string", "email"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["enabled"], "bool", "enabled"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["firstName"], "string", "firstName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["lastName"], "string", "lastName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["password"], "string", "password"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["username"], "string", "username"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["accountNonExpired"].(bool); localVarOk { - localVarQueryParams.Add("accountNonExpired", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["accountNonLocked"].(bool); localVarOk { - localVarQueryParams.Add("accountNonLocked", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["allowedAccounts"].([]string); localVarOk { - localVarQueryParams.Add("allowedAccounts", parameterToString(localVarTempParam, "multi")) - } - if localVarTempParam, localVarOk := localVarOptionals["authorities0Authority"].(string); localVarOk { - localVarQueryParams.Add("authorities[0].authority", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["credentialsNonExpired"].(bool); localVarOk { - localVarQueryParams.Add("credentialsNonExpired", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["email"].(string); localVarOk { - localVarQueryParams.Add("email", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["enabled"].(bool); localVarOk { - localVarQueryParams.Add("enabled", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["firstName"].(string); localVarOk { - localVarQueryParams.Add("firstName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["lastName"].(string); localVarOk { - localVarQueryParams.Add("lastName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["password"].(string); localVarOk { - localVarQueryParams.Add("password", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["roles"].([]string); localVarOk { - localVarQueryParams.Add("roles", parameterToString(localVarTempParam, "multi")) - } - if localVarTempParam, localVarOk := localVarOptionals["username"].(string); localVarOk { - localVarQueryParams.Add("username", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CredentialsControllerApiService Retrieve a list of accounts - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "accountNonExpired" (bool) - @param "accountNonLocked" (bool) - @param "allowedAccounts" ([]string) - @param "authorities0Authority" (string) - @param "credentialsNonExpired" (bool) - @param "email" (string) - @param "enabled" (bool) - @param "expand" (bool) expand - @param "firstName" (string) - @param "lastName" (string) - @param "password" (string) - @param "roles" ([]string) - @param "username" (string) - @return []Account*/ -func (a *CredentialsControllerApiService) GetAccountsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]Account, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Account - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/credentials" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["accountNonExpired"], "bool", "accountNonExpired"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accountNonLocked"], "bool", "accountNonLocked"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorities0Authority"], "string", "authorities0Authority"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["credentialsNonExpired"], "bool", "credentialsNonExpired"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["email"], "string", "email"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["enabled"], "bool", "enabled"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["expand"], "bool", "expand"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["firstName"], "string", "firstName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["lastName"], "string", "lastName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["password"], "string", "password"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["username"], "string", "username"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["accountNonExpired"].(bool); localVarOk { - localVarQueryParams.Add("accountNonExpired", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["accountNonLocked"].(bool); localVarOk { - localVarQueryParams.Add("accountNonLocked", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["allowedAccounts"].([]string); localVarOk { - localVarQueryParams.Add("allowedAccounts", parameterToString(localVarTempParam, "multi")) - } - if localVarTempParam, localVarOk := localVarOptionals["authorities0Authority"].(string); localVarOk { - localVarQueryParams.Add("authorities[0].authority", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["credentialsNonExpired"].(bool); localVarOk { - localVarQueryParams.Add("credentialsNonExpired", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["email"].(string); localVarOk { - localVarQueryParams.Add("email", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["enabled"].(bool); localVarOk { - localVarQueryParams.Add("enabled", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["expand"].(bool); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["firstName"].(string); localVarOk { - localVarQueryParams.Add("firstName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["lastName"].(string); localVarOk { - localVarQueryParams.Add("lastName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["password"].(string); localVarOk { - localVarQueryParams.Add("password", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["roles"].([]string); localVarOk { - localVarQueryParams.Add("roles", parameterToString(localVarTempParam, "multi")) - } - if localVarTempParam, localVarOk := localVarOptionals["username"].(string); localVarOk { - localVarQueryParams.Add("username", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/deck_plugins_controller_api.go b/gateapi/deck_plugins_controller_api.go deleted file mode 100644 index 138a0a5e..00000000 --- a/gateapi/deck_plugins_controller_api.go +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type DeckPluginsControllerApiService service - - -/* DeckPluginsControllerApiService Retrieve a single plugin asset by version - * @param ctx context.Context for authentication, logging, tracing, etc. - @param asset asset - @param pluginId pluginId - @param pluginVersion pluginVersion - @return string*/ -func (a *DeckPluginsControllerApiService) GetPluginAssetUsingGET(ctx context.Context, asset string, pluginId string, pluginVersion string) (string, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/deck/{pluginId}/{pluginVersion}/{asset}" - localVarPath = strings.Replace(localVarPath, "{"+"asset"+"}", fmt.Sprintf("%v", asset), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pluginId"+"}", fmt.Sprintf("%v", pluginId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pluginVersion"+"}", fmt.Sprintf("%v", pluginVersion), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DeckPluginsControllerApiService Retrieve a plugin manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []DeckPluginVersion*/ -func (a *DeckPluginsControllerApiService) GetPluginManifestUsingGET(ctx context.Context) ([]DeckPluginVersion, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []DeckPluginVersion - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/deck/plugin-manifest.json" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/docs/AmazonInfrastructureControllerApi.md b/gateapi/docs/AmazonInfrastructureControllerApi.md index 36bc9c13..20fea0c3 100644 --- a/gateapi/docs/AmazonInfrastructureControllerApi.md +++ b/gateapi/docs/AmazonInfrastructureControllerApi.md @@ -19,7 +19,7 @@ Get application functions Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -45,17 +45,17 @@ Get functions Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***AmazonInfrastructureControllerApiFunctionsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a AmazonInfrastructureControllerApiFunctionsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **functionName** | **string**| functionName | - **region** | **string**| region | + **account** | **optional.String**| account | + **functionName** | **optional.String**| functionName | + **region** | **optional.String**| region | ### Return type diff --git a/gateapi/docs/ApplicationControllerApi.md b/gateapi/docs/ApplicationControllerApi.md index fd639d83..b2c32377 100644 --- a/gateapi/docs/ApplicationControllerApi.md +++ b/gateapi/docs/ApplicationControllerApi.md @@ -29,17 +29,17 @@ Cancel pipeline Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiCancelPipelineUsingPUTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiCancelPipelineUsingPUTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **reason** | **string**| reason | + + **reason** | **optional.String**| reason | ### Return type @@ -64,7 +64,7 @@ Cancel task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -90,16 +90,16 @@ Retrieve a list of applications Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ApplicationControllerApiGetAllApplicationsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetAllApplicationsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| filters results to only include applications deployed in the specified account | - **owner** | **string**| filters results to only include applications owned by the specified email | + **account** | **optional.String**| filters results to only include applications deployed in the specified account | + **owner** | **optional.String**| filters results to only include applications owned by the specified email | ### Return type @@ -124,17 +124,17 @@ Retrieve a list of an application's configuration revision history Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiGetApplicationHistoryUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetApplicationHistoryUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **limit** | **int32**| limit | [default to 20] + + **limit** | **optional.Int32**| limit | [default to 20] ### Return type @@ -159,17 +159,17 @@ Retrieve an application's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiGetApplicationUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetApplicationUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **expand** | **bool**| expand | [default to true] + + **expand** | **optional.Bool**| expand | [default to true] ### Return type @@ -194,7 +194,7 @@ Retrieve a pipeline configuration Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pipelineName** | **string**| pipelineName | @@ -221,7 +221,7 @@ Retrieve a list of an application's pipeline configurations Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -247,19 +247,19 @@ Retrieve a list of an application's pipeline executions Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiGetPipelinesUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetPipelinesUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **expand** | **bool**| expand | - **limit** | **int32**| limit | - **statuses** | **string**| statuses | + + **expand** | **optional.Bool**| expand | + **limit** | **optional.Int32**| limit | + **statuses** | **optional.String**| statuses | ### Return type @@ -284,7 +284,7 @@ Retrieve a pipeline strategy configuration Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **strategyName** | **string**| strategyName | @@ -311,7 +311,7 @@ Retrieve a list of an application's pipeline strategy configurations Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -337,19 +337,19 @@ Get task details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **taskDetailsId** | **string**| taskDetailsId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiGetTaskDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetTaskDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **taskDetailsId** | **string**| taskDetailsId | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -374,7 +374,7 @@ Get task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -400,19 +400,19 @@ Retrieve a list of an application's tasks Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiGetTasksUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiGetTasksUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **limit** | **int32**| limit | - **page** | **int32**| page | - **statuses** | **string**| statuses | + + **limit** | **optional.Int32**| limit | + **page** | **optional.Int32**| page | + **statuses** | **optional.String**| statuses | ### Return type @@ -437,20 +437,20 @@ Invoke pipeline config Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pipelineName** | **string**| pipelineName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ApplicationControllerApiInvokePipelineConfigUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ApplicationControllerApiInvokePipelineConfigUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **pipelineName** | **string**| pipelineName | - **trigger** | [**interface{}**](interface{}.md)| trigger | - **user** | **string**| user | + + + **trigger** | [**optional.Interface of interface{}**](interface{}.md)| trigger | + **user** | **optional.String**| user | ### Return type @@ -475,7 +475,7 @@ Create task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **map_** | [**interface{}**](interface{}.md)| map | diff --git a/gateapi/docs/ArtifactControllerApi.md b/gateapi/docs/ArtifactControllerApi.md index ae93265d..f6cf9bce 100644 --- a/gateapi/docs/ArtifactControllerApi.md +++ b/gateapi/docs/ArtifactControllerApi.md @@ -17,15 +17,15 @@ Retrieve the list of artifact accounts configured in Clouddriver. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ArtifactControllerApiAllUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ArtifactControllerApiAllUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xRateLimitApp** | **string**| X-RateLimit-App | + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -50,21 +50,21 @@ Retrieve the list of artifact versions by account and artifact names Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **accountName** | **string**| accountName | **artifactName** | **string**| artifactName | **type_** | **string**| type | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ArtifactControllerApiArtifactVersionsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ArtifactControllerApiArtifactVersionsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **accountName** | **string**| accountName | - **artifactName** | **string**| artifactName | - **type_** | **string**| type | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -89,7 +89,7 @@ Retrieve the specified artifact version for an artifact provider and package nam Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **packageName** | **string**| packageName | **provider** | **string**| provider | **version** | **string**| version | diff --git a/gateapi/docs/AuthControllerApi.md b/gateapi/docs/AuthControllerApi.md index 0ce1003e..a7c0ae4b 100644 --- a/gateapi/docs/AuthControllerApi.md +++ b/gateapi/docs/AuthControllerApi.md @@ -19,15 +19,15 @@ Get service accounts Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***AuthControllerApiGetServiceAccountsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a AuthControllerApiGetServiceAccountsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | + **application** | **optional.String**| application | ### Return type @@ -74,7 +74,7 @@ Redirect to Deck Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **to** | **string**| to | ### Return type diff --git a/gateapi/docs/BakeControllerApi.md b/gateapi/docs/BakeControllerApi.md index e02d75c0..b6464a52 100644 --- a/gateapi/docs/BakeControllerApi.md +++ b/gateapi/docs/BakeControllerApi.md @@ -17,7 +17,7 @@ Retrieve a list of available bakery base images for a given cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **cloudProvider** | **string**| cloudProvider | ### Return type @@ -65,7 +65,7 @@ Retrieve the logs for a given bake Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **region** | **string**| region | **statusId** | **string**| statusId | diff --git a/gateapi/docs/BuildControllerApi.md b/gateapi/docs/BuildControllerApi.md index ad4fa476..f4981b66 100644 --- a/gateapi/docs/BuildControllerApi.md +++ b/gateapi/docs/BuildControllerApi.md @@ -26,15 +26,15 @@ Deprecated, use the v3 endpoint instead Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BuildControllerApiGetBuildMastersUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a BuildControllerApiGetBuildMastersUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type_** | **string**| type | + **type_** | **optional.String**| type | ### Return type @@ -61,7 +61,7 @@ Deprecated, use the v3 endpoint instead Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **number** | **string**| number | @@ -90,7 +90,7 @@ Deprecated, use the v3 endpoint instead Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | ### Return type @@ -118,7 +118,7 @@ Deprecated, use the v3 endpoint instead Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | ### Return type @@ -146,7 +146,7 @@ Deprecated, use the v3 endpoint instead Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | ### Return type @@ -172,15 +172,15 @@ Get build masters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BuildControllerApiV3GetBuildMastersUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a BuildControllerApiV3GetBuildMastersUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type_** | **string**| type | + **type_** | **optional.String**| type | ### Return type @@ -205,7 +205,7 @@ Get build for build master Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **job** | **string**| job | **number** | **string**| number | @@ -233,7 +233,7 @@ Get builds for build master Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **job** | **string**| job | @@ -260,7 +260,7 @@ Get job config Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **job** | **string**| job | @@ -287,7 +287,7 @@ Get jobs for build master Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | ### Return type diff --git a/gateapi/docs/CiControllerApi.md b/gateapi/docs/CiControllerApi.md index 4d7e44dc..96fe1c8a 100644 --- a/gateapi/docs/CiControllerApi.md +++ b/gateapi/docs/CiControllerApi.md @@ -15,19 +15,19 @@ getBuilds Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **projectKey** | **string**| projectKey | **repoSlug** | **string**| repoSlug | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***CiControllerApiGetBuildsUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a CiControllerApiGetBuildsUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **projectKey** | **string**| projectKey | - **repoSlug** | **string**| repoSlug | - **completionStatus** | **string**| completionStatus | + + + **completionStatus** | **optional.String**| completionStatus | ### Return type diff --git a/gateapi/docs/ClusterControllerApi.md b/gateapi/docs/ClusterControllerApi.md index cd12f2fb..03e15205 100644 --- a/gateapi/docs/ClusterControllerApi.md +++ b/gateapi/docs/ClusterControllerApi.md @@ -22,23 +22,23 @@ Retrieve a cluster's loadbalancers Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **applicationName** | **string**| applicationName | **clusterName** | **string**| clusterName | **type_** | **string**| type | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetClusterLoadBalancersUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetClusterLoadBalancersUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **applicationName** | **string**| applicationName | - **clusterName** | **string**| clusterName | - **type_** | **string**| type | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -63,21 +63,21 @@ Retrieve a cluster's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **clusterName** | **string**| clusterName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetClustersUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetClustersUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **clusterName** | **string**| clusterName | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -102,19 +102,19 @@ Retrieve a list of clusters for an account Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetClustersUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetClustersUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -139,17 +139,17 @@ Retrieve a list of cluster names for an application, grouped by account Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetClustersUsingGET2Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetClustersUsingGET2Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **xRateLimitApp** | **string**| X-RateLimit-App | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -174,25 +174,25 @@ Retrieve a list of scaling activities for a server group Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **clusterName** | **string**| clusterName | **serverGroupName** | **string**| serverGroupName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetScalingActivitiesUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetScalingActivitiesUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **clusterName** | **string**| clusterName | - **serverGroupName** | **string**| serverGroupName | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] - **region** | **string**| region | + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] + **region** | **optional.String**| region | ### Return type @@ -217,23 +217,23 @@ Retrieve a server group's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **clusterName** | **string**| clusterName | **serverGroupName** | **string**| serverGroupName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetServerGroupsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetServerGroupsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **clusterName** | **string**| clusterName | - **serverGroupName** | **string**| serverGroupName | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -258,21 +258,21 @@ Retrieve a list of server groups for a cluster Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **clusterName** | **string**| clusterName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetServerGroupsUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetServerGroupsUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **clusterName** | **string**| clusterName | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -299,29 +299,29 @@ Retrieve a server group that matches a target coordinate (e.g., newest, ancestor Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **cloudProvider** | **string**| cloudProvider | **clusterName** | **string**| clusterName | **scope** | **string**| scope | **target** | **string**| target | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ClusterControllerApiGetTargetServerGroupUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ClusterControllerApiGetTargetServerGroupUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **cloudProvider** | **string**| cloudProvider | - **clusterName** | **string**| clusterName | - **scope** | **string**| scope | - **target** | **string**| target | - **xRateLimitApp** | **string**| X-RateLimit-App | - **onlyEnabled** | **bool**| onlyEnabled | - **validateOldest** | **bool**| validateOldest | + + + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **onlyEnabled** | **optional.Bool**| onlyEnabled | + **validateOldest** | **optional.Bool**| validateOldest | ### Return type diff --git a/gateapi/docs/ConcourseControllerApi.md b/gateapi/docs/ConcourseControllerApi.md index 82468961..6e6130a1 100644 --- a/gateapi/docs/ConcourseControllerApi.md +++ b/gateapi/docs/ConcourseControllerApi.md @@ -17,7 +17,7 @@ Retrieve the list of job names for a given pipeline available to triggers Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **pipeline** | **string**| pipeline | **team** | **string**| team | @@ -45,7 +45,7 @@ Retrieve the list of pipeline names for a given team available to triggers Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **team** | **string**| team | @@ -72,7 +72,7 @@ Retrieve the list of resource names for a given pipeline available to the Concou Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **buildMaster** | **string**| buildMaster | **pipeline** | **string**| pipeline | **team** | **string**| team | diff --git a/gateapi/docs/CredentialsControllerApi.md b/gateapi/docs/CredentialsControllerApi.md index a9e1aa20..1cd3abd5 100644 --- a/gateapi/docs/CredentialsControllerApi.md +++ b/gateapi/docs/CredentialsControllerApi.md @@ -16,29 +16,29 @@ Retrieve an account's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***CredentialsControllerApiGetAccountUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a CredentialsControllerApiGetAccountUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **xRateLimitApp** | **string**| X-RateLimit-App | - **accountNonExpired** | **bool**| | - **accountNonLocked** | **bool**| | - **allowedAccounts** | [**[]string**](string.md)| | - **authorities0Authority** | **string**| | - **credentialsNonExpired** | **bool**| | - **email** | **string**| | - **enabled** | **bool**| | - **firstName** | **string**| | - **lastName** | **string**| | - **password** | **string**| | - **roles** | [**[]string**](string.md)| | - **username** | **string**| | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **accountNonExpired** | **optional.Bool**| | + **accountNonLocked** | **optional.Bool**| | + **allowedAccounts** | [**optional.Interface of []string**](string.md)| | + **authorities0Authority** | **optional.String**| | + **credentialsNonExpired** | **optional.Bool**| | + **email** | **optional.String**| | + **enabled** | **optional.Bool**| | + **firstName** | **optional.String**| | + **lastName** | **optional.String**| | + **password** | **optional.String**| | + **roles** | [**optional.Interface of []string**](string.md)| | + **username** | **optional.String**| | ### Return type @@ -63,27 +63,27 @@ Retrieve a list of accounts Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CredentialsControllerApiGetAccountsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a CredentialsControllerApiGetAccountsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **accountNonExpired** | **bool**| | - **accountNonLocked** | **bool**| | - **allowedAccounts** | [**[]string**](string.md)| | - **authorities0Authority** | **string**| | - **credentialsNonExpired** | **bool**| | - **email** | **string**| | - **enabled** | **bool**| | - **expand** | **bool**| expand | - **firstName** | **string**| | - **lastName** | **string**| | - **password** | **string**| | - **roles** | [**[]string**](string.md)| | - **username** | **string**| | + **accountNonExpired** | **optional.Bool**| | + **accountNonLocked** | **optional.Bool**| | + **allowedAccounts** | [**optional.Interface of []string**](string.md)| | + **authorities0Authority** | **optional.String**| | + **credentialsNonExpired** | **optional.Bool**| | + **email** | **optional.String**| | + **enabled** | **optional.Bool**| | + **expand** | **optional.Bool**| expand | + **firstName** | **optional.String**| | + **lastName** | **optional.String**| | + **password** | **optional.String**| | + **roles** | [**optional.Interface of []string**](string.md)| | + **username** | **optional.String**| | ### Return type diff --git a/gateapi/docs/DeckPluginsControllerApi.md b/gateapi/docs/DeckPluginsControllerApi.md index 7004825f..f3a1d741 100644 --- a/gateapi/docs/DeckPluginsControllerApi.md +++ b/gateapi/docs/DeckPluginsControllerApi.md @@ -16,7 +16,7 @@ Retrieve a single plugin asset by version Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **asset** | **string**| asset | **pluginId** | **string**| pluginId | **pluginVersion** | **string**| pluginVersion | diff --git a/gateapi/docs/EcsServerGroupEventsControllerApi.md b/gateapi/docs/EcsServerGroupEventsControllerApi.md index 1c79233c..d532272c 100644 --- a/gateapi/docs/EcsServerGroupEventsControllerApi.md +++ b/gateapi/docs/EcsServerGroupEventsControllerApi.md @@ -15,7 +15,7 @@ Retrieves a list of events for a server group Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | **provider** | **string**| provider | diff --git a/gateapi/docs/ExecutionsControllerApi.md b/gateapi/docs/ExecutionsControllerApi.md index ccc52d8b..f562d07e 100644 --- a/gateapi/docs/ExecutionsControllerApi.md +++ b/gateapi/docs/ExecutionsControllerApi.md @@ -16,19 +16,19 @@ Retrieves an ad-hoc collection of executions based on a number of user-supplied Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **executionIds** | **string**| A comma-separated list of executions to retrieve. Either this OR pipelineConfigIds must be supplied, but not both. | - **expand** | **bool**| Expands each execution object in the resulting list. If this value is missing, it is defaulted to true. | [default to true] - **limit** | **int32**| The number of executions to return per pipeline configuration. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to 1. | - **pipelineConfigIds** | **string**| A comma-separated list of pipeline configuration IDs to retrieve recent executions for. Either this OR pipelineConfigIds must be supplied, but not both. | - **statuses** | **string**| A comma-separated list of execution statuses to filter by. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to all statuses. | + **executionIds** | **optional.String**| A comma-separated list of executions to retrieve. Either this OR pipelineConfigIds must be supplied, but not both. | + **expand** | **optional.Bool**| Expands each execution object in the resulting list. If this value is missing, it is defaulted to true. | [default to true] + **limit** | **optional.Int32**| The number of executions to return per pipeline configuration. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to 1. | + **pipelineConfigIds** | **optional.String**| A comma-separated list of pipeline configuration IDs to retrieve recent executions for. Either this OR pipelineConfigIds must be supplied, but not both. | + **statuses** | **optional.String**| A comma-separated list of execution statuses to filter by. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to all statuses. | ### Return type @@ -53,27 +53,27 @@ Search for pipeline executions using a combination of criteria. The returned lis Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| Only includes executions that are part of this application. If this value is \"*\", results will include executions of all applications. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ExecutionsControllerApiSearchForPipelineExecutionsByTriggerUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ExecutionsControllerApiSearchForPipelineExecutionsByTriggerUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| Only includes executions that are part of this application. If this value is \"*\", results will include executions of all applications. | - **eventId** | **string**| Only includes executions that were triggered by a trigger with this eventId. | - **expand** | **bool**| Expands each execution object in the resulting list. If this value is missing, it is defaulted to false. | [default to false] - **pipelineName** | **string**| Only includes executions that with this pipeline name. | - **reverse** | **bool**| Reverses the resulting list before it is paginated. If this value is missing, it is defaulted to false. | [default to false] - **size** | **int32**| Sets the size of the resulting list for pagination. This value must be > 0. If this value is missing, it is defaulted to 10. | [default to 10] - **startIndex** | **int32**| Sets the first item of the resulting list for pagination. The list is 0-indexed. This value must be >= 0. If this value is missing, it is defaulted to 0. | [default to 0] - **statuses** | **string**| Only includes executions with a status that is equal to a status provided in this field. The list of statuses should be given as a comma-delimited string. If this value is missing, includes executions of all statuses. Allowed statuses are: NOT_STARTED, RUNNING, PAUSED, SUSPENDED, SUCCEEDED, FAILED_CONTINUE, TERMINAL, CANCELED, REDIRECT, STOPPED, SKIPPED, BUFFERED. | - **trigger** | **string**| Only includes executions that were triggered by a trigger that matches the subset of fields provided by this value. This value should be a base64-encoded string of a JSON representation of a trigger object. The comparison succeeds if the execution trigger contains all the fields of the input trigger, the fields are of the same type, and each value of the field \"matches\". The term \"matches\" is specific for each field's type: - For Strings: A String value in the execution's trigger matches the input trigger's String value if the former equals the latter (case-insensitive) OR if the former matches the latter as a regular expression. - For Maps: A Map value in the execution's trigger matches the input trigger's Map value if the former contains all keys of the latter and their values match. - For Collections: A Collection value in the execution's trigger matches the input trigger's Collection value if the former has a unique element that matches each element of the latter. - Every other value is compared using the Java \"equals\" method (Groovy \"==\" operator) | - **triggerTimeEndBoundary** | **int64**| Only includes executions that were built at or before the given time, represented as a Unix timestamp in ms (UTC). This value must be <= 9223372036854775807 (Long.MAX_VALUE) and >= the value of [triggerTimeStartBoundary], if provided. If this value is missing, it is defaulted to 9223372036854775807. | - **triggerTimeStartBoundary** | **int64**| Only includes executions that were built at or after the given time, represented as a Unix timestamp in ms (UTC). This value must be >= 0 and <= the value of [triggerTimeEndBoundary], if provided. If this value is missing, it is defaulted to 0. | [default to 0] - **triggerTypes** | **string**| Only includes executions that were triggered by a trigger with a type that is equal to a type provided in this field. The list of trigger types should be a comma-delimited string. If this value is missing, results will includes executions of all trigger types. | + + **eventId** | **optional.String**| Only includes executions that were triggered by a trigger with this eventId. | + **expand** | **optional.Bool**| Expands each execution object in the resulting list. If this value is missing, it is defaulted to false. | [default to false] + **pipelineName** | **optional.String**| Only includes executions that with this pipeline name. | + **reverse** | **optional.Bool**| Reverses the resulting list before it is paginated. If this value is missing, it is defaulted to false. | [default to false] + **size** | **optional.Int32**| Sets the size of the resulting list for pagination. This value must be > 0. If this value is missing, it is defaulted to 10. | [default to 10] + **startIndex** | **optional.Int32**| Sets the first item of the resulting list for pagination. The list is 0-indexed. This value must be >= 0. If this value is missing, it is defaulted to 0. | [default to 0] + **statuses** | **optional.String**| Only includes executions with a status that is equal to a status provided in this field. The list of statuses should be given as a comma-delimited string. If this value is missing, includes executions of all statuses. Allowed statuses are: NOT_STARTED, RUNNING, PAUSED, SUSPENDED, SUCCEEDED, FAILED_CONTINUE, TERMINAL, CANCELED, REDIRECT, STOPPED, SKIPPED, BUFFERED. | + **trigger** | **optional.String**| Only includes executions that were triggered by a trigger that matches the subset of fields provided by this value. This value should be a base64-encoded string of a JSON representation of a trigger object. The comparison succeeds if the execution trigger contains all the fields of the input trigger, the fields are of the same type, and each value of the field \"matches\". The term \"matches\" is specific for each field's type: - For Strings: A String value in the execution's trigger matches the input trigger's String value if the former equals the latter (case-insensitive) OR if the former matches the latter as a regular expression. - For Maps: A Map value in the execution's trigger matches the input trigger's Map value if the former contains all keys of the latter and their values match. - For Collections: A Collection value in the execution's trigger matches the input trigger's Collection value if the former has a unique element that matches each element of the latter. - Every other value is compared using the Java \"equals\" method (Groovy \"==\" operator) | + **triggerTimeEndBoundary** | **optional.Int64**| Only includes executions that were built at or before the given time, represented as a Unix timestamp in ms (UTC). This value must be <= 9223372036854775807 (Long.MAX_VALUE) and >= the value of [triggerTimeStartBoundary], if provided. If this value is missing, it is defaulted to 9223372036854775807. | + **triggerTimeStartBoundary** | **optional.Int64**| Only includes executions that were built at or after the given time, represented as a Unix timestamp in ms (UTC). This value must be >= 0 and <= the value of [triggerTimeEndBoundary], if provided. If this value is missing, it is defaulted to 0. | [default to 0] + **triggerTypes** | **optional.String**| Only includes executions that were triggered by a trigger with a type that is equal to a type provided in this field. The list of trigger types should be a comma-delimited string. If this value is missing, results will includes executions of all trigger types. | ### Return type diff --git a/gateapi/docs/FirewallControllerApi.md b/gateapi/docs/FirewallControllerApi.md index 2852a59d..e5bc4c2a 100644 --- a/gateapi/docs/FirewallControllerApi.md +++ b/gateapi/docs/FirewallControllerApi.md @@ -18,20 +18,20 @@ Retrieve a list of firewalls for a given account and region Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***FirewallControllerApiAllByAccountAndRegionUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a FirewallControllerApiAllByAccountAndRegionUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -56,18 +56,18 @@ Retrieve a list of firewalls for a given account, grouped by region Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***FirewallControllerApiAllByAccountUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a FirewallControllerApiAllByAccountUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -92,16 +92,16 @@ Retrieve a list of firewalls, grouped by account, cloud provider, and region Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FirewallControllerApiAllUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a FirewallControllerApiAllUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xRateLimitApp** | **string**| X-RateLimit-App | - **id** | **string**| id | + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **id** | **optional.String**| id | ### Return type @@ -126,23 +126,23 @@ Retrieve a firewall's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **name** | **string**| name | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***FirewallControllerApiGetSecurityGroupUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a FirewallControllerApiGetSecurityGroupUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **name** | **string**| name | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] - **vpcId** | **string**| vpcId | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] + **vpcId** | **optional.String**| vpcId | ### Return type diff --git a/gateapi/docs/ImageControllerApi.md b/gateapi/docs/ImageControllerApi.md index edd6710e..45aba624 100644 --- a/gateapi/docs/ImageControllerApi.md +++ b/gateapi/docs/ImageControllerApi.md @@ -19,19 +19,19 @@ The query parameter `q` filters the list of images by image name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ImageControllerApiFindImagesUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ImageControllerApiFindImagesUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **count** | **int32**| count | - **provider** | **string**| provider | [default to aws] - **q** | **string**| q | - **region** | **string**| region | + **account** | **optional.String**| account | + **count** | **optional.Int32**| count | + **provider** | **optional.String**| provider | [default to aws] + **q** | **optional.String**| q | + **region** | **optional.String**| region | ### Return type @@ -56,20 +56,20 @@ Find tags Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **repository** | **string**| repository | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ImageControllerApiFindTagsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ImageControllerApiFindTagsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **repository** | **string**| repository | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -94,22 +94,22 @@ Get image details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **imageId** | **string**| imageId | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ImageControllerApiGetImageDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ImageControllerApiGetImageDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **imageId** | **string**| imageId | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type diff --git a/gateapi/docs/InstanceControllerApi.md b/gateapi/docs/InstanceControllerApi.md index 32176595..c53c7a83 100644 --- a/gateapi/docs/InstanceControllerApi.md +++ b/gateapi/docs/InstanceControllerApi.md @@ -16,22 +16,22 @@ Retrieve an instance's console output Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **instanceId** | **string**| instanceId | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***InstanceControllerApiGetConsoleOutputUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a InstanceControllerApiGetConsoleOutputUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **instanceId** | **string**| instanceId | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -56,21 +56,21 @@ Retrieve an instance's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **instanceId** | **string**| instanceId | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***InstanceControllerApiGetInstanceDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a InstanceControllerApiGetInstanceDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **instanceId** | **string**| instanceId | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type diff --git a/gateapi/docs/JobControllerApi.md b/gateapi/docs/JobControllerApi.md index 3baaeab1..3d8803b5 100644 --- a/gateapi/docs/JobControllerApi.md +++ b/gateapi/docs/JobControllerApi.md @@ -15,24 +15,24 @@ Get job Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **applicationName** | **string**| applicationName | **name** | **string**| name | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***JobControllerApiGetJobUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a JobControllerApiGetJobUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **applicationName** | **string**| applicationName | - **name** | **string**| name | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **expand** | **string**| expand | [default to false] + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **expand** | **optional.String**| expand | [default to false] ### Return type diff --git a/gateapi/docs/LoadBalancerControllerApi.md b/gateapi/docs/LoadBalancerControllerApi.md index a29395a8..0f61af88 100644 --- a/gateapi/docs/LoadBalancerControllerApi.md +++ b/gateapi/docs/LoadBalancerControllerApi.md @@ -18,16 +18,16 @@ Retrieve a list of load balancers for a given cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***LoadBalancerControllerApiGetAllUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a LoadBalancerControllerApiGetAllUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -52,17 +52,17 @@ Retrieve a list of load balancers for a given application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***LoadBalancerControllerApiGetApplicationLoadBalancersUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a LoadBalancerControllerApiGetApplicationLoadBalancersUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **xRateLimitApp** | **string**| X-RateLimit-App | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -87,22 +87,22 @@ Retrieve a load balancer's details as a single element list for a given account, Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **name** | **string**| name | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***LoadBalancerControllerApiGetLoadBalancerDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a LoadBalancerControllerApiGetLoadBalancerDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **name** | **string**| name | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -127,18 +127,18 @@ Retrieve a load balancer for a given cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **name** | **string**| name | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***LoadBalancerControllerApiGetLoadBalancerUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a LoadBalancerControllerApiGetLoadBalancerUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **string**| name | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type diff --git a/gateapi/docs/ManagedControllerApi.md b/gateapi/docs/ManagedControllerApi.md index 5e31f602..79bf3aca 100644 --- a/gateapi/docs/ManagedControllerApi.md +++ b/gateapi/docs/ManagedControllerApi.md @@ -39,7 +39,7 @@ Create a pin for an artifact in an environment Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pin** | [**EnvironmentArtifactPin**](EnvironmentArtifactPin.md)| pin | @@ -66,7 +66,7 @@ Delete a delivery config manifest for an application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -92,7 +92,7 @@ Delete a delivery config manifest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **name** | **string**| name | ### Return type @@ -118,19 +118,19 @@ Unpin one or more artifact(s) in an environment. If the `reference` parameter is Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **targetEnvironment** | **string**| targetEnvironment | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ManagedControllerApiDeletePinUsingDELETEOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ManagedControllerApiDeletePinUsingDELETEOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **targetEnvironment** | **string**| targetEnvironment | - **reference** | **string**| reference | + + + **reference** | **optional.String**| reference | ### Return type @@ -155,7 +155,7 @@ Veto an artifact version in an environment Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **reference** | **string**| reference | **targetEnvironment** | **string**| targetEnvironment | @@ -184,7 +184,7 @@ Ad-hoc validate and diff a config manifest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **manifest** | [**DeliveryConfig**](DeliveryConfig.md)| manifest | ### Return type @@ -210,7 +210,7 @@ Ad-hoc validate and diff a resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **resource** | [**Resource**](Resource.md)| resource | ### Return type @@ -236,7 +236,7 @@ Generates an artifact definition based on the artifact used in a running cluster Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **cloudProvider** | **string**| cloudProvider | **clusterName** | **string**| clusterName | @@ -264,7 +264,7 @@ Generate a keel resource definition for a deployed cloud resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **cloudProvider** | **string**| cloudProvider | **name** | **string**| name | @@ -316,18 +316,18 @@ Get managed details about an application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ManagedControllerApiGetApplicationDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ManagedControllerApiGetApplicationDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **entities** | [**[]string**](string.md)| entities | [default to resources] - **includeDetails** | **bool**| includeDetails | [default to false] + + **entities** | [**optional.Interface of []string**](string.md)| entities | + **includeDetails** | **optional.Bool**| includeDetails | [default to false] ### Return type @@ -352,7 +352,7 @@ Get the delivery config associated with an application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -378,19 +378,19 @@ List up-to {limit} current constraint states for an environment Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **environment** | **string**| environment | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ManagedControllerApiGetConstraintStateUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ManagedControllerApiGetConstraintStateUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **environment** | **string**| environment | - **limit** | **string**| limit | [default to 10] + + + **limit** | **optional.String**| limit | [default to 10] ### Return type @@ -415,7 +415,7 @@ Get the status of each version of each artifact in each environment Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **name** | **string**| name | ### Return type @@ -441,7 +441,7 @@ Get a delivery config manifest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **name** | **string**| name | ### Return type @@ -467,7 +467,7 @@ Get status of a resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **resourceId** | **string**| resourceId | ### Return type @@ -493,7 +493,7 @@ Get a resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **resourceId** | **string**| resourceId | ### Return type @@ -519,7 +519,7 @@ Pause management of an entire application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -545,7 +545,7 @@ Pause management of a resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **resourceId** | **string**| resourceId | ### Return type @@ -571,7 +571,7 @@ Resume management of an entire application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type @@ -597,7 +597,7 @@ Resume management of a resource Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **resourceId** | **string**| resourceId | ### Return type @@ -623,7 +623,7 @@ Update the status of an environment constraint Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **environment** | **string**| environment | **status** | [**ConstraintStatus**](ConstraintStatus.md)| status | @@ -651,7 +651,7 @@ Create or update a delivery config manifest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **manifest** | [**DeliveryConfig**](DeliveryConfig.md)| manifest | ### Return type @@ -677,7 +677,7 @@ Validate a delivery config manifest Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **manifest** | [**DeliveryConfig**](DeliveryConfig.md)| manifest | ### Return type @@ -703,7 +703,7 @@ Veto an artifact version in an environment Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **veto** | [**EnvironmentArtifactVeto**](EnvironmentArtifactVeto.md)| veto | diff --git a/gateapi/docs/NetworkControllerApi.md b/gateapi/docs/NetworkControllerApi.md index 0173e483..418e9e0c 100644 --- a/gateapi/docs/NetworkControllerApi.md +++ b/gateapi/docs/NetworkControllerApi.md @@ -16,17 +16,17 @@ Retrieve a list of networks for a given cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **cloudProvider** | **string**| cloudProvider | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***NetworkControllerApiAllByCloudProviderUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a NetworkControllerApiAllByCloudProviderUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cloudProvider** | **string**| cloudProvider | - **xRateLimitApp** | **string**| X-RateLimit-App | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -51,15 +51,15 @@ Retrieve a list of networks, grouped by cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***NetworkControllerApiAllUsingGET2Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a NetworkControllerApiAllUsingGET2Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xRateLimitApp** | **string**| X-RateLimit-App | + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type diff --git a/gateapi/docs/PipelineConfigControllerApi.md b/gateapi/docs/PipelineConfigControllerApi.md index 8b2a9333..f1a11412 100644 --- a/gateapi/docs/PipelineConfigControllerApi.md +++ b/gateapi/docs/PipelineConfigControllerApi.md @@ -17,7 +17,7 @@ Convert a pipeline config to a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipelineConfigId** | **string**| pipelineConfigId | ### Return type @@ -65,17 +65,17 @@ Get pipeline config history. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipelineConfigId** | **string**| pipelineConfigId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineConfigControllerApiGetPipelineConfigHistoryUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineConfigControllerApiGetPipelineConfigHistoryUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipelineConfigId** | **string**| pipelineConfigId | - **limit** | **int32**| limit | [default to 20] + + **limit** | **optional.Int32**| limit | [default to 20] ### Return type diff --git a/gateapi/docs/PipelineControllerApi.md b/gateapi/docs/PipelineControllerApi.md index bcb8ae9f..cdbf4637 100644 --- a/gateapi/docs/PipelineControllerApi.md +++ b/gateapi/docs/PipelineControllerApi.md @@ -32,18 +32,18 @@ Cancel a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineControllerApiCancelPipelineUsingPUT1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineControllerApiCancelPipelineUsingPUT1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **force** | **bool**| force | [default to false] - **reason** | **string**| reason | + + **force** | **optional.Bool**| force | [default to false] + **reason** | **optional.String**| reason | ### Return type @@ -68,7 +68,7 @@ Delete a pipeline definition Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pipelineName** | **string**| pipelineName | @@ -95,7 +95,7 @@ Delete a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -121,7 +121,7 @@ Evaluate a pipeline expression at a specific stage using the provided execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **expression** | **string**| expression | **id** | **string**| id | **stageId** | **string**| stageId | @@ -149,7 +149,7 @@ Evaluate a pipeline expression using the provided execution as context Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **expression** | **string**| expression | **id** | **string**| id | @@ -176,7 +176,7 @@ Evaluate a pipeline expression using the provided execution as context Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **pipelineExpression** | [**interface{}**](interface{}.md)| pipelineExpression | @@ -203,20 +203,20 @@ Evaluate variables same as Evaluate Variables stage using the provided execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **executionId** | **string**| Execution id to run against | **expressions** | [**[]Mapstringstring**](Map«string,string».md)| List of variables/expressions to evaluate | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineControllerApiEvaluateVariablesUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineControllerApiEvaluateVariablesUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **executionId** | **string**| Execution id to run against | - **expressions** | [**[]Mapstringstring**](Map«string,string».md)| List of variables/expressions to evaluate | - **requisiteStageRefIds** | **string**| Comma separated list of requisite stage IDs for the evaluation stage | - **spelVersion** | **string**| Version of SpEL evaluation logic to use (v3 or v4) | + + + **requisiteStageRefIds** | **optional.String**| Comma separated list of requisite stage IDs for the evaluation stage | + **spelVersion** | **optional.String**| Version of SpEL evaluation logic to use (v3 or v4) | ### Return type @@ -241,7 +241,7 @@ Retrieve a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -267,19 +267,19 @@ Trigger a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pipelineNameOrId** | **string**| pipelineNameOrId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineControllerApiInvokePipelineConfigUsingPOST1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineControllerApiInvokePipelineConfigUsingPOST1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **pipelineNameOrId** | **string**| pipelineNameOrId | - **trigger** | [**interface{}**](interface{}.md)| trigger | + + + **trigger** | [**optional.Interface of interface{}**](interface{}.md)| trigger | ### Return type @@ -304,19 +304,19 @@ Trigger a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **pipelineNameOrId** | **string**| pipelineNameOrId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineControllerApiInvokePipelineConfigViaEchoUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineControllerApiInvokePipelineConfigViaEchoUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **pipelineNameOrId** | **string**| pipelineNameOrId | - **trigger** | [**interface{}**](interface{}.md)| trigger | + + + **trigger** | [**optional.Interface of interface{}**](interface{}.md)| trigger | ### Return type @@ -341,7 +341,7 @@ Pause a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -367,7 +367,7 @@ Rename a pipeline definition Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **renameCommand** | [**interface{}**](interface{}.md)| renameCommand | ### Return type @@ -393,7 +393,7 @@ Restart a stage execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **context** | [**interface{}**](interface{}.md)| context | **id** | **string**| id | **stageId** | **string**| stageId | @@ -421,7 +421,7 @@ Resume a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -447,7 +447,7 @@ Save a pipeline definition Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipeline** | [**interface{}**](interface{}.md)| pipeline | ### Return type @@ -473,7 +473,7 @@ Initiate a pipeline execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **map_** | [**interface{}**](interface{}.md)| map | ### Return type @@ -499,7 +499,7 @@ Update a pipeline definition Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **pipeline** | [**interface{}**](interface{}.md)| pipeline | @@ -526,7 +526,7 @@ Update a stage execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **context** | [**interface{}**](interface{}.md)| context | **id** | **string**| id | **stageId** | **string**| stageId | diff --git a/gateapi/docs/PipelineTemplatesControllerApi.md b/gateapi/docs/PipelineTemplatesControllerApi.md index 1c017987..b97a59fa 100644 --- a/gateapi/docs/PipelineTemplatesControllerApi.md +++ b/gateapi/docs/PipelineTemplatesControllerApi.md @@ -21,7 +21,7 @@ Create a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | ### Return type @@ -47,17 +47,17 @@ Delete a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineTemplatesControllerApiDeleteUsingDELETEOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineTemplatesControllerApiDeleteUsingDELETEOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **application** | **string**| application | + + **application** | **optional.String**| application | ### Return type @@ -82,7 +82,7 @@ Get a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -108,17 +108,17 @@ List all pipelines that implement a pipeline template Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineTemplatesControllerApiListPipelineTemplateDependentsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineTemplatesControllerApiListPipelineTemplateDependentsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **recursive** | **bool**| recursive | + + **recursive** | **optional.Bool**| recursive | ### Return type @@ -143,15 +143,15 @@ List pipeline templates. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PipelineTemplatesControllerApiListUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineTemplatesControllerApiListUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **scopes** | [**[]string**](string.md)| scopes | + **scopes** | [**optional.Interface of []string**](string.md)| scopes | ### Return type @@ -176,18 +176,18 @@ Resolve a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **source** | **string**| source | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineTemplatesControllerApiResolveTemplatesUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineTemplatesControllerApiResolveTemplatesUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **string**| source | - **executionId** | **string**| executionId | - **pipelineConfigId** | **string**| pipelineConfigId | + + **executionId** | **optional.String**| executionId | + **pipelineConfigId** | **optional.String**| pipelineConfigId | ### Return type @@ -212,19 +212,19 @@ Update a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***PipelineTemplatesControllerApiUpdateUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PipelineTemplatesControllerApiUpdateUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **skipPlanDependents** | **bool**| skipPlanDependents | [default to false] + + + **skipPlanDependents** | **optional.Bool**| skipPlanDependents | [default to false] ### Return type diff --git a/gateapi/docs/PluginInfoControllerApi.md b/gateapi/docs/PluginInfoControllerApi.md index 2d93e97b..ada8dc44 100644 --- a/gateapi/docs/PluginInfoControllerApi.md +++ b/gateapi/docs/PluginInfoControllerApi.md @@ -18,7 +18,7 @@ Delete plugin info with the provided Id Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -44,15 +44,15 @@ Get all plugin info objects Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PluginInfoControllerApiGetAllPluginInfoUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PluginInfoControllerApiGetAllPluginInfoUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **service** | **string**| service | + **service** | **optional.String**| service | ### Return type @@ -77,7 +77,7 @@ Persist plugin metadata information Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pluginInfo** | [**SpinnakerPluginInfo**](SpinnakerPluginInfo.md)| pluginInfo | ### Return type @@ -103,7 +103,7 @@ Persist plugin metadata information Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pluginInfo** | [**SpinnakerPluginInfo**](SpinnakerPluginInfo.md)| pluginInfo | ### Return type diff --git a/gateapi/docs/PluginPublishControllerApi.md b/gateapi/docs/PluginPublishControllerApi.md index 105314b8..fe35f8b0 100644 --- a/gateapi/docs/PluginPublishControllerApi.md +++ b/gateapi/docs/PluginPublishControllerApi.md @@ -15,10 +15,10 @@ Publish a plugin binary and the plugin info metadata. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **plugin** | ***os.File**| plugin | **pluginId** | **string**| pluginId | - **pluginInfo** | **string**| pluginInfo | + **pluginInfo** | [**interface{}**](.md)| pluginInfo | **pluginVersion** | **string**| pluginVersion | ### Return type diff --git a/gateapi/docs/PluginsInstalledControllerApi.md b/gateapi/docs/PluginsInstalledControllerApi.md index e832b31a..9b3c3330 100644 --- a/gateapi/docs/PluginsInstalledControllerApi.md +++ b/gateapi/docs/PluginsInstalledControllerApi.md @@ -15,15 +15,15 @@ Get all installed Spinnaker plugins Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PluginsInstalledControllerApiGetInstalledPluginsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a PluginsInstalledControllerApiGetInstalledPluginsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **service** | **string**| service | + **service** | **optional.String**| service | ### Return type diff --git a/gateapi/docs/ProjectControllerApi.md b/gateapi/docs/ProjectControllerApi.md index 83408576..99e2fd0f 100644 --- a/gateapi/docs/ProjectControllerApi.md +++ b/gateapi/docs/ProjectControllerApi.md @@ -18,18 +18,18 @@ Get all pipelines for project Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ProjectControllerApiAllPipelinesForProjectUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ProjectControllerApiAllPipelinesForProjectUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **limit** | **int32**| limit | [default to 5] - **statuses** | **string**| statuses | + + **limit** | **optional.Int32**| limit | [default to 5] + **statuses** | **optional.String**| statuses | ### Return type @@ -76,17 +76,17 @@ Get a project's clusters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ProjectControllerApiGetClustersUsingGET3Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ProjectControllerApiGetClustersUsingGET3Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **xRateLimitApp** | **string**| X-RateLimit-App | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -111,7 +111,7 @@ Get a project Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type diff --git a/gateapi/docs/ReorderPipelinesControllerApi.md b/gateapi/docs/ReorderPipelinesControllerApi.md index 8db3b13d..4e881676 100644 --- a/gateapi/docs/ReorderPipelinesControllerApi.md +++ b/gateapi/docs/ReorderPipelinesControllerApi.md @@ -15,7 +15,7 @@ Re-order pipelines Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **reorderPipelinesCommand** | [**ReorderPipelinesCommand**](ReorderPipelinesCommand.md)| reorderPipelinesCommand | ### Return type diff --git a/gateapi/docs/SearchControllerApi.md b/gateapi/docs/SearchControllerApi.md index 87976c76..bf603be8 100644 --- a/gateapi/docs/SearchControllerApi.md +++ b/gateapi/docs/SearchControllerApi.md @@ -15,22 +15,22 @@ Search infrastructure Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **type_** | **string**| type | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***SearchControllerApiSearchUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a SearchControllerApiSearchUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type_** | **string**| type | - **xRateLimitApp** | **string**| X-RateLimit-App | - **allowShortQuery** | **bool**| allowShortQuery | [default to false] - **page** | **int32**| page | [default to 1] - **pageSize** | **int32**| pageSize | [default to 10000] - **platform** | **string**| platform | - **q** | **string**| q | + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **allowShortQuery** | **optional.Bool**| allowShortQuery | [default to false] + **page** | **optional.Int32**| page | [default to 1] + **pageSize** | **optional.Int32**| pageSize | [default to 10000] + **platform** | **optional.String**| platform | + **q** | **optional.String**| q | ### Return type diff --git a/gateapi/docs/SecurityGroupControllerApi.md b/gateapi/docs/SecurityGroupControllerApi.md index a81c90c0..480759c0 100644 --- a/gateapi/docs/SecurityGroupControllerApi.md +++ b/gateapi/docs/SecurityGroupControllerApi.md @@ -17,18 +17,18 @@ Retrieve a list of security groups for a given account, grouped by region Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***SecurityGroupControllerApiAllByAccountUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a SecurityGroupControllerApiAllByAccountUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] ### Return type @@ -53,16 +53,16 @@ Retrieve a list of security groups, grouped by account, cloud provider, and regi Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SecurityGroupControllerApiAllUsingGET5Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a SecurityGroupControllerApiAllUsingGET5Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xRateLimitApp** | **string**| X-RateLimit-App | - **id** | **string**| id | + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **id** | **optional.String**| id | ### Return type @@ -87,23 +87,23 @@ Retrieve a security group's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **name** | **string**| name | **region** | **string**| region | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***SecurityGroupControllerApiGetSecurityGroupUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a SecurityGroupControllerApiGetSecurityGroupUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **name** | **string**| name | - **region** | **string**| region | - **xRateLimitApp** | **string**| X-RateLimit-App | - **provider** | **string**| provider | [default to aws] - **vpcId** | **string**| vpcId | + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **provider** | **optional.String**| provider | [default to aws] + **vpcId** | **optional.String**| vpcId | ### Return type diff --git a/gateapi/docs/ServerGroupControllerApi.md b/gateapi/docs/ServerGroupControllerApi.md index 9a80d57f..cbd0da64 100644 --- a/gateapi/docs/ServerGroupControllerApi.md +++ b/gateapi/docs/ServerGroupControllerApi.md @@ -16,24 +16,24 @@ Retrieve a server group's details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **applicationName** | **string**| applicationName | **region** | **string**| region | **serverGroupName** | **string**| serverGroupName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ServerGroupControllerApiGetServerGroupDetailsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ServerGroupControllerApiGetServerGroupDetailsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **applicationName** | **string**| applicationName | - **region** | **string**| region | - **serverGroupName** | **string**| serverGroupName | - **xRateLimitApp** | **string**| X-RateLimit-App | - **includeDetails** | **string**| includeDetails | [default to true] + + + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **includeDetails** | **optional.String**| includeDetails | [default to true] ### Return type @@ -58,20 +58,20 @@ Retrieve a list of server groups for a given application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **applicationName** | **string**| applicationName | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***ServerGroupControllerApiGetServerGroupsForApplicationUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a ServerGroupControllerApiGetServerGroupsForApplicationUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationName** | **string**| applicationName | - **xRateLimitApp** | **string**| X-RateLimit-App | - **cloudProvider** | **string**| cloudProvider | - **clusters** | **string**| clusters | - **expand** | **string**| expand | [default to false] + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | + **cloudProvider** | **optional.String**| cloudProvider | + **clusters** | **optional.String**| clusters | + **expand** | **optional.String**| expand | [default to false] ### Return type diff --git a/gateapi/docs/ServerGroupManagerControllerApi.md b/gateapi/docs/ServerGroupManagerControllerApi.md index fc016ecb..39c3c5ff 100644 --- a/gateapi/docs/ServerGroupManagerControllerApi.md +++ b/gateapi/docs/ServerGroupManagerControllerApi.md @@ -15,7 +15,7 @@ Retrieve a list of server group managers for an application Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | ### Return type diff --git a/gateapi/docs/SnapshotControllerApi.md b/gateapi/docs/SnapshotControllerApi.md index 2cfe0b5b..b397bb91 100644 --- a/gateapi/docs/SnapshotControllerApi.md +++ b/gateapi/docs/SnapshotControllerApi.md @@ -16,7 +16,7 @@ Get current snapshot Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | @@ -43,19 +43,19 @@ Get snapshot history Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **account** | **string**| account | **application** | **string**| application | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***SnapshotControllerApiGetSnapshotHistoryUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a SnapshotControllerApiGetSnapshotHistoryUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account** | **string**| account | - **application** | **string**| application | - **limit** | **int32**| limit | [default to 20] + + + **limit** | **optional.Int32**| limit | [default to 20] ### Return type diff --git a/gateapi/docs/SubnetControllerApi.md b/gateapi/docs/SubnetControllerApi.md index d6448d63..af86f283 100644 --- a/gateapi/docs/SubnetControllerApi.md +++ b/gateapi/docs/SubnetControllerApi.md @@ -15,7 +15,7 @@ Retrieve a list of subnets for a given cloud provider Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **cloudProvider** | **string**| cloudProvider | ### Return type diff --git a/gateapi/docs/TaskControllerApi.md b/gateapi/docs/TaskControllerApi.md index afdebe0b..319bcb68 100644 --- a/gateapi/docs/TaskControllerApi.md +++ b/gateapi/docs/TaskControllerApi.md @@ -20,7 +20,7 @@ Cancel task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -46,7 +46,7 @@ Cancel tasks Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **ids** | [**[]string**](string.md)| ids | ### Return type @@ -72,7 +72,7 @@ Delete task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -98,19 +98,19 @@ Get task details Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **taskDetailsId** | **string**| taskDetailsId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***TaskControllerApiGetTaskDetailsUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a TaskControllerApiGetTaskDetailsUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **taskDetailsId** | **string**| taskDetailsId | - **xRateLimitApp** | **string**| X-RateLimit-App | + + + **xRateLimitApp** | **optional.String**| X-RateLimit-App | ### Return type @@ -135,7 +135,7 @@ Get task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -161,7 +161,7 @@ Create task Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **map_** | [**interface{}**](interface{}.md)| map | ### Return type diff --git a/gateapi/docs/V2CanaryConfigControllerApi.md b/gateapi/docs/V2CanaryConfigControllerApi.md index bdc5c9e7..8ed7c8c6 100644 --- a/gateapi/docs/V2CanaryConfigControllerApi.md +++ b/gateapi/docs/V2CanaryConfigControllerApi.md @@ -19,17 +19,17 @@ Create a canary configuration Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **config** | [**interface{}**](interface{}.md)| config | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **config** | [**interface{}**](interface{}.md)| config | - **configurationAccountName** | **string**| configurationAccountName | + + **configurationAccountName** | **optional.String**| configurationAccountName | ### Return type @@ -54,17 +54,17 @@ Delete a canary configuration Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **configurationAccountName** | **string**| configurationAccountName | + + **configurationAccountName** | **optional.String**| configurationAccountName | ### Return type @@ -89,17 +89,17 @@ Retrieve a canary configuration by id Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **configurationAccountName** | **string**| configurationAccountName | + + **configurationAccountName** | **optional.String**| configurationAccountName | ### Return type @@ -124,16 +124,16 @@ Retrieve a list of canary configurations Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **configurationAccountName** | **string**| configurationAccountName | + **application** | **optional.String**| application | + **configurationAccountName** | **optional.String**| configurationAccountName | ### Return type @@ -158,19 +158,19 @@ Update a canary configuration Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **config** | [**interface{}**](interface{}.md)| config | **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **config** | [**interface{}**](interface{}.md)| config | - **id** | **string**| id | - **configurationAccountName** | **string**| configurationAccountName | + + + **configurationAccountName** | **optional.String**| configurationAccountName | ### Return type diff --git a/gateapi/docs/V2CanaryControllerApi.md b/gateapi/docs/V2CanaryControllerApi.md index af95b237..72f35ea7 100644 --- a/gateapi/docs/V2CanaryControllerApi.md +++ b/gateapi/docs/V2CanaryControllerApi.md @@ -23,19 +23,19 @@ Method | HTTP request | Description Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **canaryConfigId** | **string**| canaryConfigId | **canaryExecutionId** | **string**| canaryExecutionId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiGetCanaryResultUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiGetCanaryResultUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **canaryConfigId** | **string**| canaryConfigId | - **canaryExecutionId** | **string**| canaryExecutionId | - **storageAccountName** | **string**| storageAccountName | + + + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -60,17 +60,17 @@ Retrieve a canary result Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **canaryExecutionId** | **string**| canaryExecutionId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiGetCanaryResultUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiGetCanaryResultUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **canaryExecutionId** | **string**| canaryExecutionId | - **storageAccountName** | **string**| storageAccountName | + + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -95,20 +95,20 @@ Retrieve a list of an application's canary results Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **application** | **string**| application | **limit** | **int32**| limit | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiGetCanaryResultsByApplicationUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiGetCanaryResultsByApplicationUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **application** | **string**| application | - **limit** | **int32**| limit | - **statuses** | **string**| Comma-separated list of statuses, e.g.: RUNNING, SUCCEEDED, TERMINAL | - **storageAccountName** | **string**| storageAccountName | + + + **statuses** | **optional.String**| Comma-separated list of statuses, e.g.: RUNNING, SUCCEEDED, TERMINAL | + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -133,17 +133,17 @@ Retrieve a metric set pair list Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **metricSetPairListId** | **string**| metricSetPairListId | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiGetMetricSetPairListUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiGetMetricSetPairListUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **metricSetPairListId** | **string**| metricSetPairListId | - **storageAccountName** | **string**| storageAccountName | + + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -168,23 +168,23 @@ Start a canary execution Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **canaryConfigId** | **string**| canaryConfigId | **executionRequest** | [**interface{}**](interface{}.md)| executionRequest | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiInitiateCanaryUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiInitiateCanaryUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **canaryConfigId** | **string**| canaryConfigId | - **executionRequest** | [**interface{}**](interface{}.md)| executionRequest | - **application** | **string**| application | - **configurationAccountName** | **string**| configurationAccountName | - **metricsAccountName** | **string**| metricsAccountName | - **parentPipelineExecutionId** | **string**| parentPipelineExecutionId | - **storageAccountName** | **string**| storageAccountName | + + + **application** | **optional.String**| application | + **configurationAccountName** | **optional.String**| configurationAccountName | + **metricsAccountName** | **optional.String**| metricsAccountName | + **parentPipelineExecutionId** | **optional.String**| parentPipelineExecutionId | + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -209,20 +209,20 @@ Start a canary execution with the supplied canary config Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **adhocExecutionRequest** | [**interface{}**](interface{}.md)| adhocExecutionRequest | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **adhocExecutionRequest** | [**interface{}**](interface{}.md)| adhocExecutionRequest | - **application** | **string**| application | - **metricsAccountName** | **string**| metricsAccountName | - **parentPipelineExecutionId** | **string**| parentPipelineExecutionId | - **storageAccountName** | **string**| storageAccountName | + + **application** | **optional.String**| application | + **metricsAccountName** | **optional.String**| metricsAccountName | + **parentPipelineExecutionId** | **optional.String**| parentPipelineExecutionId | + **storageAccountName** | **optional.String**| storageAccountName | ### Return type @@ -291,16 +291,16 @@ Retrieve a list of descriptors for use in populating the canary config ui Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***V2CanaryControllerApiListMetricsServiceMetadataUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2CanaryControllerApiListMetricsServiceMetadataUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **string**| filter | - **metricsAccountName** | **string**| metricsAccountName | + **filter** | **optional.String**| filter | + **metricsAccountName** | **optional.String**| metricsAccountName | ### Return type diff --git a/gateapi/docs/V2PipelineTemplatesControllerApi.md b/gateapi/docs/V2PipelineTemplatesControllerApi.md index fed5da56..44e742ae 100644 --- a/gateapi/docs/V2PipelineTemplatesControllerApi.md +++ b/gateapi/docs/V2PipelineTemplatesControllerApi.md @@ -22,17 +22,17 @@ Method | HTTP request | Description Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2PipelineTemplatesControllerApiCreateUsingPOST1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiCreateUsingPOST1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **tag** | **string**| tag | + + **tag** | **optional.String**| tag | ### Return type @@ -57,19 +57,19 @@ Delete a pipeline template. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **application** | **string**| application | - **digest** | **string**| digest | - **tag** | **string**| tag | + + **application** | **optional.String**| application | + **digest** | **optional.String**| digest | + **tag** | **optional.String**| tag | ### Return type @@ -94,18 +94,18 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2PipelineTemplatesControllerApiGetUsingGET2Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiGetUsingGET2Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **digest** | **string**| digest | - **tag** | **string**| tag | + + **digest** | **optional.String**| digest | + **tag** | **optional.String**| tag | ### Return type @@ -130,7 +130,7 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | ### Return type @@ -156,15 +156,15 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***V2PipelineTemplatesControllerApiListUsingGET1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiListUsingGET1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **scopes** | [**[]string**](string.md)| scopes | + **scopes** | [**optional.Interface of []string**](string.md)| scopes | ### Return type @@ -189,15 +189,15 @@ List pipeline templates with versions Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***V2PipelineTemplatesControllerApiListVersionsUsingGETOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiListVersionsUsingGETOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **scopes** | [**[]string**](string.md)| scopes | + **scopes** | [**optional.Interface of []string**](string.md)| scopes | ### Return type @@ -222,7 +222,7 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **pipeline** | [**interface{}**](interface{}.md)| pipeline | ### Return type @@ -248,20 +248,20 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| id | **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| id | - **pipelineTemplate** | [**interface{}**](interface{}.md)| pipelineTemplate | - **skipPlanDependents** | **bool**| skipPlanDependents | [default to false] - **tag** | **string**| tag | + + + **skipPlanDependents** | **optional.Bool**| skipPlanDependents | [default to false] + **tag** | **optional.String**| tag | ### Return type diff --git a/gateapi/docs/WebhookControllerApi.md b/gateapi/docs/WebhookControllerApi.md index 97e2554a..ae990e76 100644 --- a/gateapi/docs/WebhookControllerApi.md +++ b/gateapi/docs/WebhookControllerApi.md @@ -38,21 +38,21 @@ Endpoint for posting webhooks to Spinnaker's webhook service Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **source** | **string**| source | **type_** | **string**| type | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + **optional** | ***WebhookControllerApiWebhooksUsingPOSTOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a map[string]interface{}. +Optional parameters are passed through a pointer to a WebhookControllerApiWebhooksUsingPOSTOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **string**| source | - **type_** | **string**| type | - **xEventKey** | **string**| X-Event-Key | - **xHubSignature** | **string**| X-Hub-Signature | - **event** | [**interface{}**](interface{}.md)| event | + + + **xEventKey** | **optional.String**| X-Event-Key | + **xHubSignature** | **optional.String**| X-Hub-Signature | + **event** | [**optional.Interface of interface{}**](interface{}.md)| event | ### Return type diff --git a/gateapi/executions_controller_api.go b/gateapi/executions_controller_api.go deleted file mode 100644 index 32c8949d..00000000 --- a/gateapi/executions_controller_api.go +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ExecutionsControllerApiService service - - -/* ExecutionsControllerApiService Retrieves an ad-hoc collection of executions based on a number of user-supplied parameters. Either executionIds or pipelineConfigIds must be supplied in order to return any results. If both are supplied, an exception will be thrown. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "executionIds" (string) A comma-separated list of executions to retrieve. Either this OR pipelineConfigIds must be supplied, but not both. - @param "expand" (bool) Expands each execution object in the resulting list. If this value is missing, it is defaulted to true. - @param "limit" (int32) The number of executions to return per pipeline configuration. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to 1. - @param "pipelineConfigIds" (string) A comma-separated list of pipeline configuration IDs to retrieve recent executions for. Either this OR pipelineConfigIds must be supplied, but not both. - @param "statuses" (string) A comma-separated list of execution statuses to filter by. Ignored if executionIds parameter is supplied. If this value is missing, it is defaulted to all statuses. - @return []interface{}*/ -func (a *ExecutionsControllerApiService) GetLatestExecutionsByConfigIdsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/executions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["executionIds"], "string", "executionIds"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["expand"], "bool", "expand"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["pipelineConfigIds"], "string", "pipelineConfigIds"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["executionIds"].(string); localVarOk { - localVarQueryParams.Add("executionIds", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["expand"].(bool); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["pipelineConfigIds"].(string); localVarOk { - localVarQueryParams.Add("pipelineConfigIds", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ExecutionsControllerApiService Search for pipeline executions using a combination of criteria. The returned list is sorted by buildTime (trigger time) in reverse order so that newer executions are first in the list. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application Only includes executions that are part of this application. If this value is \"*\", results will include executions of all applications. - @param optional (nil or map[string]interface{}) with one or more of: - @param "eventId" (string) Only includes executions that were triggered by a trigger with this eventId. - @param "expand" (bool) Expands each execution object in the resulting list. If this value is missing, it is defaulted to false. - @param "pipelineName" (string) Only includes executions that with this pipeline name. - @param "reverse" (bool) Reverses the resulting list before it is paginated. If this value is missing, it is defaulted to false. - @param "size" (int32) Sets the size of the resulting list for pagination. This value must be > 0. If this value is missing, it is defaulted to 10. - @param "startIndex" (int32) Sets the first item of the resulting list for pagination. The list is 0-indexed. This value must be >= 0. If this value is missing, it is defaulted to 0. - @param "statuses" (string) Only includes executions with a status that is equal to a status provided in this field. The list of statuses should be given as a comma-delimited string. If this value is missing, includes executions of all statuses. Allowed statuses are: NOT_STARTED, RUNNING, PAUSED, SUSPENDED, SUCCEEDED, FAILED_CONTINUE, TERMINAL, CANCELED, REDIRECT, STOPPED, SKIPPED, BUFFERED. - @param "trigger" (string) Only includes executions that were triggered by a trigger that matches the subset of fields provided by this value. This value should be a base64-encoded string of a JSON representation of a trigger object. The comparison succeeds if the execution trigger contains all the fields of the input trigger, the fields are of the same type, and each value of the field \"matches\". The term \"matches\" is specific for each field's type: - For Strings: A String value in the execution's trigger matches the input trigger's String value if the former equals the latter (case-insensitive) OR if the former matches the latter as a regular expression. - For Maps: A Map value in the execution's trigger matches the input trigger's Map value if the former contains all keys of the latter and their values match. - For Collections: A Collection value in the execution's trigger matches the input trigger's Collection value if the former has a unique element that matches each element of the latter. - Every other value is compared using the Java \"equals\" method (Groovy \"==\" operator) - @param "triggerTimeEndBoundary" (int64) Only includes executions that were built at or before the given time, represented as a Unix timestamp in ms (UTC). This value must be <= 9223372036854775807 (Long.MAX_VALUE) and >= the value of [triggerTimeStartBoundary], if provided. If this value is missing, it is defaulted to 9223372036854775807. - @param "triggerTimeStartBoundary" (int64) Only includes executions that were built at or after the given time, represented as a Unix timestamp in ms (UTC). This value must be >= 0 and <= the value of [triggerTimeEndBoundary], if provided. If this value is missing, it is defaulted to 0. - @param "triggerTypes" (string) Only includes executions that were triggered by a trigger with a type that is equal to a type provided in this field. The list of trigger types should be a comma-delimited string. If this value is missing, results will includes executions of all trigger types. - @return []interface{}*/ -func (a *ExecutionsControllerApiService) SearchForPipelineExecutionsByTriggerUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/executions/search" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["eventId"], "string", "eventId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["expand"], "bool", "expand"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["pipelineName"], "string", "pipelineName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["reverse"], "bool", "reverse"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["size"], "int32", "size"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["startIndex"], "int32", "startIndex"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["trigger"], "string", "trigger"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["triggerTimeEndBoundary"], "int64", "triggerTimeEndBoundary"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["triggerTimeStartBoundary"], "int64", "triggerTimeStartBoundary"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["triggerTypes"], "string", "triggerTypes"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["eventId"].(string); localVarOk { - localVarQueryParams.Add("eventId", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["expand"].(bool); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["pipelineName"].(string); localVarOk { - localVarQueryParams.Add("pipelineName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["reverse"].(bool); localVarOk { - localVarQueryParams.Add("reverse", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["size"].(int32); localVarOk { - localVarQueryParams.Add("size", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["startIndex"].(int32); localVarOk { - localVarQueryParams.Add("startIndex", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["trigger"].(string); localVarOk { - localVarQueryParams.Add("trigger", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["triggerTimeEndBoundary"].(int64); localVarOk { - localVarQueryParams.Add("triggerTimeEndBoundary", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["triggerTimeStartBoundary"].(int64); localVarOk { - localVarQueryParams.Add("triggerTimeStartBoundary", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["triggerTypes"].(string); localVarOk { - localVarQueryParams.Add("triggerTypes", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/firewall_controller_api.go b/gateapi/firewall_controller_api.go deleted file mode 100644 index cfc4e2c6..00000000 --- a/gateapi/firewall_controller_api.go +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type FirewallControllerApiService service - - -/* FirewallControllerApiService Retrieve a list of firewalls for a given account and region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return []interface{}*/ -func (a *FirewallControllerApiService) AllByAccountAndRegionUsingGET(ctx context.Context, account string, region string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/firewalls/{account}/{region}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* FirewallControllerApiService Retrieve a list of firewalls for a given account, grouped by region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return interface{}*/ -func (a *FirewallControllerApiService) AllByAccountUsingGET(ctx context.Context, account string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/firewalls/{account}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* FirewallControllerApiService Retrieve a list of firewalls, grouped by account, cloud provider, and region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "id" (string) id - @return interface{}*/ -func (a *FirewallControllerApiService) AllUsingGET1(ctx context.Context, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/firewalls" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["id"], "string", "id"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["id"].(string); localVarOk { - localVarQueryParams.Add("id", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* FirewallControllerApiService Retrieve a firewall's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param name name - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @param "vpcId" (string) vpcId - @return interface{}*/ -func (a *FirewallControllerApiService) GetSecurityGroupUsingGET(ctx context.Context, account string, name string, region string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/firewalls/{account}/{region}/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["vpcId"], "string", "vpcId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["vpcId"].(string); localVarOk { - localVarQueryParams.Add("vpcId", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/image_controller_api.go b/gateapi/image_controller_api.go deleted file mode 100644 index c13c97c7..00000000 --- a/gateapi/image_controller_api.go +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ImageControllerApiService service - - -/* ImageControllerApiService Retrieve a list of images, filtered by cloud provider, region, and account - The query parameter `q` filters the list of images by image name - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "account" (string) account - @param "count" (int32) count - @param "provider" (string) provider - @param "q" (string) q - @param "region" (string) region - @return []interface{}*/ -func (a *ImageControllerApiService) FindImagesUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/find" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["account"], "string", "account"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["count"], "int32", "count"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["q"], "string", "q"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["region"], "string", "region"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["account"].(string); localVarOk { - localVarQueryParams.Add("account", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["count"].(int32); localVarOk { - localVarQueryParams.Add("count", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["q"].(string); localVarOk { - localVarQueryParams.Add("q", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["region"].(string); localVarOk { - localVarQueryParams.Add("region", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ImageControllerApiService Find tags - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param repository repository - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return []interface{}*/ -func (a *ImageControllerApiService) FindTagsUsingGET(ctx context.Context, account string, repository string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/tags" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("account", parameterToString(account, "")) - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("repository", parameterToString(repository, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ImageControllerApiService Get image details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param imageId imageId - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return []interface{}*/ -func (a *ImageControllerApiService) GetImageDetailsUsingGET(ctx context.Context, account string, imageId string, region string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/images/{account}/{region}/{imageId}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", fmt.Sprintf("%v", imageId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/instance_controller_api.go b/gateapi/instance_controller_api.go deleted file mode 100644 index 8d146c11..00000000 --- a/gateapi/instance_controller_api.go +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type InstanceControllerApiService service - - -/* InstanceControllerApiService Retrieve an instance's console output - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param instanceId instanceId - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return interface{}*/ -func (a *InstanceControllerApiService) GetConsoleOutputUsingGET(ctx context.Context, account string, instanceId string, region string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/instances/{account}/{region}/{instanceId}/console" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", fmt.Sprintf("%v", instanceId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* InstanceControllerApiService Retrieve an instance's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param instanceId instanceId - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return interface{}*/ -func (a *InstanceControllerApiService) GetInstanceDetailsUsingGET(ctx context.Context, account string, instanceId string, region string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/instances/{account}/{region}/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", fmt.Sprintf("%v", instanceId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/job_controller_api.go b/gateapi/job_controller_api.go deleted file mode 100644 index 88c4e8ea..00000000 --- a/gateapi/job_controller_api.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type JobControllerApiService service - - -/* JobControllerApiService Get job - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param applicationName applicationName - @param name name - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "expand" (string) expand - @return map[string]interface{}*/ -func (a *JobControllerApiService) GetJobUsingGET(ctx context.Context, account string, applicationName string, name string, region string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/jobs/{account}/{region}/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["expand"], "string", "expand"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["expand"].(string); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/load_balancer_controller_api.go b/gateapi/load_balancer_controller_api.go deleted file mode 100644 index cca97d16..00000000 --- a/gateapi/load_balancer_controller_api.go +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type LoadBalancerControllerApiService service - - -/* LoadBalancerControllerApiService Retrieve a list of load balancers for a given cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return []interface{}*/ -func (a *LoadBalancerControllerApiService) GetAllUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/loadBalancers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LoadBalancerControllerApiService Retrieve a list of load balancers for a given application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *LoadBalancerControllerApiService) GetApplicationLoadBalancersUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/loadBalancers" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LoadBalancerControllerApiService Retrieve a load balancer's details as a single element list for a given account, region, cloud provider and load balancer name - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param name name - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return []interface{}*/ -func (a *LoadBalancerControllerApiService) GetLoadBalancerDetailsUsingGET(ctx context.Context, account string, name string, region string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/loadBalancers/{account}/{region}/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LoadBalancerControllerApiService Retrieve a load balancer for a given cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name name - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return map[string]interface{}*/ -func (a *LoadBalancerControllerApiService) GetLoadBalancerUsingGET(ctx context.Context, name string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/loadBalancers/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/managed_controller_api.go b/gateapi/managed_controller_api.go deleted file mode 100644 index 8b6539a3..00000000 --- a/gateapi/managed_controller_api.go +++ /dev/null @@ -1,1639 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ManagedControllerApiService service - - -/* ManagedControllerApiService Create a pin for an artifact in an environment - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pin pin - @return */ -func (a *ManagedControllerApiService) CreatePinUsingPOST(ctx context.Context, application string, pin EnvironmentArtifactPin) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pin" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pin - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Delete a delivery config manifest for an application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return DeliveryConfig*/ -func (a *ManagedControllerApiService) DeleteManifestByAppUsingDELETE(ctx context.Context, application string) (DeliveryConfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DeliveryConfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/config" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Delete a delivery config manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name name - @return DeliveryConfig*/ -func (a *ManagedControllerApiService) DeleteManifestUsingDELETE(ctx context.Context, name string) (DeliveryConfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DeliveryConfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Unpin one or more artifact(s) in an environment. If the `reference` parameter is specified, only the corresponding artifact will be unpinned. If it's omitted, all pinned artifacts in the environment will be unpinned. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param targetEnvironment targetEnvironment - @param optional (nil or map[string]interface{}) with one or more of: - @param "reference" (string) reference - @return */ -func (a *ManagedControllerApiService) DeletePinUsingDELETE(ctx context.Context, application string, targetEnvironment string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pin/{targetEnvironment}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"targetEnvironment"+"}", fmt.Sprintf("%v", targetEnvironment), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["reference"], "string", "reference"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["reference"].(string); localVarOk { - localVarQueryParams.Add("reference", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Veto an artifact version in an environment - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param reference reference - @param targetEnvironment targetEnvironment - @param version version - @return */ -func (a *ManagedControllerApiService) DeleteVetoUsingDELETE(ctx context.Context, application string, reference string, targetEnvironment string, version string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/veto/{targetEnvironment}/{reference}/{version}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"reference"+"}", fmt.Sprintf("%v", reference), -1) - localVarPath = strings.Replace(localVarPath, "{"+"targetEnvironment"+"}", fmt.Sprintf("%v", targetEnvironment), -1) - localVarPath = strings.Replace(localVarPath, "{"+"version"+"}", fmt.Sprintf("%v", version), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Ad-hoc validate and diff a config manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @param manifest manifest - @return interface{}*/ -func (a *ManagedControllerApiService) DiffManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/diff" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/x-yaml", } - - // 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 = &manifest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Ad-hoc validate and diff a resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param resource resource - @return interface{}*/ -func (a *ManagedControllerApiService) DiffResourceUsingPOST(ctx context.Context, resource Resource) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/diff" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/x-yaml", } - - // 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 = &resource - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Generates an artifact definition based on the artifact used in a running cluster - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param cloudProvider cloudProvider - @param clusterName clusterName - @return interface{}*/ -func (a *ManagedControllerApiService) ExportResourceUsingGET(ctx context.Context, account string, cloudProvider string, clusterName string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/export/artifact/{cloudProvider}/{account}/{clusterName}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", fmt.Sprintf("%v", clusterName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Generate a keel resource definition for a deployed cloud resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param cloudProvider cloudProvider - @param name name - @param serviceAccount serviceAccount - @param type_ type - @return Resource*/ -func (a *ManagedControllerApiService) ExportResourceUsingGET1(ctx context.Context, account string, cloudProvider string, name string, serviceAccount string, type_ string) (Resource, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Resource - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/export/{cloudProvider}/{account}/{type}/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("serviceAccount", parameterToString(serviceAccount, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService getApiDocs - * @param ctx context.Context for authentication, logging, tracing, etc. - @return interface{}*/ -func (a *ManagedControllerApiService) GetApiDocsUsingGET(ctx context.Context) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/api-docs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get managed details about an application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "entities" ([]string) entities - @param "includeDetails" (bool) includeDetails - @return interface{}*/ -func (a *ManagedControllerApiService) GetApplicationDetailsUsingGET(ctx context.Context, application string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["includeDetails"], "bool", "includeDetails"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["entities"].([]string); localVarOk { - localVarQueryParams.Add("entities", parameterToString(localVarTempParam, "multi")) - } - if localVarTempParam, localVarOk := localVarOptionals["includeDetails"].(bool); localVarOk { - localVarQueryParams.Add("includeDetails", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get the delivery config associated with an application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return DeliveryConfig*/ -func (a *ManagedControllerApiService) GetConfigByUsingGET(ctx context.Context, application string) (DeliveryConfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DeliveryConfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/config" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService List up-to {limit} current constraint states for an environment - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param environment environment - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (string) limit - @return ConstraintState*/ -func (a *ManagedControllerApiService) GetConstraintStateUsingGET(ctx context.Context, application string, environment string, localVarOptionals map[string]interface{}) (ConstraintState, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ConstraintState - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/environment/{environment}/constraints" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"environment"+"}", fmt.Sprintf("%v", environment), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "string", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(string); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get the status of each version of each artifact in each environment - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name name - @return []interface{}*/ -func (a *ManagedControllerApiService) GetManifestArtifactsUsingGET(ctx context.Context, name string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}/artifacts" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get a delivery config manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name name - @return DeliveryConfig*/ -func (a *ManagedControllerApiService) GetManifestUsingGET(ctx context.Context, name string) (DeliveryConfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DeliveryConfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get status of a resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param resourceId resourceId - @return interface{}*/ -func (a *ManagedControllerApiService) GetResourceStatusUsingGET(ctx context.Context, resourceId string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/status" - localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Get a resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param resourceId resourceId - @return Resource*/ -func (a *ManagedControllerApiService) GetResourceUsingGET(ctx context.Context, resourceId string) (Resource, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Resource - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}" - localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Pause management of an entire application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return */ -func (a *ManagedControllerApiService) PauseApplicationUsingPOST(ctx context.Context, application string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pause" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Pause management of a resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param resourceId resourceId - @return */ -func (a *ManagedControllerApiService) PauseResourceUsingPOST(ctx context.Context, resourceId string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/pause" - localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Resume management of an entire application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @return */ -func (a *ManagedControllerApiService) ResumeApplicationUsingDELETE(ctx context.Context, application string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/pause" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Resume management of a resource - * @param ctx context.Context for authentication, logging, tracing, etc. - @param resourceId resourceId - @return */ -func (a *ManagedControllerApiService) ResumeResourceUsingDELETE(ctx context.Context, resourceId string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/resources/{resourceId}/pause" - localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Update the status of an environment constraint - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param environment environment - @param status status - @return */ -func (a *ManagedControllerApiService) UpdateConstraintStatusUsingPOST(ctx context.Context, application string, environment string, status ConstraintStatus) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/environment/{environment}/constraint" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"environment"+"}", fmt.Sprintf("%v", environment), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &status - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ManagedControllerApiService Create or update a delivery config manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @param manifest manifest - @return DeliveryConfig*/ -func (a *ManagedControllerApiService) UpsertManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (DeliveryConfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DeliveryConfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/x-yaml", } - - // 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 = &manifest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Validate a delivery config manifest - * @param ctx context.Context for authentication, logging, tracing, etc. - @param manifest manifest - @return interface{}*/ -func (a *ManagedControllerApiService) ValidateManifestUsingPOST(ctx context.Context, manifest DeliveryConfig) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/delivery-configs/validate" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/x-yaml", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - "application/x-yaml", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &manifest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ManagedControllerApiService Veto an artifact version in an environment - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param veto veto - @return */ -func (a *ManagedControllerApiService) VetoUsingPOST(ctx context.Context, application string, veto EnvironmentArtifactVeto) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/managed/application/{application}/veto" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &veto - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/gateapi/account.go b/gateapi/model_account.go similarity index 99% rename from gateapi/account.go rename to gateapi/model_account.go index 85f69058..2efa2748 100644 --- a/gateapi/account.go +++ b/gateapi/model_account.go @@ -10,14 +10,9 @@ package swagger type Account struct { - AccountId string `json:"accountId,omitempty"` - Name string `json:"name,omitempty"` - Permissions map[string][]string `json:"permissions,omitempty"` - RequiredGroupMembership []string `json:"requiredGroupMembership,omitempty"` - Type_ string `json:"type,omitempty"` } diff --git a/gateapi/account_details.go b/gateapi/model_account_details.go similarity index 98% rename from gateapi/account_details.go rename to gateapi/model_account_details.go index 92ed2d51..0c2ce610 100644 --- a/gateapi/account_details.go +++ b/gateapi/model_account_details.go @@ -10,24 +10,14 @@ package swagger type AccountDetails struct { - AccountId string `json:"accountId,omitempty"` - AccountType string `json:"accountType,omitempty"` - ChallengeDestructiveActions bool `json:"challengeDestructiveActions,omitempty"` - CloudProvider string `json:"cloudProvider,omitempty"` - Environment string `json:"environment,omitempty"` - Name string `json:"name,omitempty"` - Permissions map[string][]string `json:"permissions,omitempty"` - PrimaryAccount bool `json:"primaryAccount,omitempty"` - RequiredGroupMembership []string `json:"requiredGroupMembership,omitempty"` - Type_ string `json:"type,omitempty"` } diff --git a/gateapi/constraint_state.go b/gateapi/model_constraint_state.go similarity index 98% rename from gateapi/constraint_state.go rename to gateapi/model_constraint_state.go index 9847fdea..b21253ff 100644 --- a/gateapi/constraint_state.go +++ b/gateapi/model_constraint_state.go @@ -10,24 +10,14 @@ package swagger type ConstraintState struct { - ArtifactVersion string `json:"artifactVersion,omitempty"` - Attributes *interface{} `json:"attributes,omitempty"` - Comment string `json:"comment,omitempty"` - CreatedAt string `json:"createdAt,omitempty"` - DeliveryConfigName string `json:"deliveryConfigName,omitempty"` - EnvironmentName string `json:"environmentName,omitempty"` - JudgedAt string `json:"judgedAt,omitempty"` - JudgedBy string `json:"judgedBy,omitempty"` - Status string `json:"status,omitempty"` - Type_ string `json:"type,omitempty"` } diff --git a/gateapi/constraint_status.go b/gateapi/model_constraint_status.go similarity index 99% rename from gateapi/constraint_status.go rename to gateapi/model_constraint_status.go index c0d2a84f..7f99ff53 100644 --- a/gateapi/constraint_status.go +++ b/gateapi/model_constraint_status.go @@ -10,12 +10,8 @@ package swagger type ConstraintStatus struct { - ArtifactVersion string `json:"artifactVersion,omitempty"` - Comment string `json:"comment,omitempty"` - Status string `json:"status,omitempty"` - Type_ string `json:"type,omitempty"` } diff --git a/gateapi/deck_plugin_version.go b/gateapi/model_deck_plugin_version.go similarity index 99% rename from gateapi/deck_plugin_version.go rename to gateapi/model_deck_plugin_version.go index 32cc2b61..5151a7a6 100644 --- a/gateapi/deck_plugin_version.go +++ b/gateapi/model_deck_plugin_version.go @@ -10,8 +10,6 @@ package swagger type DeckPluginVersion struct { - Id string `json:"id"` - Version string `json:"version"` } diff --git a/gateapi/delivery_config.go b/gateapi/model_delivery_config.go similarity index 99% rename from gateapi/delivery_config.go rename to gateapi/model_delivery_config.go index dd60f0db..a09a49b6 100644 --- a/gateapi/delivery_config.go +++ b/gateapi/model_delivery_config.go @@ -10,16 +10,10 @@ package swagger type DeliveryConfig struct { - ApiVersion string `json:"apiVersion,omitempty"` - Application string `json:"application,omitempty"` - Artifacts []Mapstringobject `json:"artifacts,omitempty"` - Environments []Environment `json:"environments,omitempty"` - Name string `json:"name,omitempty"` - ServiceAccount string `json:"serviceAccount,omitempty"` } diff --git a/gateapi/environment.go b/gateapi/model_environment.go similarity index 99% rename from gateapi/environment.go rename to gateapi/model_environment.go index e8031ffb..99ae51b4 100644 --- a/gateapi/environment.go +++ b/gateapi/model_environment.go @@ -10,14 +10,9 @@ package swagger type Environment struct { - Constraints []Mapstringobject `json:"constraints,omitempty"` - Locations *interface{} `json:"locations,omitempty"` - Name string `json:"name,omitempty"` - Notifications []Notification `json:"notifications,omitempty"` - Resources []Resource `json:"resources,omitempty"` } diff --git a/gateapi/environment_artifact_pin.go b/gateapi/model_environment_artifact_pin.go similarity index 99% rename from gateapi/environment_artifact_pin.go rename to gateapi/model_environment_artifact_pin.go index 402c52c1..c22829ed 100644 --- a/gateapi/environment_artifact_pin.go +++ b/gateapi/model_environment_artifact_pin.go @@ -10,14 +10,9 @@ package swagger type EnvironmentArtifactPin struct { - Comment string `json:"comment,omitempty"` - PinnedBy string `json:"pinnedBy,omitempty"` - Reference string `json:"reference,omitempty"` - TargetEnvironment string `json:"targetEnvironment,omitempty"` - Version string `json:"version,omitempty"` } diff --git a/gateapi/environment_artifact_veto.go b/gateapi/model_environment_artifact_veto.go similarity index 99% rename from gateapi/environment_artifact_veto.go rename to gateapi/model_environment_artifact_veto.go index 426084b0..28bc9778 100644 --- a/gateapi/environment_artifact_veto.go +++ b/gateapi/model_environment_artifact_veto.go @@ -10,12 +10,8 @@ package swagger type EnvironmentArtifactVeto struct { - Comment string `json:"comment,omitempty"` - Reference string `json:"reference,omitempty"` - TargetEnvironment string `json:"targetEnvironment,omitempty"` - Version string `json:"version,omitempty"` } diff --git a/gateapi/file.go b/gateapi/model_file.go similarity index 98% rename from gateapi/file.go rename to gateapi/model_file.go index 6b5b300b..2e3ee43f 100644 --- a/gateapi/file.go +++ b/gateapi/model_file.go @@ -14,42 +14,23 @@ import ( ) type File struct { - Absolute bool `json:"absolute,omitempty"` - AbsoluteFile **os.File `json:"absoluteFile,omitempty"` - AbsolutePath string `json:"absolutePath,omitempty"` - CanonicalFile **os.File `json:"canonicalFile,omitempty"` - CanonicalPath string `json:"canonicalPath,omitempty"` - Directory bool `json:"directory,omitempty"` - Executable bool `json:"executable,omitempty"` - File bool `json:"file,omitempty"` - FreeSpace int64 `json:"freeSpace,omitempty"` - Hidden bool `json:"hidden,omitempty"` - LastModified int64 `json:"lastModified,omitempty"` - Name string `json:"name,omitempty"` - Parent string `json:"parent,omitempty"` - ParentFile **os.File `json:"parentFile,omitempty"` - Path string `json:"path,omitempty"` - Readable bool `json:"readable,omitempty"` - TotalSpace int64 `json:"totalSpace,omitempty"` - UsableSpace int64 `json:"usableSpace,omitempty"` - Writable bool `json:"writable,omitempty"` } diff --git a/gateapi/granted_authority.go b/gateapi/model_granted_authority.go similarity index 99% rename from gateapi/granted_authority.go rename to gateapi/model_granted_authority.go index d8c6265b..92d310b2 100644 --- a/gateapi/granted_authority.go +++ b/gateapi/model_granted_authority.go @@ -10,6 +10,5 @@ package swagger type GrantedAuthority struct { - Authority string `json:"authority,omitempty"` } diff --git a/gateapi/hash_mapstringobject.go b/gateapi/model_hash_mapstringobject.go similarity index 100% rename from gateapi/hash_mapstringobject.go rename to gateapi/model_hash_mapstringobject.go diff --git a/gateapi/http_entity.go b/gateapi/model_http_entity.go similarity index 99% rename from gateapi/http_entity.go rename to gateapi/model_http_entity.go index fa788d0d..6804b220 100644 --- a/gateapi/http_entity.go +++ b/gateapi/model_http_entity.go @@ -10,6 +10,5 @@ package swagger type HttpEntity struct { - Body *interface{} `json:"body,omitempty"` } diff --git a/gateapi/input_stream.go b/gateapi/model_input_stream.go similarity index 100% rename from gateapi/input_stream.go rename to gateapi/model_input_stream.go diff --git a/gateapi/mapstringobject.go b/gateapi/model_mapstringobject.go similarity index 100% rename from gateapi/mapstringobject.go rename to gateapi/model_mapstringobject.go diff --git a/gateapi/mapstringstring.go b/gateapi/model_mapstringstring.go similarity index 100% rename from gateapi/mapstringstring.go rename to gateapi/model_mapstringstring.go diff --git a/gateapi/notification.go b/gateapi/model_notification.go similarity index 99% rename from gateapi/notification.go rename to gateapi/model_notification.go index 3122233e..57e54f12 100644 --- a/gateapi/notification.go +++ b/gateapi/model_notification.go @@ -10,10 +10,7 @@ package swagger type Notification struct { - Address string `json:"address,omitempty"` - Frequency string `json:"frequency,omitempty"` - Type_ string `json:"type,omitempty"` } diff --git a/gateapi/pipeline_template_dependent.go b/gateapi/model_pipeline_template_dependent.go similarity index 99% rename from gateapi/pipeline_template_dependent.go rename to gateapi/model_pipeline_template_dependent.go index 82d94bff..bb614574 100644 --- a/gateapi/pipeline_template_dependent.go +++ b/gateapi/model_pipeline_template_dependent.go @@ -10,10 +10,7 @@ package swagger type PipelineTemplateDependent struct { - Application string `json:"application,omitempty"` - PipelineConfigId string `json:"pipelineConfigId,omitempty"` - PipelineName string `json:"pipelineName,omitempty"` } diff --git a/gateapi/plugin_dependency.go b/gateapi/model_plugin_dependency.go similarity index 99% rename from gateapi/plugin_dependency.go rename to gateapi/model_plugin_dependency.go index 9c1bb201..165528b3 100644 --- a/gateapi/plugin_dependency.go +++ b/gateapi/model_plugin_dependency.go @@ -10,10 +10,7 @@ package swagger type PluginDependency struct { - Optional bool `json:"optional,omitempty"` - PluginId string `json:"pluginId,omitempty"` - PluginVersionSupport string `json:"pluginVersionSupport,omitempty"` } diff --git a/gateapi/reorder_pipelines_command.go b/gateapi/model_reorder_pipelines_command.go similarity index 99% rename from gateapi/reorder_pipelines_command.go rename to gateapi/model_reorder_pipelines_command.go index 1d957a75..4296ca64 100644 --- a/gateapi/reorder_pipelines_command.go +++ b/gateapi/model_reorder_pipelines_command.go @@ -10,8 +10,6 @@ package swagger type ReorderPipelinesCommand struct { - Application string `json:"application,omitempty"` - IdsToIndices map[string]int32 `json:"idsToIndices,omitempty"` } diff --git a/gateapi/resource.go b/gateapi/model_resource.go similarity index 98% rename from gateapi/resource.go rename to gateapi/model_resource.go index f442a277..bdbebf7d 100644 --- a/gateapi/resource.go +++ b/gateapi/model_resource.go @@ -14,20 +14,12 @@ import ( ) type Resource struct { - Description string `json:"description,omitempty"` - File **os.File `json:"file,omitempty"` - Filename string `json:"filename,omitempty"` - InputStream *InputStream `json:"inputStream,omitempty"` - Open bool `json:"open,omitempty"` - Readable bool `json:"readable,omitempty"` - Uri *Uri `json:"uri,omitempty"` - Url *Url `json:"url,omitempty"` } diff --git a/gateapi/response_entity.go b/gateapi/model_response_entity.go similarity index 99% rename from gateapi/response_entity.go rename to gateapi/model_response_entity.go index 443f7c9d..1a610cac 100644 --- a/gateapi/response_entity.go +++ b/gateapi/model_response_entity.go @@ -10,10 +10,7 @@ package swagger type ResponseEntity struct { - Body *interface{} `json:"body,omitempty"` - StatusCode string `json:"statusCode,omitempty"` - StatusCodeValue int32 `json:"statusCodeValue,omitempty"` } diff --git a/gateapi/spinnaker_plugin_descriptor.go b/gateapi/model_spinnaker_plugin_descriptor.go similarity index 98% rename from gateapi/spinnaker_plugin_descriptor.go rename to gateapi/model_spinnaker_plugin_descriptor.go index 757f023e..e93052f6 100644 --- a/gateapi/spinnaker_plugin_descriptor.go +++ b/gateapi/model_spinnaker_plugin_descriptor.go @@ -10,22 +10,13 @@ package swagger type SpinnakerPluginDescriptor struct { - Dependencies []PluginDependency `json:"dependencies,omitempty"` - License string `json:"license,omitempty"` - PluginClass string `json:"pluginClass,omitempty"` - PluginDescription string `json:"pluginDescription,omitempty"` - PluginId string `json:"pluginId,omitempty"` - Provider string `json:"provider,omitempty"` - Requires string `json:"requires,omitempty"` - Unsafe bool `json:"unsafe"` - Version string `json:"version,omitempty"` } diff --git a/gateapi/spinnaker_plugin_info.go b/gateapi/model_spinnaker_plugin_info.go similarity index 98% rename from gateapi/spinnaker_plugin_info.go rename to gateapi/model_spinnaker_plugin_info.go index 10b7e715..1557ba21 100644 --- a/gateapi/spinnaker_plugin_info.go +++ b/gateapi/model_spinnaker_plugin_info.go @@ -10,18 +10,11 @@ package swagger type SpinnakerPluginInfo struct { - Description string `json:"description,omitempty"` - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - ProjectUrl string `json:"projectUrl,omitempty"` - Provider string `json:"provider,omitempty"` - Releases []SpinnakerPluginRelease `json:"releases"` - RepositoryId string `json:"repositoryId,omitempty"` } diff --git a/gateapi/spinnaker_plugin_release.go b/gateapi/model_spinnaker_plugin_release.go similarity index 98% rename from gateapi/spinnaker_plugin_release.go rename to gateapi/model_spinnaker_plugin_release.go index 1a058aff..969aa2a4 100644 --- a/gateapi/spinnaker_plugin_release.go +++ b/gateapi/model_spinnaker_plugin_release.go @@ -14,16 +14,10 @@ import ( ) type SpinnakerPluginRelease struct { - Date time.Time `json:"date,omitempty"` - Preferred bool `json:"preferred,omitempty"` - Requires string `json:"requires,omitempty"` - Sha512sum string `json:"sha512sum,omitempty"` - Url string `json:"url,omitempty"` - Version string `json:"version,omitempty"` } diff --git a/gateapi/uri.go b/gateapi/model_uri.go similarity index 98% rename from gateapi/uri.go rename to gateapi/model_uri.go index fd18c944..53de52bc 100644 --- a/gateapi/uri.go +++ b/gateapi/model_uri.go @@ -10,38 +10,21 @@ package swagger type Uri struct { - Absolute bool `json:"absolute,omitempty"` - Authority string `json:"authority,omitempty"` - Fragment string `json:"fragment,omitempty"` - Host string `json:"host,omitempty"` - Opaque bool `json:"opaque,omitempty"` - Path string `json:"path,omitempty"` - Port int32 `json:"port,omitempty"` - Query string `json:"query,omitempty"` - RawAuthority string `json:"rawAuthority,omitempty"` - RawFragment string `json:"rawFragment,omitempty"` - RawPath string `json:"rawPath,omitempty"` - RawQuery string `json:"rawQuery,omitempty"` - RawSchemeSpecificPart string `json:"rawSchemeSpecificPart,omitempty"` - RawUserInfo string `json:"rawUserInfo,omitempty"` - Scheme string `json:"scheme,omitempty"` - SchemeSpecificPart string `json:"schemeSpecificPart,omitempty"` - UserInfo string `json:"userInfo,omitempty"` } diff --git a/gateapi/url.go b/gateapi/model_url.go similarity index 98% rename from gateapi/url.go rename to gateapi/model_url.go index bcba831e..71a8984a 100644 --- a/gateapi/url.go +++ b/gateapi/model_url.go @@ -10,30 +10,17 @@ package swagger type Url struct { - Authority string `json:"authority,omitempty"` - Content *interface{} `json:"content,omitempty"` - DefaultPort int32 `json:"defaultPort,omitempty"` - DeserializedFields *UrlStreamHandler `json:"deserializedFields,omitempty"` - File string `json:"file,omitempty"` - Host string `json:"host,omitempty"` - Path string `json:"path,omitempty"` - Port int32 `json:"port,omitempty"` - Protocol string `json:"protocol,omitempty"` - Query string `json:"query,omitempty"` - Ref string `json:"ref,omitempty"` - SerializedHashCode int32 `json:"serializedHashCode,omitempty"` - UserInfo string `json:"userInfo,omitempty"` } diff --git a/gateapi/url_stream_handler.go b/gateapi/model_url_stream_handler.go similarity index 100% rename from gateapi/url_stream_handler.go rename to gateapi/model_url_stream_handler.go diff --git a/gateapi/user.go b/gateapi/model_user.go similarity index 98% rename from gateapi/user.go rename to gateapi/model_user.go index cb902108..c77a6b96 100644 --- a/gateapi/user.go +++ b/gateapi/model_user.go @@ -10,26 +10,15 @@ package swagger type User struct { - AccountNonExpired bool `json:"accountNonExpired,omitempty"` - AccountNonLocked bool `json:"accountNonLocked,omitempty"` - AllowedAccounts []string `json:"allowedAccounts,omitempty"` - Authorities []GrantedAuthority `json:"authorities,omitempty"` - CredentialsNonExpired bool `json:"credentialsNonExpired,omitempty"` - Email string `json:"email,omitempty"` - Enabled bool `json:"enabled,omitempty"` - FirstName string `json:"firstName,omitempty"` - LastName string `json:"lastName,omitempty"` - Roles []string `json:"roles,omitempty"` - Username string `json:"username,omitempty"` } diff --git a/gateapi/version.go b/gateapi/model_version.go similarity index 99% rename from gateapi/version.go rename to gateapi/model_version.go index d04db445..2b1992a1 100644 --- a/gateapi/version.go +++ b/gateapi/model_version.go @@ -10,6 +10,5 @@ package swagger type Version struct { - Version string `json:"version,omitempty"` } diff --git a/gateapi/network_controller_api.go b/gateapi/network_controller_api.go deleted file mode 100644 index c67ec296..00000000 --- a/gateapi/network_controller_api.go +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type NetworkControllerApiService service - - -/* NetworkControllerApiService Retrieve a list of networks for a given cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param cloudProvider cloudProvider - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *NetworkControllerApiService) AllByCloudProviderUsingGET(ctx context.Context, cloudProvider string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/networks/{cloudProvider}" - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* NetworkControllerApiService Retrieve a list of networks, grouped by cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return map[string]interface{}*/ -func (a *NetworkControllerApiService) AllUsingGET2(ctx context.Context, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/networks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/pipeline_config_controller_api.go b/gateapi/pipeline_config_controller_api.go deleted file mode 100644 index 9d9fe8d5..00000000 --- a/gateapi/pipeline_config_controller_api.go +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PipelineConfigControllerApiService service - - -/* PipelineConfigControllerApiService Convert a pipeline config to a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipelineConfigId pipelineConfigId - @return string*/ -func (a *PipelineConfigControllerApiService) ConvertPipelineConfigToPipelineTemplateUsingGET(ctx context.Context, pipelineConfigId string) (string, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineConfigs/{pipelineConfigId}/convertToTemplate" - localVarPath = strings.Replace(localVarPath, "{"+"pipelineConfigId"+"}", fmt.Sprintf("%v", pipelineConfigId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineConfigControllerApiService Get all pipeline configs. - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *PipelineConfigControllerApiService) GetAllPipelineConfigsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineConfigs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineConfigControllerApiService Get pipeline config history. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipelineConfigId pipelineConfigId - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) limit - @return []interface{}*/ -func (a *PipelineConfigControllerApiService) GetPipelineConfigHistoryUsingGET(ctx context.Context, pipelineConfigId string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineConfigs/{pipelineConfigId}/history" - localVarPath = strings.Replace(localVarPath, "{"+"pipelineConfigId"+"}", fmt.Sprintf("%v", pipelineConfigId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/pipeline_controller_api.go b/gateapi/pipeline_controller_api.go deleted file mode 100644 index 76ab37c3..00000000 --- a/gateapi/pipeline_controller_api.go +++ /dev/null @@ -1,1221 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PipelineControllerApiService service - - -/* PipelineControllerApiService Cancel a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "force" (bool) force - @param "reason" (string) reason - @return */ -func (a *PipelineControllerApiService) CancelPipelineUsingPUT1(ctx context.Context, id string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["reason"], "string", "reason"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk { - localVarQueryParams.Add("force", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["reason"].(string); localVarOk { - localVarQueryParams.Add("reason", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Delete a pipeline definition - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pipelineName pipelineName - @return */ -func (a *PipelineControllerApiService) DeletePipelineUsingDELETE(ctx context.Context, application string, pipelineName string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{application}/{pipelineName}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipelineName"+"}", fmt.Sprintf("%v", pipelineName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Delete a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) DeletePipelineUsingDELETE1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Evaluate a pipeline expression at a specific stage using the provided execution as context - * @param ctx context.Context for authentication, logging, tracing, etc. - @param expression expression - @param id id - @param stageId stageId - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) EvaluateExpressionForExecutionAtStageUsingGET(ctx context.Context, expression string, id string, stageId string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/{stageId}/evaluateExpression" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("expression", parameterToString(expression, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Evaluate a pipeline expression using the provided execution as context - * @param ctx context.Context for authentication, logging, tracing, etc. - @param expression expression - @param id id - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) EvaluateExpressionForExecutionUsingGET(ctx context.Context, expression string, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateExpression" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("expression", parameterToString(expression, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Evaluate a pipeline expression using the provided execution as context - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param pipelineExpression pipelineExpression - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) EvaluateExpressionForExecutionViaPOSTUsingPOST1(ctx context.Context, id string, pipelineExpression interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateExpression" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipelineExpression - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Evaluate variables same as Evaluate Variables stage using the provided execution as context - * @param ctx context.Context for authentication, logging, tracing, etc. - @param executionId Execution id to run against - @param expressions List of variables/expressions to evaluate - @param optional (nil or map[string]interface{}) with one or more of: - @param "requisiteStageRefIds" (string) Comma separated list of requisite stage IDs for the evaluation stage - @param "spelVersion" (string) Version of SpEL evaluation logic to use (v3 or v4) - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) EvaluateVariablesUsingPOST(ctx context.Context, executionId string, expressions []Mapstringstring, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/evaluateVariables" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["requisiteStageRefIds"], "string", "requisiteStageRefIds"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["spelVersion"], "string", "spelVersion"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("executionId", parameterToString(executionId, "")) - if localVarTempParam, localVarOk := localVarOptionals["requisiteStageRefIds"].(string); localVarOk { - localVarQueryParams.Add("requisiteStageRefIds", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["spelVersion"].(string); localVarOk { - localVarQueryParams.Add("spelVersion", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &expressions - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Retrieve a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return interface{}*/ -func (a *PipelineControllerApiService) GetPipelineUsingGET(ctx context.Context, id string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Trigger a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pipelineNameOrId pipelineNameOrId - @param optional (nil or map[string]interface{}) with one or more of: - @param "trigger" (interface{}) trigger - @return */ -func (a *PipelineControllerApiService) InvokePipelineConfigUsingPOST1(ctx context.Context, application string, pipelineNameOrId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{application}/{pipelineNameOrId}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipelineNameOrId"+"}", fmt.Sprintf("%v", pipelineNameOrId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["trigger"].(interface{}); localVarOk { - localVarPostBody = &localVarTempParam - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Trigger a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param pipelineNameOrId pipelineNameOrId - @param optional (nil or map[string]interface{}) with one or more of: - @param "trigger" (interface{}) trigger - @return interface{}*/ -func (a *PipelineControllerApiService) InvokePipelineConfigViaEchoUsingPOST(ctx context.Context, application string, pipelineNameOrId string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/v2/{application}/{pipelineNameOrId}" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pipelineNameOrId"+"}", fmt.Sprintf("%v", pipelineNameOrId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["trigger"].(interface{}); localVarOk { - localVarPostBody = &localVarTempParam - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Pause a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return */ -func (a *PipelineControllerApiService) PausePipelineUsingPUT(ctx context.Context, id string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/pause" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Rename a pipeline definition - * @param ctx context.Context for authentication, logging, tracing, etc. - @param renameCommand renameCommand - @return */ -func (a *PipelineControllerApiService) RenamePipelineUsingPOST(ctx context.Context, renameCommand interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/move" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &renameCommand - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Restart a stage execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param context context - @param id id - @param stageId stageId - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) RestartStageUsingPUT(ctx context.Context, context interface{}, id string, stageId string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/stages/{stageId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &context - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Resume a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) ResumePipelineUsingPUT(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/resume" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Save a pipeline definition - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipeline pipeline - @return */ -func (a *PipelineControllerApiService) SavePipelineUsingPOST(ctx context.Context, pipeline interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipeline - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineControllerApiService Initiate a pipeline execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param map_ map - @return ResponseEntity*/ -func (a *PipelineControllerApiService) StartUsingPOST(ctx context.Context, map_ interface{}) (ResponseEntity, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ResponseEntity - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/start" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &map_ - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Update a pipeline definition - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param pipeline pipeline - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) UpdatePipelineUsingPUT(ctx context.Context, id string, pipeline interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipeline - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineControllerApiService Update a stage execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param context context - @param id id - @param stageId stageId - @return map[string]interface{}*/ -func (a *PipelineControllerApiService) UpdateStageUsingPATCH(ctx context.Context, context interface{}, id string, stageId string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelines/{id}/stages/{stageId}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"stageId"+"}", fmt.Sprintf("%v", stageId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &context - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/pipeline_templates_controller_api.go b/gateapi/pipeline_templates_controller_api.go deleted file mode 100644 index 6cea06aa..00000000 --- a/gateapi/pipeline_templates_controller_api.go +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PipelineTemplatesControllerApiService service - - -/* PipelineTemplatesControllerApiService Create a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipelineTemplate pipelineTemplate - @return */ -func (a *PipelineTemplatesControllerApiService) CreateUsingPOST(ctx context.Context, pipelineTemplate interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipelineTemplate - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService Delete a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @return map[string]interface{}*/ -func (a *PipelineTemplatesControllerApiService) DeleteUsingDELETE(ctx context.Context, id string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService Get a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *PipelineTemplatesControllerApiService) GetUsingGET(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService List all pipelines that implement a pipeline template - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "recursive" (bool) recursive - @return []interface{}*/ -func (a *PipelineTemplatesControllerApiService) ListPipelineTemplateDependentsUsingGET(ctx context.Context, id string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}/dependents" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["recursive"], "bool", "recursive"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["recursive"].(bool); localVarOk { - localVarQueryParams.Add("recursive", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService List pipeline templates. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "scopes" ([]string) scopes - @return []interface{}*/ -func (a *PipelineTemplatesControllerApiService) ListUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - if localVarTempParam, localVarOk := localVarOptionals["scopes"].([]string); localVarOk { - localVarQueryParams.Add("scopes", parameterToString(localVarTempParam, "multi")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService Resolve a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param source source - @param optional (nil or map[string]interface{}) with one or more of: - @param "executionId" (string) executionId - @param "pipelineConfigId" (string) pipelineConfigId - @return map[string]interface{}*/ -func (a *PipelineTemplatesControllerApiService) ResolveTemplatesUsingGET(ctx context.Context, source string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/resolve" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["executionId"], "string", "executionId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["pipelineConfigId"], "string", "pipelineConfigId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["executionId"].(string); localVarOk { - localVarQueryParams.Add("executionId", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["pipelineConfigId"].(string); localVarOk { - localVarQueryParams.Add("pipelineConfigId", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("source", parameterToString(source, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PipelineTemplatesControllerApiService Update a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param pipelineTemplate pipelineTemplate - @param optional (nil or map[string]interface{}) with one or more of: - @param "skipPlanDependents" (bool) skipPlanDependents - @return */ -func (a *PipelineTemplatesControllerApiService) UpdateUsingPOST(ctx context.Context, id string, pipelineTemplate interface{}, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pipelineTemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["skipPlanDependents"], "bool", "skipPlanDependents"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["skipPlanDependents"].(bool); localVarOk { - localVarQueryParams.Add("skipPlanDependents", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipelineTemplate - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/gateapi/plugin_info_controller_api.go b/gateapi/plugin_info_controller_api.go deleted file mode 100644 index b78bff87..00000000 --- a/gateapi/plugin_info_controller_api.go +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PluginInfoControllerApiService service - - -/* PluginInfoControllerApiService Delete plugin info with the provided Id - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return interface{}*/ -func (a *PluginInfoControllerApiService) DeletePluginInfoUsingDELETE(ctx context.Context, id string) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/info/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PluginInfoControllerApiService Get all plugin info objects - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "service" (string) service - @return []Mapstringobject*/ -func (a *PluginInfoControllerApiService) GetAllPluginInfoUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]Mapstringobject, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Mapstringobject - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["service"], "string", "service"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["service"].(string); localVarOk { - localVarQueryParams.Add("service", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PluginInfoControllerApiService Persist plugin metadata information - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pluginInfo pluginInfo - @return */ -func (a *PluginInfoControllerApiService) PersistPluginInfoUsingPOST(ctx context.Context, pluginInfo SpinnakerPluginInfo) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pluginInfo - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PluginInfoControllerApiService Persist plugin metadata information - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pluginInfo pluginInfo - @return */ -func (a *PluginInfoControllerApiService) PersistPluginInfoUsingPUT(ctx context.Context, pluginInfo SpinnakerPluginInfo) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pluginInfo - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/gateapi/plugins_installed_controller_api.go b/gateapi/plugins_installed_controller_api.go deleted file mode 100644 index 06a43c51..00000000 --- a/gateapi/plugins_installed_controller_api.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type PluginsInstalledControllerApiService service - - -/* PluginsInstalledControllerApiService Get all installed Spinnaker plugins - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "service" (string) service - @return map[string][]SpinnakerPluginDescriptor*/ -func (a *PluginsInstalledControllerApiService) GetInstalledPluginsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) (map[string][]SpinnakerPluginDescriptor, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string][]SpinnakerPluginDescriptor - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/plugins/installed" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["service"], "string", "service"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["service"].(string); localVarOk { - localVarQueryParams.Add("service", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/project_controller_api.go b/gateapi/project_controller_api.go deleted file mode 100644 index 49736c45..00000000 --- a/gateapi/project_controller_api.go +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ProjectControllerApiService service - - -/* ProjectControllerApiService Get all pipelines for project - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) limit - @param "statuses" (string) statuses - @return []interface{}*/ -func (a *ProjectControllerApiService) AllPipelinesForProjectUsingGET(ctx context.Context, id string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/projects/{id}/pipelines" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ProjectControllerApiService Get all projects - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *ProjectControllerApiService) AllUsingGET3(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/projects" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ProjectControllerApiService Get a project's clusters - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return []interface{}*/ -func (a *ProjectControllerApiService) GetClustersUsingGET3(ctx context.Context, id string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/projects/{id}/clusters" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ProjectControllerApiService Get a project - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *ProjectControllerApiService) GetUsingGET1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/projects/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/pubsub_subscription_controller_api.go b/gateapi/pubsub_subscription_controller_api.go deleted file mode 100644 index 860346bb..00000000 --- a/gateapi/pubsub_subscription_controller_api.go +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type PubsubSubscriptionControllerApiService service - - -/* PubsubSubscriptionControllerApiService Retrieve the list of pub/sub subscriptions configured in Echo. - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []Mapstringstring*/ -func (a *PubsubSubscriptionControllerApiService) AllUsingGET4(ctx context.Context) ([]Mapstringstring, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Mapstringstring - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pubsub/subscriptions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/api_response.go b/gateapi/response.go similarity index 84% rename from gateapi/api_response.go rename to gateapi/response.go index c3833c89..0f552ef4 100644 --- a/gateapi/api_response.go +++ b/gateapi/response.go @@ -15,15 +15,15 @@ import ( type APIResponse struct { *http.Response `json:"-"` - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` + 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"` + 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"` + 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. @@ -31,11 +31,13 @@ type APIResponse struct { } func NewAPIResponse(r *http.Response) *APIResponse { + response := &APIResponse{Response: r} return response } func NewAPIResponseWithError(errorMessage string) *APIResponse { + response := &APIResponse{Message: errorMessage} return response } diff --git a/gateapi/search_controller_api.go b/gateapi/search_controller_api.go deleted file mode 100644 index 3a0fe254..00000000 --- a/gateapi/search_controller_api.go +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type SearchControllerApiService service - - -/* SearchControllerApiService Search infrastructure - * @param ctx context.Context for authentication, logging, tracing, etc. - @param type_ type - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "allowShortQuery" (bool) allowShortQuery - @param "page" (int32) page - @param "pageSize" (int32) pageSize - @param "platform" (string) platform - @param "q" (string) q - @return []interface{}*/ -func (a *SearchControllerApiService) SearchUsingGET(ctx context.Context, type_ string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/search" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["allowShortQuery"], "bool", "allowShortQuery"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["page"], "int32", "page"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["pageSize"], "int32", "pageSize"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["platform"], "string", "platform"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["q"], "string", "q"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["allowShortQuery"].(bool); localVarOk { - localVarQueryParams.Add("allowShortQuery", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["page"].(int32); localVarOk { - localVarQueryParams.Add("page", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int32); localVarOk { - localVarQueryParams.Add("pageSize", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["platform"].(string); localVarOk { - localVarQueryParams.Add("platform", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["q"].(string); localVarOk { - localVarQueryParams.Add("q", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("type", parameterToString(type_, "")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/security_group_controller_api.go b/gateapi/security_group_controller_api.go deleted file mode 100644 index bfe0ba68..00000000 --- a/gateapi/security_group_controller_api.go +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SecurityGroupControllerApiService service - - -/* SecurityGroupControllerApiService Retrieve a list of security groups for a given account, grouped by region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @return interface{}*/ -func (a *SecurityGroupControllerApiService) AllByAccountUsingGET1(ctx context.Context, account string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/securityGroups/{account}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SecurityGroupControllerApiService Retrieve a list of security groups, grouped by account, cloud provider, and region - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "id" (string) id - @return interface{}*/ -func (a *SecurityGroupControllerApiService) AllUsingGET5(ctx context.Context, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/securityGroups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["id"], "string", "id"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["id"].(string); localVarOk { - localVarQueryParams.Add("id", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SecurityGroupControllerApiService Retrieve a security group's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param name name - @param region region - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "provider" (string) provider - @param "vpcId" (string) vpcId - @return interface{}*/ -func (a *SecurityGroupControllerApiService) GetSecurityGroupUsingGET1(ctx context.Context, account string, name string, region string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/securityGroups/{account}/{region}/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["provider"], "string", "provider"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["vpcId"], "string", "vpcId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["provider"].(string); localVarOk { - localVarQueryParams.Add("provider", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["vpcId"].(string); localVarOk { - localVarQueryParams.Add("vpcId", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/server_group_controller_api.go b/gateapi/server_group_controller_api.go deleted file mode 100644 index 5e52795f..00000000 --- a/gateapi/server_group_controller_api.go +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ServerGroupControllerApiService service - - -/* ServerGroupControllerApiService Retrieve a server group's details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param applicationName applicationName - @param region region - @param serverGroupName serverGroupName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "includeDetails" (string) includeDetails - @return interface{}*/ -func (a *ServerGroupControllerApiService) GetServerGroupDetailsUsingGET(ctx context.Context, account string, applicationName string, region string, serverGroupName string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/serverGroups/{account}/{region}/{serverGroupName}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", fmt.Sprintf("%v", region), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverGroupName"+"}", fmt.Sprintf("%v", serverGroupName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["includeDetails"], "string", "includeDetails"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["includeDetails"].(string); localVarOk { - localVarQueryParams.Add("includeDetails", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ServerGroupControllerApiService Retrieve a list of server groups for a given application - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationName applicationName - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @param "cloudProvider" (string) cloudProvider - @param "clusters" (string) clusters - @param "expand" (string) expand - @return []interface{}*/ -func (a *ServerGroupControllerApiService) GetServerGroupsForApplicationUsingGET(ctx context.Context, applicationName string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{applicationName}/serverGroups" - localVarPath = strings.Replace(localVarPath, "{"+"applicationName"+"}", fmt.Sprintf("%v", applicationName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["cloudProvider"], "string", "cloudProvider"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["clusters"], "string", "clusters"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["expand"], "string", "expand"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["cloudProvider"].(string); localVarOk { - localVarQueryParams.Add("cloudProvider", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["clusters"].(string); localVarOk { - localVarQueryParams.Add("clusters", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["expand"].(string); localVarOk { - localVarQueryParams.Add("expand", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/snapshot_controller_api.go b/gateapi/snapshot_controller_api.go deleted file mode 100644 index ac5e53c1..00000000 --- a/gateapi/snapshot_controller_api.go +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SnapshotControllerApiService service - - -/* SnapshotControllerApiService Get current snapshot - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @return map[string]interface{}*/ -func (a *SnapshotControllerApiService) GetCurrentSnapshotUsingGET(ctx context.Context, account string, application string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/snapshots/{account}" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SnapshotControllerApiService Get snapshot history - * @param ctx context.Context for authentication, logging, tracing, etc. - @param account account - @param application application - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) limit - @return []interface{}*/ -func (a *SnapshotControllerApiService) GetSnapshotHistoryUsingGET(ctx context.Context, account string, application string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application}/snapshots/{account}/history" - localVarPath = strings.Replace(localVarPath, "{"+"account"+"}", fmt.Sprintf("%v", account), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/subnet_controller_api.go b/gateapi/subnet_controller_api.go deleted file mode 100644 index bd772343..00000000 --- a/gateapi/subnet_controller_api.go +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SubnetControllerApiService service - - -/* SubnetControllerApiService Retrieve a list of subnets for a given cloud provider - * @param ctx context.Context for authentication, logging, tracing, etc. - @param cloudProvider cloudProvider - @return []interface{}*/ -func (a *SubnetControllerApiService) AllByCloudProviderUsingGET1(ctx context.Context, cloudProvider string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/subnets/{cloudProvider}" - localVarPath = strings.Replace(localVarPath, "{"+"cloudProvider"+"}", fmt.Sprintf("%v", cloudProvider), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/task_controller_api.go b/gateapi/task_controller_api.go deleted file mode 100644 index 2f58f00a..00000000 --- a/gateapi/task_controller_api.go +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type TaskControllerApiService service - - -/* TaskControllerApiService Cancel task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *TaskControllerApiService) CancelTaskUsingPUT1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks/{id}/cancel" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TaskControllerApiService Cancel tasks - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ids ids - @return map[string]interface{}*/ -func (a *TaskControllerApiService) CancelTasksUsingPUT(ctx context.Context, ids []string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks/cancel" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - localVarQueryParams.Add("ids", parameterToString(ids, "multi")) - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TaskControllerApiService Delete task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *TaskControllerApiService) DeleteTaskUsingDELETE(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TaskControllerApiService Get task details - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param taskDetailsId taskDetailsId - @param optional (nil or map[string]interface{}) with one or more of: - @param "xRateLimitApp" (string) X-RateLimit-App - @return map[string]interface{}*/ -func (a *TaskControllerApiService) GetTaskDetailsUsingGET1(ctx context.Context, id string, taskDetailsId string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks/{id}/details/{taskDetailsId}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"taskDetailsId"+"}", fmt.Sprintf("%v", taskDetailsId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xRateLimitApp"], "string", "xRateLimitApp"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xRateLimitApp"].(string); localVarOk { - localVarHeaderParams["X-RateLimit-App"] = parameterToString(localVarTempParam, "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TaskControllerApiService Get task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return map[string]interface{}*/ -func (a *TaskControllerApiService) GetTaskUsingGET1(ctx context.Context, id string) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TaskControllerApiService Create task - * @param ctx context.Context for authentication, logging, tracing, etc. - @param map_ map - @return map[string]interface{}*/ -func (a *TaskControllerApiService) TaskUsingPOST1(ctx context.Context, map_ interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tasks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &map_ - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/v2_canary_config_controller_api.go b/gateapi/v2_canary_config_controller_api.go deleted file mode 100644 index 65d4fb78..00000000 --- a/gateapi/v2_canary_config_controller_api.go +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type V2CanaryConfigControllerApiService service - - -/* V2CanaryConfigControllerApiService Create a canary configuration - * @param ctx context.Context for authentication, logging, tracing, etc. - @param config config - @param optional (nil or map[string]interface{}) with one or more of: - @param "configurationAccountName" (string) configurationAccountName - @return interface{}*/ -func (a *V2CanaryConfigControllerApiService) CreateCanaryConfigUsingPOST(ctx context.Context, config interface{}, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &config - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryConfigControllerApiService Delete a canary configuration - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "configurationAccountName" (string) configurationAccountName - @return */ -func (a *V2CanaryConfigControllerApiService) DeleteCanaryConfigUsingDELETE(ctx context.Context, id string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* V2CanaryConfigControllerApiService Retrieve a canary configuration by id - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "configurationAccountName" (string) configurationAccountName - @return interface{}*/ -func (a *V2CanaryConfigControllerApiService) GetCanaryConfigUsingGET(ctx context.Context, id string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryConfigControllerApiService Retrieve a list of canary configurations - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @param "configurationAccountName" (string) configurationAccountName - @return []interface{}*/ -func (a *V2CanaryConfigControllerApiService) GetCanaryConfigsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryConfigControllerApiService Update a canary configuration - * @param ctx context.Context for authentication, logging, tracing, etc. - @param config config - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "configurationAccountName" (string) configurationAccountName - @return interface{}*/ -func (a *V2CanaryConfigControllerApiService) UpdateCanaryConfigUsingPUT(ctx context.Context, config interface{}, id string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaryConfig/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &config - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/v2_canary_controller_api.go b/gateapi/v2_canary_controller_api.go deleted file mode 100644 index 93b1c980..00000000 --- a/gateapi/v2_canary_controller_api.go +++ /dev/null @@ -1,726 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type V2CanaryControllerApiService service - - -/* V2CanaryControllerApiService (DEPRECATED) Retrieve a canary result - * @param ctx context.Context for authentication, logging, tracing, etc. - @param canaryConfigId canaryConfigId - @param canaryExecutionId canaryExecutionId - @param optional (nil or map[string]interface{}) with one or more of: - @param "storageAccountName" (string) storageAccountName - @return interface{}*/ -func (a *V2CanaryControllerApiService) GetCanaryResultUsingGET(ctx context.Context, canaryConfigId string, canaryExecutionId string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryConfigId}/{canaryExecutionId}" - localVarPath = strings.Replace(localVarPath, "{"+"canaryConfigId"+"}", fmt.Sprintf("%v", canaryConfigId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"canaryExecutionId"+"}", fmt.Sprintf("%v", canaryExecutionId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a canary result - * @param ctx context.Context for authentication, logging, tracing, etc. - @param canaryExecutionId canaryExecutionId - @param optional (nil or map[string]interface{}) with one or more of: - @param "storageAccountName" (string) storageAccountName - @return interface{}*/ -func (a *V2CanaryControllerApiService) GetCanaryResultUsingGET1(ctx context.Context, canaryExecutionId string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryExecutionId}" - localVarPath = strings.Replace(localVarPath, "{"+"canaryExecutionId"+"}", fmt.Sprintf("%v", canaryExecutionId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a list of an application's canary results - * @param ctx context.Context for authentication, logging, tracing, etc. - @param application application - @param limit limit - @param optional (nil or map[string]interface{}) with one or more of: - @param "statuses" (string) Comma-separated list of statuses, e.g.: RUNNING, SUCCEEDED, TERMINAL - @param "storageAccountName" (string) storageAccountName - @return []interface{}*/ -func (a *V2CanaryControllerApiService) GetCanaryResultsByApplicationUsingGET(ctx context.Context, application string, limit int32, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/{application}/executions" - localVarPath = strings.Replace(localVarPath, "{"+"application"+"}", fmt.Sprintf("%v", application), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["statuses"], "string", "statuses"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("limit", parameterToString(limit, "")) - if localVarTempParam, localVarOk := localVarOptionals["statuses"].(string); localVarOk { - localVarQueryParams.Add("statuses", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a metric set pair list - * @param ctx context.Context for authentication, logging, tracing, etc. - @param metricSetPairListId metricSetPairListId - @param optional (nil or map[string]interface{}) with one or more of: - @param "storageAccountName" (string) storageAccountName - @return []interface{}*/ -func (a *V2CanaryControllerApiService) GetMetricSetPairListUsingGET(ctx context.Context, metricSetPairListId string, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/metricSetPairList/{metricSetPairListId}" - localVarPath = strings.Replace(localVarPath, "{"+"metricSetPairListId"+"}", fmt.Sprintf("%v", metricSetPairListId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Start a canary execution - * @param ctx context.Context for authentication, logging, tracing, etc. - @param canaryConfigId canaryConfigId - @param executionRequest executionRequest - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @param "configurationAccountName" (string) configurationAccountName - @param "metricsAccountName" (string) metricsAccountName - @param "parentPipelineExecutionId" (string) parentPipelineExecutionId - @param "storageAccountName" (string) storageAccountName - @return interface{}*/ -func (a *V2CanaryControllerApiService) InitiateCanaryUsingPOST(ctx context.Context, canaryConfigId string, executionRequest interface{}, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary/{canaryConfigId}" - localVarPath = strings.Replace(localVarPath, "{"+"canaryConfigId"+"}", fmt.Sprintf("%v", canaryConfigId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["configurationAccountName"], "string", "configurationAccountName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["metricsAccountName"], "string", "metricsAccountName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["parentPipelineExecutionId"], "string", "parentPipelineExecutionId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["configurationAccountName"].(string); localVarOk { - localVarQueryParams.Add("configurationAccountName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["metricsAccountName"].(string); localVarOk { - localVarQueryParams.Add("metricsAccountName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["parentPipelineExecutionId"].(string); localVarOk { - localVarQueryParams.Add("parentPipelineExecutionId", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &executionRequest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Start a canary execution with the supplied canary config - * @param ctx context.Context for authentication, logging, tracing, etc. - @param adhocExecutionRequest adhocExecutionRequest - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @param "metricsAccountName" (string) metricsAccountName - @param "parentPipelineExecutionId" (string) parentPipelineExecutionId - @param "storageAccountName" (string) storageAccountName - @return interface{}*/ -func (a *V2CanaryControllerApiService) InitiateCanaryWithConfigUsingPOST(ctx context.Context, adhocExecutionRequest interface{}, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/canary" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["metricsAccountName"], "string", "metricsAccountName"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["parentPipelineExecutionId"], "string", "parentPipelineExecutionId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["storageAccountName"], "string", "storageAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["metricsAccountName"].(string); localVarOk { - localVarQueryParams.Add("metricsAccountName", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["parentPipelineExecutionId"].(string); localVarOk { - localVarQueryParams.Add("parentPipelineExecutionId", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["storageAccountName"].(string); localVarOk { - localVarQueryParams.Add("storageAccountName", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &adhocExecutionRequest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a list of configured Kayenta accounts - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *V2CanaryControllerApiService) ListCredentialsUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/credentials" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a list of all configured canary judges - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *V2CanaryControllerApiService) ListJudgesUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/judges" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2CanaryControllerApiService Retrieve a list of descriptors for use in populating the canary config ui - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" (string) filter - @param "metricsAccountName" (string) metricsAccountName - @return []interface{}*/ -func (a *V2CanaryControllerApiService) ListMetricsServiceMetadataUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/canaries/metadata/metricsService" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["metricsAccountName"], "string", "metricsAccountName"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["metricsAccountName"].(string); localVarOk { - localVarQueryParams.Add("metricsAccountName", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/v2_pipeline_templates_controller_api.go b/gateapi/v2_pipeline_templates_controller_api.go deleted file mode 100644 index dd7fb50b..00000000 --- a/gateapi/v2_pipeline_templates_controller_api.go +++ /dev/null @@ -1,600 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type V2PipelineTemplatesControllerApiService service - - -/* V2PipelineTemplatesControllerApiService (ALPHA) Create a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipelineTemplate pipelineTemplate - @param optional (nil or map[string]interface{}) with one or more of: - @param "tag" (string) tag - @return */ -func (a *V2PipelineTemplatesControllerApiService) CreateUsingPOST1(ctx context.Context, pipelineTemplate interface{}, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/create" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["tag"], "string", "tag"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["tag"].(string); localVarOk { - localVarQueryParams.Add("tag", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipelineTemplate - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService Delete a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "application" (string) application - @param "digest" (string) digest - @param "tag" (string) tag - @return map[string]interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) DeleteUsingDELETE1(ctx context.Context, id string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["application"], "string", "application"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["digest"], "string", "digest"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["tag"], "string", "tag"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["application"].(string); localVarOk { - localVarQueryParams.Add("application", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["digest"].(string); localVarOk { - localVarQueryParams.Add("digest", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["tag"].(string); localVarOk { - localVarQueryParams.Add("tag", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService (ALPHA) Get a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param optional (nil or map[string]interface{}) with one or more of: - @param "digest" (string) digest - @param "tag" (string) tag - @return map[string]interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) GetUsingGET2(ctx context.Context, id string, localVarOptionals map[string]interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["digest"], "string", "digest"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["tag"], "string", "tag"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["digest"].(string); localVarOk { - localVarQueryParams.Add("digest", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["tag"].(string); localVarOk { - localVarQueryParams.Add("tag", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService (ALPHA) List all pipelines that implement a pipeline template - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @return []interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) ListPipelineTemplateDependentsUsingGET1(ctx context.Context, id string) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/{id}/dependents" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService (ALPHA) List pipeline templates. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "scopes" ([]string) scopes - @return []interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) ListUsingGET1(ctx context.Context, localVarOptionals map[string]interface{}) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - if localVarTempParam, localVarOk := localVarOptionals["scopes"].([]string); localVarOk { - localVarQueryParams.Add("scopes", parameterToString(localVarTempParam, "multi")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService List pipeline templates with versions - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "scopes" ([]string) scopes - @return interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) ListVersionsUsingGET(ctx context.Context, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/versions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - if localVarTempParam, localVarOk := localVarOptionals["scopes"].([]string); localVarOk { - localVarQueryParams.Add("scopes", parameterToString(localVarTempParam, "multi")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService (ALPHA) Plan a pipeline template configuration. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param pipeline pipeline - @return map[string]interface{}*/ -func (a *V2PipelineTemplatesControllerApiService) PlanUsingPOST(ctx context.Context, pipeline interface{}) (map[string]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/plan" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipeline - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* V2PipelineTemplatesControllerApiService (ALPHA) Update a pipeline template. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id id - @param pipelineTemplate pipelineTemplate - @param optional (nil or map[string]interface{}) with one or more of: - @param "skipPlanDependents" (bool) skipPlanDependents - @param "tag" (string) tag - @return */ -func (a *V2PipelineTemplatesControllerApiService) UpdateUsingPOST1(ctx context.Context, id string, pipelineTemplate interface{}, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/pipelineTemplates/update/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["skipPlanDependents"], "bool", "skipPlanDependents"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["tag"], "string", "tag"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["skipPlanDependents"].(bool); localVarOk { - localVarQueryParams.Add("skipPlanDependents", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["tag"].(string); localVarOk { - localVarQueryParams.Add("tag", parameterToString(localVarTempParam, "")) - } - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &pipelineTemplate - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/gateapi/version_controller_api.go b/gateapi/version_controller_api.go deleted file mode 100644 index 64290d61..00000000 --- a/gateapi/version_controller_api.go +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type VersionControllerApiService service - - -/* VersionControllerApiService Fetch Gate's current version - * @param ctx context.Context for authentication, logging, tracing, etc. - @return Version*/ -func (a *VersionControllerApiService) GetVersionUsingGET(ctx context.Context) (Version, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Version - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/version" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/gateapi/webhook_controller_api.go b/gateapi/webhook_controller_api.go deleted file mode 100644 index 2d2af222..00000000 --- a/gateapi/webhook_controller_api.go +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Spinnaker API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 1.0.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package swagger - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type WebhookControllerApiService service - - -/* WebhookControllerApiService Retrieve a list of preconfigured webhooks in Orca - * @param ctx context.Context for authentication, logging, tracing, etc. - @return []interface{}*/ -func (a *WebhookControllerApiService) PreconfiguredWebhooksUsingGET(ctx context.Context) ([]interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/webhooks/preconfigured" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WebhookControllerApiService Endpoint for posting webhooks to Spinnaker's webhook service - * @param ctx context.Context for authentication, logging, tracing, etc. - @param source source - @param type_ type - @param optional (nil or map[string]interface{}) with one or more of: - @param "xEventKey" (string) X-Event-Key - @param "xHubSignature" (string) X-Hub-Signature - @param "event" (interface{}) event - @return interface{}*/ -func (a *WebhookControllerApiService) WebhooksUsingPOST(ctx context.Context, source string, type_ string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/webhooks/{type}/{source}" - localVarPath = strings.Replace(localVarPath, "{"+"source"+"}", fmt.Sprintf("%v", source), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", fmt.Sprintf("%v", type_), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xEventKey"], "string", "xEventKey"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xHubSignature"], "string", "xHubSignature"); err != nil { - return successPayload, nil, err - } - - // 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{ - "*/*", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xEventKey"].(string); localVarOk { - localVarHeaderParams["X-Event-Key"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xHubSignature"].(string); localVarOk { - localVarHeaderParams["X-Hub-Signature"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["event"].(interface{}); localVarOk { - localVarPostBody = &localVarTempParam - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - From 6286b96015dc920bdd52e817fe9a23bb11a23e6b Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Thu, 13 Aug 2020 17:09:53 -0700 Subject: [PATCH 2/6] feat(contribution): add instructions on how to generate gateapi using 2.4.1 --- CONTRIBUTING.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b85fda32..802b7a1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,8 +52,14 @@ from the root `spin/` directory. Spin CLI uses [Swagger](https://swagger.io/) to generate the API client library for [Gate](https://github.com/spinnaker/gate). To update the client library: -- From the root of the Gate directory, execute `swagger/generate_swagger.sh` to create the `swagger.json` API spec. -- Get the [Swagger Codegen CLI](https://github.com/swagger-api/swagger-codegen). Use the version specified [here](https://github.com/spinnaker/spin/blob/master/gateapi/.swagger-codegen/VERSION). -- Remove the existing generated code from the spin directory `rm -r ~/spin/gateapi` -- Use the Swagger Codegen CLI to generate the new library and drop it into the spin project `java -jar ~/swagger-codegen-cli.jar generate -i ~/gate/swagger/swagger.json -l go -o ~/spin/gateapi` +- Use the Swagger Codegen to generate the new library and drop it into the spin project + ```bash + GATE_REPO_PATH=PATH_TO_YOUR_GATE_REPO + SWAGGER_CODEGEN_VERSION=$(cat gateapi/.swagger-codegen/VERSION) + rm -rf gateapi/ \ + && docker run -it \ + -v "${GATE_REPO_PATH}/swagger/:/tmp/gate" \ + -v "$PWD/gateapi/:/tmp/go/" \ + "swaggerapi/swagger-codegen-cli:${SWAGGER_CODEGEN_VERSION}" generate -i /tmp/gate/swagger.json -l go -o /tmp/go/ + ``` - Commit the changes and open a PR. From b395bc1affed36f9d4b05ec2270d63a4592c547c Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Thu, 13 Aug 2020 17:10:53 -0700 Subject: [PATCH 3/6] refact(gateapi): swagger 2.4.14 query params are typed now --- cmd/account/get.go | 4 +++- cmd/account/list.go | 4 +++- cmd/application/delete.go | 4 +++- cmd/application/get.go | 4 +++- cmd/application/list.go | 3 ++- cmd/canary/canary-config/delete.go | 3 ++- cmd/canary/canary-config/get.go | 3 ++- cmd/canary/canary-config/list.go | 4 +++- cmd/canary/canary-config/retro.go | 12 +++++++----- cmd/canary/canary-config/save.go | 7 ++++--- cmd/pipeline-template/delete.go | 6 ++++-- cmd/pipeline-template/get.go | 6 ++++-- cmd/pipeline-template/list.go | 4 +++- cmd/pipeline-template/save.go | 22 +++++++++++++++++----- cmd/pipeline/execute.go | 4 +++- cmd/pipeline/execution/cancel.go | 3 ++- cmd/pipeline/execution/get.go | 8 +++++--- cmd/pipeline/execution/list.go | 10 ++++++---- cmd/project/get_pipelines.go | 3 ++- 19 files changed, 78 insertions(+), 36 deletions(-) diff --git a/cmd/account/get.go b/cmd/account/get.go index cf590619..9bf7cd12 100644 --- a/cmd/account/get.go +++ b/cmd/account/get.go @@ -16,6 +16,8 @@ package account import ( "fmt" + gate "github.com/spinnaker/spin/gateapi" + "net/http" "github.com/spf13/cobra" @@ -57,7 +59,7 @@ func getAccount(cmd *cobra.Command, options *getOptions, args []string) error { return err } - account, resp, err := options.GateClient.CredentialsControllerApi.GetAccountUsingGET(options.GateClient.Context, accountName, map[string]interface{}{}) + account, resp, err := options.GateClient.CredentialsControllerApi.GetAccountUsingGET(options.GateClient.Context, accountName, &gate.CredentialsControllerApiGetAccountUsingGETOpts{}) if resp != nil { if resp.StatusCode == http.StatusNotFound { return fmt.Errorf("Account '%s' not found\n", accountName) diff --git a/cmd/account/list.go b/cmd/account/list.go index f01bb84b..078563f1 100644 --- a/cmd/account/list.go +++ b/cmd/account/list.go @@ -16,6 +16,8 @@ package account import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -52,7 +54,7 @@ func NewListCmd(accOptions *accountOptions) *cobra.Command { } func listAccount(cmd *cobra.Command, options *listOptions, args []string) error { - accountList, resp, err := options.GateClient.CredentialsControllerApi.GetAccountsUsingGET(options.GateClient.Context, map[string]interface{}{"expand": options.expand}) + accountList, resp, err := options.GateClient.CredentialsControllerApi.GetAccountsUsingGET(options.GateClient.Context, &gate.CredentialsControllerApiGetAccountsUsingGETOpts{Expand: optional.NewBool(options.expand)}) if err != nil { return err } diff --git a/cmd/application/delete.go b/cmd/application/delete.go index 5412ca88..78d8f8da 100644 --- a/cmd/application/delete.go +++ b/cmd/application/delete.go @@ -16,6 +16,8 @@ package application import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" orca_tasks "github.com/spinnaker/spin/cmd/orca-tasks" @@ -65,7 +67,7 @@ func deleteApplication(cmd *cobra.Command, options *deleteOptions, args []string }, } - _, resp, err := options.GateClient.ApplicationControllerApi.GetApplicationUsingGET(options.GateClient.Context, applicationName, map[string]interface{}{"expand": false}) + _, resp, err := options.GateClient.ApplicationControllerApi.GetApplicationUsingGET(options.GateClient.Context, applicationName, &gate.ApplicationControllerApiGetApplicationUsingGETOpts{Expand: optional.NewBool(false)}) if resp != nil && resp.StatusCode == http.StatusNotFound { return fmt.Errorf("Attempting to delete application '%s' which does not exist, exiting...", applicationName) diff --git a/cmd/application/get.go b/cmd/application/get.go index a4accfc5..72d3705a 100644 --- a/cmd/application/get.go +++ b/cmd/application/get.go @@ -16,6 +16,8 @@ package application import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spinnaker/spin/util" @@ -63,7 +65,7 @@ func getApplication(cmd *cobra.Command, options *getOptions, args []string) erro return err } - app, resp, err := options.GateClient.ApplicationControllerApi.GetApplicationUsingGET(options.GateClient.Context, applicationName, map[string]interface{}{"expand": options.expand}) + app, resp, err := options.GateClient.ApplicationControllerApi.GetApplicationUsingGET(options.GateClient.Context, applicationName, &gate.ApplicationControllerApiGetApplicationUsingGETOpts{Expand: optional.NewBool(options.expand)}) if resp != nil { if resp.StatusCode == http.StatusNotFound { return fmt.Errorf("Application '%s' not found\n", applicationName) diff --git a/cmd/application/list.go b/cmd/application/list.go index 8985444b..498ff79b 100644 --- a/cmd/application/list.go +++ b/cmd/application/list.go @@ -16,6 +16,7 @@ package application import ( "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -49,7 +50,7 @@ func NewListCmd(appOptions *applicationOptions) *cobra.Command { } func listApplication(cmd *cobra.Command, options *listOptions, args []string) error { - appList, resp, err := options.GateClient.ApplicationControllerApi.GetAllApplicationsUsingGET(options.GateClient.Context, map[string]interface{}{}) + appList, resp, err := options.GateClient.ApplicationControllerApi.GetAllApplicationsUsingGET(options.GateClient.Context, &gate.ApplicationControllerApiGetAllApplicationsUsingGETOpts{}) if err != nil { return err } diff --git a/cmd/canary/canary-config/delete.go b/cmd/canary/canary-config/delete.go index d783a32e..d612b34a 100644 --- a/cmd/canary/canary-config/delete.go +++ b/cmd/canary/canary-config/delete.go @@ -16,6 +16,7 @@ package canary_config import ( "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -56,7 +57,7 @@ func deleteCanaryConfig(cmd *cobra.Command, options *deleteOptions, args []strin } resp, err := options.GateClient.V2CanaryConfigControllerApi.DeleteCanaryConfigUsingDELETE( - options.GateClient.Context, id, map[string]interface{}{}) + options.GateClient.Context, id, &gate.V2CanaryConfigControllerApiDeleteCanaryConfigUsingDELETEOpts{}) if err != nil { return err } diff --git a/cmd/canary/canary-config/get.go b/cmd/canary/canary-config/get.go index e07cde2f..c924842e 100644 --- a/cmd/canary/canary-config/get.go +++ b/cmd/canary/canary-config/get.go @@ -17,6 +17,7 @@ package canary_config import ( "errors" "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -66,7 +67,7 @@ func getCanaryConfig(cmd *cobra.Command, options *getOptions, args []string) err } successPayload, resp, err := options.GateClient.V2CanaryConfigControllerApi.GetCanaryConfigUsingGET( - options.GateClient.Context, id, map[string]interface{}{}) + options.GateClient.Context, id, &gate.V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts{}) if err != nil { return err } diff --git a/cmd/canary/canary-config/list.go b/cmd/canary/canary-config/list.go index 435dbffe..3c01176d 100644 --- a/cmd/canary/canary-config/list.go +++ b/cmd/canary/canary-config/list.go @@ -16,6 +16,8 @@ package canary_config import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -53,7 +55,7 @@ func NewListCmd(canaryConfigOptions *canaryConfigOptions) *cobra.Command { func listCanaryConfig(cmd *cobra.Command, options *listOptions) error { successPayload, resp, err := options.GateClient.V2CanaryConfigControllerApi.GetCanaryConfigsUsingGET( - options.GateClient.Context, map[string]interface{}{"application": options.application}) + options.GateClient.Context, &gate.V2CanaryConfigControllerApiGetCanaryConfigsUsingGETOpts{Application: optional.NewString(options.application)}) if err != nil { return err } diff --git a/cmd/canary/canary-config/retro.go b/cmd/canary/canary-config/retro.go index e5242da6..8e070731 100644 --- a/cmd/canary/canary-config/retro.go +++ b/cmd/canary/canary-config/retro.go @@ -17,6 +17,8 @@ package canary_config import ( "errors" "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" "time" @@ -141,12 +143,12 @@ func retroCanaryConfig(cmd *cobra.Command, options *retroOptions) error { "executionRequest": executionRequest, } - initiateOptionalParams := map[string]interface{}{} + initiateOptionalParams := &gate.V2CanaryControllerApiInitiateCanaryWithConfigUsingPOSTOpts{} if options.metricsAccount != "" { - initiateOptionalParams["metricsAccountName"] = options.metricsAccount + initiateOptionalParams.MetricsAccountName = optional.NewString(options.metricsAccount) } if options.storageAccount != "" { - initiateOptionalParams["storageAccountName"] = options.storageAccount + initiateOptionalParams.StorageAccountName = optional.NewString(options.storageAccount) } options.Ui.Info("Initiating canary execution for supplied canary config") @@ -165,9 +167,9 @@ func retroCanaryConfig(cmd *cobra.Command, options *retroOptions) error { canaryExecutionId := canaryExecutionResp.(map[string]interface{})["canaryExecutionId"].(string) options.Ui.Info(fmt.Sprintf("Spawned canary execution with id %s, polling for completion...", canaryExecutionId)) - queryOptionalParams := map[string]interface{}{} + queryOptionalParams := &gate.V2CanaryControllerApiGetCanaryResultUsingGET1Opts{} if options.storageAccount != "" { - queryOptionalParams["storageAccountName"] = options.storageAccount + queryOptionalParams.StorageAccountName = optional.NewString(options.storageAccount) } canaryResult, canaryResultResp, canaryResultErr := options.GateClient.V2CanaryControllerApi.GetCanaryResultUsingGET1(options.GateClient.Context, canaryExecutionId, queryOptionalParams) diff --git a/cmd/canary/canary-config/save.go b/cmd/canary/canary-config/save.go index 03c75b04..fcbe89d6 100644 --- a/cmd/canary/canary-config/save.go +++ b/cmd/canary/canary-config/save.go @@ -16,6 +16,7 @@ package canary_config import ( "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -68,16 +69,16 @@ func saveCanaryConfig(cmd *cobra.Command, options *saveOptions) error { templateId := templateJson["id"].(string) _, resp, queryErr := options.GateClient.V2CanaryConfigControllerApi.GetCanaryConfigUsingGET( - options.GateClient.Context, templateId, map[string]interface{}{}) + options.GateClient.Context, templateId, &gate.V2CanaryConfigControllerApiGetCanaryConfigUsingGETOpts{}) var saveResp *http.Response var saveErr error if resp.StatusCode == http.StatusOK { _, saveResp, saveErr = options.GateClient.V2CanaryConfigControllerApi.UpdateCanaryConfigUsingPUT( - options.GateClient.Context, templateJson, templateId, map[string]interface{}{}) + options.GateClient.Context, templateJson, templateId, &gate.V2CanaryConfigControllerApiUpdateCanaryConfigUsingPUTOpts{}) } else if resp.StatusCode == http.StatusNotFound { _, saveResp, saveErr = options.GateClient.V2CanaryConfigControllerApi.CreateCanaryConfigUsingPOST( - options.GateClient.Context, templateJson, map[string]interface{}{}) + options.GateClient.Context, templateJson, &gate.V2CanaryConfigControllerApiCreateCanaryConfigUsingPOSTOpts{}) } else { if queryErr != nil { return queryErr diff --git a/cmd/pipeline-template/delete.go b/cmd/pipeline-template/delete.go index 73f88e22..2f109141 100644 --- a/cmd/pipeline-template/delete.go +++ b/cmd/pipeline-template/delete.go @@ -16,6 +16,8 @@ package pipeline_template import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -60,9 +62,9 @@ func deletePipelineTemplate(cmd *cobra.Command, options *deleteOptions, args []s return err } - queryParams := map[string]interface{}{} + queryParams := &gate.V2PipelineTemplatesControllerApiDeleteUsingDELETE1Opts{} if options.tag != "" { - queryParams["tag"] = options.tag + queryParams.Tag = optional.NewString(options.tag) } _, resp, err := options.GateClient.V2PipelineTemplatesControllerApi.DeleteUsingDELETE1(options.GateClient.Context, id, queryParams) diff --git a/cmd/pipeline-template/get.go b/cmd/pipeline-template/get.go index 2a4a81d7..8dc101a2 100644 --- a/cmd/pipeline-template/get.go +++ b/cmd/pipeline-template/get.go @@ -17,6 +17,8 @@ package pipeline_template import ( "errors" "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -68,9 +70,9 @@ func getPipelineTemplate(cmd *cobra.Command, options *getOptions, args []string) } } - queryParams := map[string]interface{}{} + queryParams := &gate.V2PipelineTemplatesControllerApiGetUsingGET2Opts{} if options.tag != "" { - queryParams["tag"] = options.tag + queryParams.Tag = optional.NewString(options.tag) } successPayload, resp, err := options.GateClient.V2PipelineTemplatesControllerApi.GetUsingGET2(options.GateClient.Context, diff --git a/cmd/pipeline-template/list.go b/cmd/pipeline-template/list.go index 6f5921be..caa0a66e 100644 --- a/cmd/pipeline-template/list.go +++ b/cmd/pipeline-template/list.go @@ -16,6 +16,8 @@ package pipeline_template import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -53,7 +55,7 @@ func NewListCmd(pipelineTemplateOptions *pipelineTemplateOptions) *cobra.Command func listPipelineTemplate(cmd *cobra.Command, options *listOptions) error { successPayload, resp, err := options.GateClient.V2PipelineTemplatesControllerApi.ListUsingGET1(options.GateClient.Context, - map[string]interface{}{"scopes": options.scopes}) + &gate.V2PipelineTemplatesControllerApiListUsingGET1Opts{Scopes: optional.NewInterface(options.scopes)}) if err != nil { return err } diff --git a/cmd/pipeline-template/save.go b/cmd/pipeline-template/save.go index 0e33071c..97cd229b 100644 --- a/cmd/pipeline-template/save.go +++ b/cmd/pipeline-template/save.go @@ -16,6 +16,8 @@ package pipeline_template import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -78,19 +80,29 @@ func savePipelineTemplate(cmd *cobra.Command, options *saveOptions) error { templateId := templateJson["id"].(string) - queryParams := map[string]interface{}{} + getQueryParam := &gate.V2PipelineTemplatesControllerApiGetUsingGET2Opts{} if options.tag != "" { - queryParams["tag"] = options.tag + getQueryParam.Tag = optional.NewString(options.tag) } - _, resp, queryErr := options.GateClient.V2PipelineTemplatesControllerApi.GetUsingGET2(options.GateClient.Context, templateId, queryParams) + _, resp, queryErr := options.GateClient.V2PipelineTemplatesControllerApi.GetUsingGET2(options.GateClient.Context, templateId, getQueryParam) var saveResp *http.Response var saveErr error if resp.StatusCode == http.StatusOK { - saveResp, saveErr = options.GateClient.V2PipelineTemplatesControllerApi.UpdateUsingPOST1(options.GateClient.Context, templateId, templateJson, queryParams) + opt := &gate.V2PipelineTemplatesControllerApiUpdateUsingPOST1Opts{} + if options.tag != "" { + opt.Tag = optional.NewString(options.tag) + } + + saveResp, saveErr = options.GateClient.V2PipelineTemplatesControllerApi.UpdateUsingPOST1(options.GateClient.Context, templateId, templateJson, opt) } else if resp.StatusCode == http.StatusNotFound { - saveResp, saveErr = options.GateClient.V2PipelineTemplatesControllerApi.CreateUsingPOST1(options.GateClient.Context, templateJson, queryParams) + opt := &gate.V2PipelineTemplatesControllerApiCreateUsingPOST1Opts{} + if options.tag != "" { + opt.Tag = optional.NewString(options.tag) + } + + saveResp, saveErr = options.GateClient.V2PipelineTemplatesControllerApi.CreateUsingPOST1(options.GateClient.Context, templateJson, opt) } else { if queryErr != nil { return queryErr diff --git a/cmd/pipeline/execute.go b/cmd/pipeline/execute.go index 26f8634f..8f815d2d 100644 --- a/cmd/pipeline/execute.go +++ b/cmd/pipeline/execute.go @@ -17,6 +17,8 @@ package pipeline import ( "errors" "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" @@ -106,7 +108,7 @@ func executePipeline(cmd *cobra.Command, options *executeOptions) error { resp, err := options.GateClient.PipelineControllerApi.InvokePipelineConfigUsingPOST1(options.GateClient.Context, options.application, options.name, - map[string]interface{}{"trigger": trigger}) + &gate.PipelineControllerApiInvokePipelineConfigUsingPOST1Opts{Trigger: optional.NewInterface(trigger)}) if err != nil { return fmt.Errorf("Execute pipeline failed with response: %v and error: %s\n", resp, err) } diff --git a/cmd/pipeline/execution/cancel.go b/cmd/pipeline/execution/cancel.go index 312cef82..f9de40dd 100644 --- a/cmd/pipeline/execution/cancel.go +++ b/cmd/pipeline/execution/cancel.go @@ -17,6 +17,7 @@ package execution import ( "errors" "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -57,7 +58,7 @@ func cancelExecution(cmd *cobra.Command, options *cancelOptions, args []string) resp, err := options.GateClient.PipelineControllerApi.CancelPipelineUsingPUT1(options.GateClient.Context, executionId, - map[string]interface{}{}) + &gate.PipelineControllerApiCancelPipelineUsingPUT1Opts{}) if err != nil { return err } diff --git a/cmd/pipeline/execution/get.go b/cmd/pipeline/execution/get.go index af263478..cd914ec1 100644 --- a/cmd/pipeline/execution/get.go +++ b/cmd/pipeline/execution/get.go @@ -16,6 +16,8 @@ package execution import ( "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" @@ -53,9 +55,9 @@ func getExecution(cmd *cobra.Command, options *getOptions, args []string) error return err } - query := map[string]interface{}{ - "executionIds": id, // Status filtering is ignored when executionId is supplied - "limit": int32(1), + query := &gate.ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts{ + ExecutionIds: optional.NewString(id), // Status filtering is ignored when executionId is supplied + Limit: optional.NewInt32(1), } successPayload, resp, err := options.GateClient.ExecutionsControllerApi.GetLatestExecutionsByConfigIdsUsingGET( diff --git a/cmd/pipeline/execution/list.go b/cmd/pipeline/execution/list.go index 82099d60..db2b10be 100644 --- a/cmd/pipeline/execution/list.go +++ b/cmd/pipeline/execution/list.go @@ -17,6 +17,8 @@ package execution import ( "errors" "fmt" + "github.com/antihax/optional" + gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" @@ -68,8 +70,8 @@ func listExecution(cmd *cobra.Command, options *listOptions) error { return errors.New("required parameter 'pipeline-id' not set") } - query := map[string]interface{}{ - "pipelineConfigIds": options.pipelineConfigId, + query := &gate.ExecutionsControllerApiGetLatestExecutionsByConfigIdsUsingGETOpts{ + PipelineConfigIds: optional.NewString(options.pipelineConfigId), } var statuses []string @@ -86,11 +88,11 @@ func listExecution(cmd *cobra.Command, options *listOptions) error { statuses = append(statuses, "CANCELED") } if len(statuses) > 0 { - query["statuses"] = strings.Join(statuses, ",") + query.Statuses = optional.NewString(strings.Join(statuses, ",")) } if options.limit > 0 { - query["limit"] = options.limit + query.Limit = optional.NewInt32(options.limit) } successPayload, resp, err := options.GateClient.ExecutionsControllerApi.GetLatestExecutionsByConfigIdsUsingGET( diff --git a/cmd/project/get_pipelines.go b/cmd/project/get_pipelines.go index 74295c63..f6f1f913 100644 --- a/cmd/project/get_pipelines.go +++ b/cmd/project/get_pipelines.go @@ -16,6 +16,7 @@ package project import ( "fmt" + gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spinnaker/spin/util" @@ -59,7 +60,7 @@ func getProjectPipelines(cmd *cobra.Command, options *getProjectPipelinesOptions return err } - project, resp, err := options.GateClient.ProjectControllerApi.AllPipelinesForProjectUsingGET(options.GateClient.Context, projectName, map[string]interface{}{"expand": options.expand}) + project, resp, err := options.GateClient.ProjectControllerApi.AllPipelinesForProjectUsingGET(options.GateClient.Context, projectName, &gate.ProjectControllerApiAllPipelinesForProjectUsingGETOpts{}) if resp != nil { if resp.StatusCode == http.StatusNotFound { return fmt.Errorf("Project '%s' not found\n", projectName) From dae229ff1fc52d695ddfe1c7d6f38f0c5ec9c690 Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Fri, 14 Aug 2020 16:35:16 -0700 Subject: [PATCH 4/6] tests(gateapi): gateapi generated code expects valid JSON and headers This also removes "*malformed" test cases since 2.14.4 doesn't return parsing errors https://github.com/swagger-api/swagger-codegen/issues/10434 reports the issue. hopefully https://github.com/swagger-api/swagger-codegen/pull/10429 be merged will add that ability back in. --- cmd/account/get_test.go | 36 +----------- cmd/account/list_test.go | 40 +------------ cmd/application/delete_test.go | 3 + cmd/application/get_test.go | 53 +---------------- cmd/application/list_test.go | 44 ++------------ cmd/application/save_test.go | 1 + cmd/canary/canary-config/get_test.go | 41 +------------ cmd/canary/canary-config/list_test.go | 43 +------------- cmd/canary/canary-config/retro.go | 1 - cmd/canary/canary-config/retro_test.go | 6 +- cmd/pipeline-template/get_test.go | 81 +------------------------- cmd/pipeline-template/list_test.go | 81 -------------------------- cmd/pipeline/get_test.go | 57 +----------------- cmd/pipeline/list_test.go | 58 ------------------ cmd/project/save_test.go | 1 + util/test_helpers.go | 2 + 16 files changed, 24 insertions(+), 524 deletions(-) diff --git a/cmd/account/get_test.go b/cmd/account/get_test.go index 16674210..1be7a259 100644 --- a/cmd/account/get_test.go +++ b/cmd/account/get_test.go @@ -107,21 +107,6 @@ func TestAccountGet_flags(t *testing.T) { } } -func TestAccountGet_malformed(t *testing.T) { - ts := testGateAccountGetMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewAccountCmd(rootOpts)) - - args := []string{"account", "get", ACCOUNT, "--gate-endpoint=" + ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { // Success is actually failure here, return payload is malformed. - t.Fatalf("Command failed with: %d", err) - } -} - func TestAccountGet_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -142,31 +127,12 @@ func TestAccountGet_fail(t *testing.T) { func testGateAccountGetSuccess() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/credentials/"+ACCOUNT, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(accountJson)) })) return httptest.NewServer(mux) } -// testGateAccountGetMalformed returns a malformed list of pipeline configs. -func testGateAccountGetMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/credentials/"+ACCOUNT, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedAccountGetJson)) - })) - return httptest.NewServer(mux) -} - -const malformedAccountGetJson = ` - "type": "kubernetes", - "providerVersion": "v2", - "environment": "self", - "skin": "v2", - "name": "self", - "cloudProvider": "kubernetes", - "accountType": "self" -} -` - const accountJson = ` { "type": "kubernetes", diff --git a/cmd/account/list_test.go b/cmd/account/list_test.go index 23c59a5c..92ca940d 100644 --- a/cmd/account/list_test.go +++ b/cmd/account/list_test.go @@ -41,21 +41,6 @@ func TestAccountList_basic(t *testing.T) { } } -func TestAccountList_malformed(t *testing.T) { - ts := testGateAccountListMalformed() - defer ts.Close() - - rootCmd, options := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewAccountCmd(options)) - - args := []string{"account", "list", "--gate-endpoint=" + ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestAccountList_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -74,35 +59,12 @@ func TestAccountList_fail(t *testing.T) { func testGateAccountListSuccess() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/credentials/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(accountListJson)) })) return httptest.NewServer(mux) } -func testGateAccountListMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/credentials/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedAccountListJson)) - })) - return httptest.NewServer(mux) -} - -const malformedAccountListJson = ` - { - "type": "kubernetes", - "skin": "v2", - "providerVersion": "v2", - "name": "foobar" - }, - { - "type": "dockerRegistry", - "skin": "v1", - "providerVersion": "v1", - "name": "dockerhub" - } -] -` - const accountListJson = `[ { "type": "kubernetes", diff --git a/cmd/application/delete_test.go b/cmd/application/delete_test.go index 1cbd1c14..0d6bd6e4 100644 --- a/cmd/application/delete_test.go +++ b/cmd/application/delete_test.go @@ -78,6 +78,7 @@ func testGateApplicationDeleteSuccess() *httptest.Server { mux.Handle("/applications/"+APP, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { payload := map[string]string{} // We don't use the payload, we are just checking if the target app exists. b, _ := json.Marshal(&payload) + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, string(b)) })) mux.Handle("/tasks", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -85,6 +86,7 @@ func testGateApplicationDeleteSuccess() *httptest.Server { "ref": "/tasks/id", } b, _ := json.Marshal(&payload) + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, string(b)) })) mux.Handle("/tasks/id", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -92,6 +94,7 @@ func testGateApplicationDeleteSuccess() *httptest.Server { "status": "SUCCEEDED", } b, _ := json.Marshal(&payload) + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, string(b)) })) return httptest.NewServer(mux) diff --git a/cmd/application/get_test.go b/cmd/application/get_test.go index 3899df77..cf32591f 100644 --- a/cmd/application/get_test.go +++ b/cmd/application/get_test.go @@ -114,21 +114,6 @@ func TestApplicationGet_flags(t *testing.T) { } } -func TestApplicationGet_malformed(t *testing.T) { - ts := testGateApplicationGetMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewApplicationCmd(rootOpts)) - - args := []string{"application", "get", APP, "--gate-endpoint=" + ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { // Success is actually failure here, return payload is malformed. - t.Fatalf("Command failed with: %d", err) - } -} - func TestApplicationGet_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -149,48 +134,12 @@ func TestApplicationGet_fail(t *testing.T) { func testGateApplicationGetSuccess() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/applications/"+APP, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(applicationJsonExpanded)) })) return httptest.NewServer(mux) } -// testGateApplicationGetMalformed returns a malformed list of pipeline configs. -func testGateApplicationGetMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/applications/"+APP, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedApplicationGetJson)) - })) - return httptest.NewServer(mux) -} - -const malformedApplicationGetJson = ` - "accounts": "account1", - "cloudproviders": [ - "gce", - "kubernetes" - ], - "createTs": "1527261941734", - "email": "app", - "instancePort": 80, - "lastModifiedBy": "anonymous", - "name": "app", - "permissions": { - "EXECUTE": [ - "admin-group" - ], - "READ": [ - "admin-group", - "user-group" - ], - "WRITE": [ - "admin-group" - ] - }, - "updateTs": "1527261941735", - "user": "anonymous" -} -` - // GET /applications/{app} returns an envelope with 'attributes' and 'clusters'. const applicationJsonExpanded = ` { diff --git a/cmd/application/list_test.go b/cmd/application/list_test.go index 3f7477f8..a03b49be 100644 --- a/cmd/application/list_test.go +++ b/cmd/application/list_test.go @@ -27,7 +27,7 @@ import ( ) func TestApplicationList_basic(t *testing.T) { - ts := testGateApplicationList(false) + ts := testGateApplicationList() defer ts.Close() rootCmd, options := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) @@ -41,21 +41,6 @@ func TestApplicationList_basic(t *testing.T) { } } -func TestApplicationList_malformed(t *testing.T) { - ts := testGateApplicationList(true) - defer ts.Close() - - rootCmd, options := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewApplicationCmd(options)) - - args := []string{"application", "list", "--gate-endpoint=" + ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestApplicationList_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -74,37 +59,16 @@ func TestApplicationList_fail(t *testing.T) { // testGateApplicationList spins up a local http server that we will configure the GateClient // to direct requests to. When 'returnMalformed' is false, responds with a 200 and a well-formed application list. // Returns a malformed list of application configs when 'returnMalformed' is true -func testGateApplicationList(returnMalformed bool) *httptest.Server { +func testGateApplicationList() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/applications", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if returnMalformed { - fmt.Fprintln(w, strings.TrimSpace(malformedApplicationListJson)) - } else { - fmt.Fprintln(w, strings.TrimSpace(applicationListJson)) - } + w.Header().Add("content-type", "application/json") + fmt.Fprintln(w, strings.TrimSpace(applicationListJson)) })) return httptest.NewServer(mux) } -const malformedApplicationListJson = ` - { - "accounts": "account1", - "cloudproviders": [ - "gce", - "kubernetes" - ], - "createTs": "1527261941734", - "email": "app", - "instancePort": 80, - "lastModifiedBy": "anonymous", - "name": "app", - "updateTs": "1527261941735", - "user": "anonymous", - } -] -` - const applicationListJson = ` [ { diff --git a/cmd/application/save_test.go b/cmd/application/save_test.go index a0c460f0..974062fc 100644 --- a/cmd/application/save_test.go +++ b/cmd/application/save_test.go @@ -336,6 +336,7 @@ func testGateAppSaveSuccess(buffer io.Writer) *httptest.Server { util.NewTestBufferHandlerFunc(http.MethodPost, buffer, http.StatusOK, strings.TrimSpace(testAppTaskRefJsonStr)), ) mux.Handle("/tasks/id", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(testAppTaskStatusJsonStr)) })) return httptest.NewServer(mux) diff --git a/cmd/canary/canary-config/get_test.go b/cmd/canary/canary-config/get_test.go index bf9cf426..2369423a 100644 --- a/cmd/canary/canary-config/get_test.go +++ b/cmd/canary/canary-config/get_test.go @@ -98,23 +98,6 @@ func TestCanaryConfigGet_args(t *testing.T) { } } -func TestCanaryConfigGet_malformed(t *testing.T) { - ts := testGateCanaryConfigGetMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - canaryCmd, canaryOpts := canary.NewCanaryCmd(rootOpts) - canaryCmd.AddCommand(NewCanaryConfigCmd(canaryOpts)) - rootCmd.AddCommand(canaryCmd) - - args := []string{"canary", "canary-config", "get", "--id", "3f3dbcc1", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestCanaryConfigGet_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -157,22 +140,12 @@ func testGateCanaryConfigGetSuccess() *httptest.Server { mux.Handle( "/v2/canaryConfig/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(canaryConfigGetJson)) })) return httptest.NewServer(mux) } -// testGateCanaryConfigGetMalformed returns a malformed get of canaryConfig configs. -func testGateCanaryConfigGetMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle( - "/v2/canaryConfig/", - http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedCanaryConfigGetJson)) - })) - return httptest.NewServer(mux) -} - // testGatePipelineGetMissing returns a 404 Not Found for an errant pipeline name|application pair. func testGateCanaryConfigGetMissing() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() @@ -182,18 +155,6 @@ func testGateCanaryConfigGetMissing() *httptest.Server { return httptest.NewServer(mux) } -const malformedCanaryConfigGetJson = ` -{{ - "applications": [ - "canaryconfigs" - ], - "id": "3f3dbcc1-002d-458c-b181-be4aa809922a", - "name": "exampleCanary", - "updatedTimestamp": 1568131247595, - "updatedTimestampIso": "2019-09-10T16:00:47.595Z" -} -` - const canaryConfigGetJson = ` { "applications": [ diff --git a/cmd/canary/canary-config/list_test.go b/cmd/canary/canary-config/list_test.go index a9c3d77e..1d60ef49 100644 --- a/cmd/canary/canary-config/list_test.go +++ b/cmd/canary/canary-config/list_test.go @@ -44,23 +44,6 @@ func TestCanaryConfigList_basic(t *testing.T) { } } -func TestCanaryConfigList_malformed(t *testing.T) { - ts := testGateCanaryConfigListMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - canaryCmd, canaryOpts := canary.NewCanaryCmd(rootOpts) - canaryCmd.AddCommand(NewCanaryConfigCmd(canaryOpts)) - rootCmd.AddCommand(canaryCmd) - - args := []string{"canary", "canary-config", "list", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestCanaryConfigList_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -85,43 +68,21 @@ func testGateCanaryConfigListSuccess() *httptest.Server { mux.Handle( "/v2/canaryConfig", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(canaryConfigListJson)) })) return httptest.NewServer(mux) } -// testGateCanaryConfigListMalformed returns a malformed list of canaryConfig configs. -func testGateCanaryConfigListMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle( - "/v2/canaryConfig", - http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedCanaryConfigListJson)) - })) - return httptest.NewServer(mux) -} - // testGateFail spins up a local http server that we will configure the GateClient // to direct requests to. Responds with a 500 InternalServerError. func testGateFail() *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") http.Error(w, "Internal Server Error", http.StatusInternalServerError) })) } -const malformedCanaryConfigListJson = ` - { - "applications": [ - "canaryconfigs" - ], - "id": "3f3dbcc1-002d-458c-b181-be4aa809922a", - "name": "exampleCanary", - "updatedTimestamp": 1568131247595, - "updatedTimestampIso": "2019-09-10T16:00:47.595Z" - } -] -` - const canaryConfigListJson = ` [ { diff --git a/cmd/canary/canary-config/retro.go b/cmd/canary/canary-config/retro.go index 8e070731..58f313b6 100644 --- a/cmd/canary/canary-config/retro.go +++ b/cmd/canary/canary-config/retro.go @@ -173,7 +173,6 @@ func retroCanaryConfig(cmd *cobra.Command, options *retroOptions) error { } canaryResult, canaryResultResp, canaryResultErr := options.GateClient.V2CanaryControllerApi.GetCanaryResultUsingGET1(options.GateClient.Context, canaryExecutionId, queryOptionalParams) - if canaryResultErr != nil { return canaryResultErr } diff --git a/cmd/canary/canary-config/retro_test.go b/cmd/canary/canary-config/retro_test.go index bec2ee1f..5e7c350f 100644 --- a/cmd/canary/canary-config/retro_test.go +++ b/cmd/canary/canary-config/retro_test.go @@ -169,10 +169,12 @@ func TestCanaryConfigRetro_timeout(t *testing.T) { func gateServerRetroPass() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/v2/canaries/canary", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") w.Write([]byte(canaryExecRespJson)) })) mux.Handle("/v2/canaries/canary/executionId", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") w.Write([]byte(canaryFinishedPassJson)) })) return httptest.NewServer(mux) @@ -181,10 +183,12 @@ func gateServerRetroPass() *httptest.Server { func gateServerExecHang() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/v2/canaries/canary", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") w.Write([]byte(canaryExecRespJson)) })) mux.Handle("/v2/canaries/canary/executionId", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") w.Write([]byte(canaryUnfinishedJson)) })) return httptest.NewServer(mux) @@ -198,7 +202,7 @@ const canaryExecRespJson = ` const canaryUnfinishedJson = ` { - "complete": false, + "complete": false } ` diff --git a/cmd/pipeline-template/get_test.go b/cmd/pipeline-template/get_test.go index 9e6432b6..b978c665 100644 --- a/cmd/pipeline-template/get_test.go +++ b/cmd/pipeline-template/get_test.go @@ -122,22 +122,6 @@ func TestPipelineGet_flags(t *testing.T) { } } -func TestPipelineGet_malformed(t *testing.T) { - ts := testGatePipelineTemplateGetMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewPipelineTemplateCmd(rootOpts)) - - args := []string{"pipeline-template", "get", "--id", "newSpelTemplate", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestPipelineGet_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -175,20 +159,12 @@ func TestPipelineGet_notfound(t *testing.T) { func testGatePipelineTemplateGetSuccess() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/v2/pipelineTemplates/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(pipelineTemplateGetJson)) })) return httptest.NewServer(mux) } -// testGatePipelineGetMalformed returns a malformed get response of pipeline configs. -func testGatePipelineTemplateGetMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/v2/pipelineTemplates/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedPipelineTemplateGetJson)) - })) - return httptest.NewServer(mux) -} - // testGatePipelineGetMissing returns a 404 Not Found for an errant pipeline name|application pair. func testGatePipelineTemplateGetMissing() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() @@ -207,61 +183,6 @@ func testGateFail() *httptest.Server { })) } -const malformedPipelineTemplateGetJson = ` - "id": "newSpelTemplate", - "lastModifiedBy": "anonymous", - "metadata": { - "description": "A generic application bake and tag pipeline.", - "name": "Default Bake and Tag", - "owner": "example@example.com", - "scopes": [ - "global" - ] - }, - "pipeline": { - "description": "", - "keepWaitingPipelines": false, - "lastModifiedBy": "anonymous", - "limitConcurrent": true, - "notifications": [], - "parameterConfig": [], - "stages": [ - { - "name": "My Wait Stage", - "refId": "wait1", - "requisiteStageRefIds": [], - "type": "wait", - "waitTime": "${ templateVariables.waitTime }" - } - ], - "triggers": [ - { - "attributeConstraints": {}, - "enabled": true, - "payloadConstraints": {}, - "pubsubSystem": "google", - "source": "jtk54", - "subscription": "super-pub", - "subscriptionName": "super-pub", - "type": "pubsub" - } - ], - "updateTs": "1543509523663" - }, - "protect": false, - "schema": "v2", - "updateTs": "1543860678988", - "variables": [ - { - "defaultValue": 42, - "description": "The time a wait stage shall pauseth", - "name": "waitTime", - "type": "int" - } - ] -} -` - const pipelineTemplateGetJson = ` { "id": "newSpelTemplate", diff --git a/cmd/pipeline-template/list_test.go b/cmd/pipeline-template/list_test.go index 4e6ebde7..7b21db34 100644 --- a/cmd/pipeline-template/list_test.go +++ b/cmd/pipeline-template/list_test.go @@ -56,21 +56,6 @@ func TestPipelineTemplateList_scope(t *testing.T) { } } -func TestPipelineTemplateList_malformed(t *testing.T) { - ts := testGatePipelineTemplateListMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - rootCmd.AddCommand(NewPipelineTemplateCmd(rootOpts)) - - args := []string{"pipeline-template", "list", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestPipelineTemplateList_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -106,72 +91,6 @@ func testGateScopedPipelineTemplateListSuccess() *httptest.Server { return httptest.NewServer(mux) } -// testGatePipelineTemplateListMalformed returns a malformed list of pipelineTemplate configs. -func testGatePipelineTemplateListMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/v2/pipelineTemplates/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedPipelineTemplateListJson)) - })) - return httptest.NewServer(mux) -} - -const malformedPipelineTemplateListJson = ` - { - "id": "newSpelTemplate", - "lastModifiedBy": "anonymous", - "metadata": { - "description": "A generic application wait.", - "name": "Default Wait", - "owner": "example@example.com", - "scopes": [ - "global" - ] - }, - "pipeline": { - "description": "", - "keepWaitingPipelines": false, - "lastModifiedBy": "anonymous", - "limitConcurrent": true, - "notifications": [], - "parameterConfig": [], - "stages": [ - { - "name": "My Wait Stage", - "refId": "wait1", - "requisiteStageRefIds": [], - "type": "wait", - "waitTime": "${ templateVariables.waitTime }" - } - ], - "triggers": [ - { - "attributeConstraints": {}, - "enabled": true, - "payloadConstraints": {}, - "pubsubSystem": "google", - "source": "jake", - "subscription": "super-why", - "subscriptionName": "super-why", - "type": "pubsub" - } - ], - "updateTs": "1543509523663" - }, - "protect": false, - "schema": "v2", - "updateTs": "1543860678988", - "variables": [ - { - "defaultValue": 42, - "description": "The time a wait stage shall pauseth", - "name": "waitTime", - "type": "int" - } - ] - } -] -` - const pipelineTemplateListJson = ` [ { diff --git a/cmd/pipeline/get_test.go b/cmd/pipeline/get_test.go index de0b65b2..977aeca1 100644 --- a/cmd/pipeline/get_test.go +++ b/cmd/pipeline/get_test.go @@ -91,22 +91,6 @@ func TestPipelineGet_flags(t *testing.T) { } } -func TestPipelineGet_malformed(t *testing.T) { - ts := testGatePipelineGetMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - pipelineCmd, _ := NewPipelineCmd(rootOpts) - rootCmd.AddCommand(pipelineCmd) - - args := []string{"pipeline", "get", "--application", "app", "--name", "one", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestPipelineGet_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -144,20 +128,12 @@ func TestPipelineGet_notfound(t *testing.T) { func testGatePipelineGetSuccess() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() mux.Handle("/applications/app/pipelineConfigs/one", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(pipelineGetJson)) })) return httptest.NewServer(mux) } -// testGatePipelineGetMalformed returns a malformed get response of pipeline configs. -func testGatePipelineGetMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/applications/app/pipelineConfigs/one", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedPipelineGetJson)) - })) - return httptest.NewServer(mux) -} - // testGatePipelineGetMissing returns a 404 Not Found for an errant pipeline name|application pair. func testGatePipelineGetMissing() *httptest.Server { mux := util.TestGateMuxWithVersionHandler() @@ -167,37 +143,6 @@ func testGatePipelineGetMissing() *httptest.Server { return httptest.NewServer(mux) } -const malformedPipelineGetJson = ` - "application": "app", - "id": "pipeline_one", - "index": 0, - "keepWaitingPipelines": false, - "lastModifiedBy": "jacobkiefer@google.com", - "limitConcurrent": true, - "name": "one", - "parameterConfig": [ - { - "default": "blah", - "description": "A foo.", - "name": "foooB", - "required": true - } - ], - "stages": [ - { - "comments": "${ parameters.derp }", - "name": "Wait", - "refId": "1", - "requisiteStageRefIds": [], - "type": "wait", - "waitTime": 30 - } - ], - "triggers": [], - "updateTs": "1526578883109" -} -` - const pipelineGetJson = ` { "application": "app", diff --git a/cmd/pipeline/list_test.go b/cmd/pipeline/list_test.go index 1f383cc5..3558e7f2 100644 --- a/cmd/pipeline/list_test.go +++ b/cmd/pipeline/list_test.go @@ -58,22 +58,6 @@ func TestPipelineList_flags(t *testing.T) { } } -func TestPipelineList_malformed(t *testing.T) { - ts := testGatePipelineListMalformed() - defer ts.Close() - - rootCmd, rootOpts := cmd.NewCmdRoot(ioutil.Discard, ioutil.Discard) - pipelineCmd, _ := NewPipelineCmd(rootOpts) - rootCmd.AddCommand(pipelineCmd) - - args := []string{"pipeline", "list", "--application", "app", "--gate-endpoint", ts.URL} - rootCmd.SetArgs(args) - err := rootCmd.Execute() - if err == nil { - t.Fatalf("Command failed with: %s", err) - } -} - func TestPipelineList_fail(t *testing.T) { ts := testGateFail() defer ts.Close() @@ -100,48 +84,6 @@ func testGatePipelineListSuccess() *httptest.Server { return httptest.NewServer(mux) } -// testGatePipelineListMalformed returns a malformed list of pipeline configs. -func testGatePipelineListMalformed() *httptest.Server { - mux := util.TestGateMuxWithVersionHandler() - mux.Handle("/applications/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, strings.TrimSpace(malformedPipelineListJson)) - })) - return httptest.NewServer(mux) -} - -const malformedPipelineListJson = ` - { - "application": "app", - "id": "pipeline1", - "index": 0, - "keepWaitingPipelines": false, - "lastModifiedBy": "jacobkiefer@google.com", - "limitConcurrent": true, - "name": "derp1", - "parameterConfig": [ - { - "default": "bar", - "description": "A foo.", - "name": "foo", - "required": true - } - ], - "stages": [ - { - "comments": "${ parameters.derp }", - "name": "Wait", - "refId": "1", - "requisiteStageRefIds": [], - "type": "wait", - "waitTime": 30 - } - ], - "triggers": [], - "updateTs": "1526578883109" - } -] -` - const pipelineListJson = ` [ { diff --git a/cmd/project/save_test.go b/cmd/project/save_test.go index 56757680..2808ac89 100644 --- a/cmd/project/save_test.go +++ b/cmd/project/save_test.go @@ -198,6 +198,7 @@ func testGateProjectSaveSuccess(buffer io.Writer) *httptest.Server { util.NewTestBufferHandlerFunc(http.MethodPost, buffer, http.StatusOK, strings.TrimSpace(testAppTaskRefJsonStr)), ) mux.Handle("/tasks/id", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, strings.TrimSpace(testProjectTaskStatusJsonStr)) })) return httptest.NewServer(mux) diff --git a/util/test_helpers.go b/util/test_helpers.go index 12eb688c..7db0d97e 100644 --- a/util/test_helpers.go +++ b/util/test_helpers.go @@ -19,6 +19,7 @@ func TestGateMuxWithVersionHandler() *http.ServeMux { "version": "Unknown", } b, _ := json.Marshal(&payload) + w.Header().Add("content-type", "application/json") fmt.Fprintln(w, string(b)) })) @@ -58,6 +59,7 @@ func NewTestBufferHandlerFunc(method string, requestBuffer io.Writer, responseHe } // Empty response body. Status: 200 Success + w.Header().Add("content-type", "application/json") w.WriteHeader(responseHeader) fmt.Fprintln(w, responseBody) }) From 112b37e617e4f49967c8db5c6277000734d2f523 Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Mon, 17 Aug 2020 16:52:14 -0700 Subject: [PATCH 5/6] refactor(imports): fixed import styling --- cmd/account/get.go | 4 ++-- cmd/account/list.go | 5 +++-- cmd/application/delete.go | 7 +++---- cmd/application/get.go | 8 ++++---- cmd/application/list.go | 3 ++- cmd/canary/canary-config/delete.go | 2 +- cmd/canary/canary-config/get.go | 2 +- cmd/canary/canary-config/list.go | 5 +++-- cmd/canary/canary-config/retro.go | 4 ++-- cmd/canary/canary-config/save.go | 3 ++- cmd/pipeline-template/delete.go | 4 ++-- cmd/pipeline-template/get.go | 4 ++-- cmd/pipeline-template/list.go | 5 +++-- cmd/pipeline-template/save.go | 4 ++-- cmd/pipeline/execute.go | 4 ++-- cmd/pipeline/execution/cancel.go | 2 +- cmd/pipeline/execution/get.go | 4 ++-- cmd/pipeline/execution/list.go | 5 +++-- cmd/project/get_pipelines.go | 3 ++- 19 files changed, 42 insertions(+), 36 deletions(-) diff --git a/cmd/account/get.go b/cmd/account/get.go index 9bf7cd12..97655f04 100644 --- a/cmd/account/get.go +++ b/cmd/account/get.go @@ -16,10 +16,10 @@ package account import ( "fmt" - gate "github.com/spinnaker/spin/gateapi" - "net/http" + gate "github.com/spinnaker/spin/gateapi" + "github.com/spf13/cobra" "github.com/spinnaker/spin/util" diff --git a/cmd/account/list.go b/cmd/account/list.go index 078563f1..e74aeb6e 100644 --- a/cmd/account/list.go +++ b/cmd/account/list.go @@ -16,11 +16,12 @@ package account import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + + gate "github.com/spinnaker/spin/gateapi" ) type listOptions struct { diff --git a/cmd/application/delete.go b/cmd/application/delete.go index 78d8f8da..565ad3a2 100644 --- a/cmd/application/delete.go +++ b/cmd/application/delete.go @@ -16,14 +16,13 @@ package application import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" - orca_tasks "github.com/spinnaker/spin/cmd/orca-tasks" - + "github.com/antihax/optional" "github.com/spf13/cobra" + orca_tasks "github.com/spinnaker/spin/cmd/orca-tasks" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/application/get.go b/cmd/application/get.go index 72d3705a..ad1a01dc 100644 --- a/cmd/application/get.go +++ b/cmd/application/get.go @@ -16,13 +16,13 @@ package application import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" - "github.com/spinnaker/spin/util" - + "github.com/antihax/optional" "github.com/spf13/cobra" + + gate "github.com/spinnaker/spin/gateapi" + "github.com/spinnaker/spin/util" ) type getOptions struct { diff --git a/cmd/application/list.go b/cmd/application/list.go index 498ff79b..2a34ccfb 100644 --- a/cmd/application/list.go +++ b/cmd/application/list.go @@ -16,9 +16,10 @@ package application import ( "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" + gate "github.com/spinnaker/spin/gateapi" + "github.com/spf13/cobra" ) diff --git a/cmd/canary/canary-config/delete.go b/cmd/canary/canary-config/delete.go index d612b34a..a51c15ed 100644 --- a/cmd/canary/canary-config/delete.go +++ b/cmd/canary/canary-config/delete.go @@ -16,11 +16,11 @@ package canary_config import ( "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/canary/canary-config/get.go b/cmd/canary/canary-config/get.go index c924842e..9fb7289b 100644 --- a/cmd/canary/canary-config/get.go +++ b/cmd/canary/canary-config/get.go @@ -17,11 +17,11 @@ package canary_config import ( "errors" "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/canary/canary-config/list.go b/cmd/canary/canary-config/list.go index 3c01176d..3371960d 100644 --- a/cmd/canary/canary-config/list.go +++ b/cmd/canary/canary-config/list.go @@ -16,11 +16,12 @@ package canary_config import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + + gate "github.com/spinnaker/spin/gateapi" ) type listOptions struct { diff --git a/cmd/canary/canary-config/retro.go b/cmd/canary/canary-config/retro.go index 58f313b6..f6429794 100644 --- a/cmd/canary/canary-config/retro.go +++ b/cmd/canary/canary-config/retro.go @@ -17,14 +17,14 @@ package canary_config import ( "errors" "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" "time" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/canary/canary-config/save.go b/cmd/canary/canary-config/save.go index fcbe89d6..9179e1af 100644 --- a/cmd/canary/canary-config/save.go +++ b/cmd/canary/canary-config/save.go @@ -16,9 +16,10 @@ package canary_config import ( "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" + gate "github.com/spinnaker/spin/gateapi" + "github.com/spf13/cobra" "github.com/spinnaker/spin/util" diff --git a/cmd/pipeline-template/delete.go b/cmd/pipeline-template/delete.go index 2f109141..d3f4c593 100644 --- a/cmd/pipeline-template/delete.go +++ b/cmd/pipeline-template/delete.go @@ -16,12 +16,12 @@ package pipeline_template import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline-template/get.go b/cmd/pipeline-template/get.go index 8dc101a2..83d99d45 100644 --- a/cmd/pipeline-template/get.go +++ b/cmd/pipeline-template/get.go @@ -17,12 +17,12 @@ package pipeline_template import ( "errors" "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline-template/list.go b/cmd/pipeline-template/list.go index caa0a66e..568d23e2 100644 --- a/cmd/pipeline-template/list.go +++ b/cmd/pipeline-template/list.go @@ -16,11 +16,12 @@ package pipeline_template import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + + gate "github.com/spinnaker/spin/gateapi" ) type listOptions struct { diff --git a/cmd/pipeline-template/save.go b/cmd/pipeline-template/save.go index 97cd229b..74694aee 100644 --- a/cmd/pipeline-template/save.go +++ b/cmd/pipeline-template/save.go @@ -16,12 +16,12 @@ package pipeline_template import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline/execute.go b/cmd/pipeline/execute.go index 8f815d2d..810053d9 100644 --- a/cmd/pipeline/execute.go +++ b/cmd/pipeline/execute.go @@ -17,13 +17,13 @@ package pipeline import ( "errors" "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline/execution/cancel.go b/cmd/pipeline/execution/cancel.go index f9de40dd..ebe39afb 100644 --- a/cmd/pipeline/execution/cancel.go +++ b/cmd/pipeline/execution/cancel.go @@ -17,11 +17,11 @@ package execution import ( "errors" "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline/execution/get.go b/cmd/pipeline/execution/get.go index cd914ec1..41e8d97f 100644 --- a/cmd/pipeline/execution/get.go +++ b/cmd/pipeline/execution/get.go @@ -16,12 +16,12 @@ package execution import ( "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" + "github.com/antihax/optional" "github.com/spf13/cobra" + gate "github.com/spinnaker/spin/gateapi" "github.com/spinnaker/spin/util" ) diff --git a/cmd/pipeline/execution/list.go b/cmd/pipeline/execution/list.go index db2b10be..67c70609 100644 --- a/cmd/pipeline/execution/list.go +++ b/cmd/pipeline/execution/list.go @@ -17,12 +17,13 @@ package execution import ( "errors" "fmt" - "github.com/antihax/optional" - gate "github.com/spinnaker/spin/gateapi" "net/http" "strings" + "github.com/antihax/optional" "github.com/spf13/cobra" + + gate "github.com/spinnaker/spin/gateapi" ) type listOptions struct { diff --git a/cmd/project/get_pipelines.go b/cmd/project/get_pipelines.go index f6f1f913..48028483 100644 --- a/cmd/project/get_pipelines.go +++ b/cmd/project/get_pipelines.go @@ -16,9 +16,10 @@ package project import ( "fmt" - gate "github.com/spinnaker/spin/gateapi" "net/http" + gate "github.com/spinnaker/spin/gateapi" + "github.com/spinnaker/spin/util" "github.com/spf13/cobra" From dae28944d2ab46d5ff9d3369b029ece4a82d9241 Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Mon, 17 Aug 2020 16:56:38 -0700 Subject: [PATCH 6/6] chore(gateapi): use swagger-cli 2.4.15 --- gateapi/.swagger-codegen/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateapi/.swagger-codegen/VERSION b/gateapi/.swagger-codegen/VERSION index 3eb2ae3e..9b83c553 100644 --- a/gateapi/.swagger-codegen/VERSION +++ b/gateapi/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.14 \ No newline at end of file +2.4.15 \ No newline at end of file